Path Move Node Help

Discussion in 'How Can I...?' started by Saba, Jun 9, 2020.

  1. Saba

    Saba Boxer

    Joined:
    Aug 2, 2018
    Messages:
    12
    Likes Received:
    4
    Hi guys,

    I'm creating a relay race type of game using the path move nodes for characters. So once character A reaches a certain point, they spawn Character B, and this character needs to then continue the race from the place it was spawned.
    The problem is that Character B goes back to the start position of the level once it's spawned, instead of moving from the spawn position.
    Any ideas how to fix this?

    Note: I am using a touch node that then activates the path move, on touch for the characters.
    Also I spoke to a programmer friend, who doesn't know javascript but he gave me some clues on to what may be wrong.
    He told me that perhaps it this line in the init function that is causing the issue, in the path move node.

    scenePos = ent.worldPosition().sub(ent.position());

    This is then being called in the function update as
    this.entity().setPosition(
    p.x - scenePos.x,
    p.y - scenePos.y,
    p.z - scenePos.z);

    He suggested that I save the last position of my character to some variable and then assign that variable to the setPosition.

    That's what I have so far, but not a coder myself, so would really appreciate some help here. I have already contacted support and they gave me some suggestions, but none of them fixed this issue.

    Thanks in advance!
     
  2. Elite Games

    Elite Games Avid Boxer

    Joined:
    Dec 18, 2019
    Messages:
    184
    Likes Received:
    84
    Can you provide us your example bbdoc ?
    Without looking into it i cannot create logic like this.;)
     
  3. Saba

    Saba Boxer

    Joined:
    Aug 2, 2018
    Messages:
    12
    Likes Received:
    4
    Currently I have solved this by using the offset value and setting it really high for the subsequent characters. The only problem is that this means those characters will always start from that set point, so it is limiting in level design. The bbdoc is quite large. I'll clean it up and add this here for reference.
    I was also playing with the "Setautoupdate" to "true" which was working to some extent but messed up the movement.
     

Share This Page