Problem with wrapping and collision

abacussssssabacussssss Member Posts: 2

Why isn't this game working? The player is supposed to be allowed to change direction only when adjacent to ground, wrapping around when it hits the edge. But instead, it teleports around, disappearing at times. Is there a way to fix this?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Not sure why yet but if you pare it down to just the red Player actor (no ground actors) and just that actor's Otherwise section (the Every 0 Timer), it still teleports.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2017

    Okay, I think the problem is that you're essentially constraining self.Position.X to self.Position.X+40. This can cause problems. Instead, set a target and move to that:

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822

    @tatiang said:
    Okay, I think the problem is that you're essentially constraining self.Position.X to self.Position.X+40. This can cause problems.

    Yep, that will move the actor to the right at a speed to 2,400 ppi !

  • abacussssssabacussssss Member Posts: 2

    @tatiang said:
    Okay, I think the problem is that you're essentially constraining self.Position.X to self.Position.X+40. This can cause problems. Instead, set a target and move to that:

    I just tried that and it still doesn't work. Did I implement your suggestion incorrectly?

Sign In or Register to comment.