Forum rules - please read before posting.

Saving Variable Value for Interactions

Hello,

In my game I have a "drawer" object with "use" and "look at" interactions.

I created a three variables for proper behavoiur:

DrawerOpened: A boolean variable determines If the drawer is opened or not. 
DrawerOpenTimes / LookAtDrawer: An integer variables that allows me to give different answers.

These are the schemes from actionlist node editor that I have.

il-logik.com/thekhampruebas/Interaction_Look_At.png
il-logik.com/thekhampruebas/Interaction_Use.png

This is correct? Or I should recover, somehow, the value of the variable at this time?

In the same process, when the opening drawer animation occurs it gets stuck, as if trembling.
I attached a link where you can check this issue.


Thanks!

pd. I'm working on the textures, for those pink and gray objects do not worry xD. In addition I have a problem with camera triggers, that in another post...

Comments

  • You're not ever setting the value of DrawerOpened to True - you may want to do that before your "Variable: Run sequence" in your Use interaction.

    Your drawer opening animation problem would depend on the Physics settings you've set up within Unity.  Does it have a Rigidbody, or Collider that's not set to "Is Trigger?"?  Try checking that last option and see if that improves things.
  • Hi Chris,

    Thank you very much for your help. I could solve the problem in ActionList panel, as you say, adding a Variable: Set (True), indicating that the drawer is open. Now all interactions are working properly.

    I'm still having problems with the drawer animation. My drawer 3d model is an element made in Blender and linked to a cube in Unity which acts as a "pivot" of it. This element have a Box Collider with "Is trigger" checked. In the same group, I have nested another object with which to interact, to catch and place in inventory (Argum Seeds).

    I added a screen where you can check what discussed above. Although it's a concerning Unity issue, could you help me?

    il-logik.com/thekhampruebas/Screen_Drawer.png

    Thank you very much again.
  • There's not much I can glean from that, but I don't know why you're using an invisible cube parent as the pivot.  You can animate the drawer model directly in the Unity Animation window - no need for Colliders, just the model and an Animator component.
  • The truth is that while I got used to put animated objects within another object and abuse guess sometimes it xD
    I tried again, now directly on the drawer and got the same result.
    I ask in the official forum of Unity as this is not a battle with AC.

    Chris thank you very much! I'm really enjoying thanks to the ease of working with AC.

    Pd:
    I solved the problem I had with the trigged cameras, it was just a matter of the order in which they where.
  • Hello again,

    I've been watching carefully the problem I had with the drawer. 

    I have a "Drawer" Hotspot (for drawer object) and inside other hotspot (for a "ArgumSeed" box). I discovered that, when the animation "DrawerOpen" is playing, the Hotspot don't move and Collide. You can see in this video.


    I think here is the problem: The hotspot don't copy the object transforms.
    How I can solve it?

    In my scene also I have a door with another anchored object and I think the same problem will happen here.

    Thanks!
  • You can just parent your Hotspot to the drawer - it doesn't have to be in the "_Hotspots" folder, that's just for convenience.
  • Hi Chris,
    I solved part of problem with parent hotspot to object, but still had the same problem with the animation.

    Then I returned to the animation and after changing some settings in the inspector has worked!

    Thanks so much!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.