GameSalad

Problem with wrapping and collision

abacussssssabacussssss Posts: 2Member

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 Posts: 11,039Member, Sous Chef, PRO, Senior Sous-Chef

    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 Posts: 11,039Member, Sous Chef, PRO, Senior Sous-Chef
    edited May 25

    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.Posts: 12,725Member

    @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 Posts: 2Member

    @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.