Forum rules - please read before posting.

Open and close door.

Hello, I would like to ask some help.
I'm learning how to use AC, incredible asset.
I followed the tutorials yet I don't manage to implement a simple feature.

I've a object "TV_Room_Left_Door"
it has a Highlight, a Moveable and a Remember Transform scripts.

I created a Hotspot "Tv_Room_Left_Door_Hotspot" with two interactions of  "Use" type - (0) is enabled and calls the action "Tv_Room_Left_Door_Hotspot: Open", (1) is disabled and calls the action "Tv_Room_Left_Door_Hotspot: Close".

The "Tv_Room_Left_Door_Hotspot: Open" features 3 Actions:
(0) Object Transform - Moveable: TV_Room_Left_Door - Rotate by Y +120 - After Running: Stop.
(1) Hotspot - Change interaction - Hotspot to change Tv_Room_Left_Door_Hotspot - Interaction to change: 0:Use - Change to make: Disable - After Running: Continue.
(2) Hotspot - Change interaction - Hotspot to change Tv_Room_Left_Door_Hotspot - Interaction to change: 1:Use - Change to make: Enable - After Running: Continue (or stop... I tried both).

The "Tv_Room_Left_Door_Hotspot: Close" features one action:
(0) Object Transform - Moveable: TV_Room_Left_Door - Rotate by Y -120 - After Running: Stop.

Yet, I can open the door, but can't close it
What am I doing wrong?

Thank you for your time and help.

Comments

  • Welcome to the forum, @AlessandroPReviti!

    From the sounds of it, it's because you've set your "After running" field in the first Action to "Stop".  This will stop the entire Interaction - not just the Action.

    I'd recommend using the node-based Action List Editor window when building your Actions, as it makes it much easier to visualise the flow of Actions than just working in the Inspector.  You can open it up by clicking on the icon beside the Interaction in the Hierarchy window.

    Also, if your Interation method is set to Context Sensitive (in the Settings Manager), then you don't need to have the Hotspot's second Interaction disabled - only the first-active will be recognised.

  • Thank you Chris. Node based interface is exactly what I needed to start using, my bad for not having explored this feature enough.
    I was able to set up a  opening and closing door in no time, but with a different structure: I have just one action that checks a bol for the var Open, rotates the door and change the var, it's simple and I think reliable, the door opens and closes.

    I'm sorry to still bother with my issue but the final result is still not fully accurate and I'm not sure if it's a bug in Unity, in AC, or my lack of knowledge.
    When I click on my door, the door rotates by 120° to open. When I click back it should rotate by  -120° but it does by far less (I don't know how much, but I might say it rotates of -60°).

    I will for the time being user forced rotation "rotate to", but it's not a flexible method and I would like to know what's my misunderstanding with the angles.

    Thank you for your help, Chris.

    image
  • The "Rotate By" method has long been a source of trouble, despite my efforts to improve it.  If you are able to use the "Rotate To" method instead, I would definitely recommend that.  One other option at your disposal is to instead rely on a Marker's transform as a reference point - which you can do by changing "Rotate" to "Copy Marker".
  • Thank you Chris!
    You're surprisingly fast in answering and very helpful.
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.