Announcement

Collapse
No announcement yet.

Get Distance Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Get Distance Problem

    Hi there,

    I'm trying to build some code that basically gives the distance between a trigger and the players last location on key press.

    I'm using the following code to set each trigger location in a variable:

    Click image for larger version

Name:	SetTriggerLoc.jpg
Views:	7
Size:	213.1 KB
ID:	1616919

    Perform the calculation on key press then output:
    Click image for larger version

Name:	GetTrigLoc.jpg
Views:	7
Size:	124.8 KB
ID:	1616920

    Now there's a bit of an issue there are a shed load of triggers in my map but only one active one at a time that updates the trigger position value each time, each trigger activating the subsequent one.

    So trigger A once selected/triggered will move trigger A below the player surface (making it inactive) and brings trigger B to the player surface so it can now be triggered by the player.

    Each time the next trigger is brought in it updates the trigger location variable.

    What am I doing wrong here?

    #2
    Can Anyone help?

    Comment


      #3
      what is happening with your current setup that is wrong?
      YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

      Comment


        #4
        It doesn't seem to update correctly

        Comment


          #5
          you may be aware but I don't think the move component to node is going to move the actor position. it's just moving the collision part of the actor.
          YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

          Comment


            #6
            Originally posted by IndieGameCove View Post
            you may be aware but I don't think the move component to node is going to move the actor position. it's just moving the collision part of the actor.
            that’s the only way you can get the trigger to move, seems to work though?

            its the updating that’s an issue

            Comment


              #7
              just tested. i was mistaken, seems that if the component being moved is the root then the whole actor is moved.

              Sorry I'm not sure what's wrong then.
              maybe put a few print strings in there at various point to make sure the events are being called at the right time. see if you can find the point where the code doesn't work as expected.
              YT Channel: https://www.youtube.com/channel/UCoc...KYPSK6g7vZ5CNg

              Comment

              Working...
              X