Forum rules - please read before posting.

Check object's position?

Is there a simple way to detect a moveable object's x-position? I want to run an action when a certain object that is being moved by an Object->Transform action has reached a specific x-value.

Comments

  • edited October 2015

  • After some searching the forum, I stumbled across a solution where you can send a value to an AC variable from a script. This was the code I used, and then I made an action trigging a cutscene when the x-position was at my threshold.

    AC.LocalVariables.SetFloatValue (0this.transform.position.x);
    AC.LocalVariables.GetVariable (0).Upload ();

  • The Upload() function is only used for variables that are linked to PlayMaker or Options data.  Calling SetFloatValue should be enough.
  • Can't you put down a trigger at the X point and have that trigger detect the object ?
  • @ChrisIceBox  Ah, thanks. That makes sense.

    @klarax That might also be a solution. I got it working with the above code though, thanks.
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.