Push Actor on X-Axis

Hello,

I haven't worked with Gamesalad for a long time, so excuse me if this is a silly question.

I've some problems with the collide of two Actors.
My Player is should be only movable on X-Axis. I've tried this with some constrain Attribute.
Don't now if this is working because the collide isn't working.

And there are Actors which are moving to the top, and they should push the Actor to the left or right (collision shape is circle)
But I don't now why the collide isn't detected by game salad. The Actor can only moved this way.

Would be great if someone could help :)

Thanks,
Justin

Comments

  • JayJayDJayJayD Member Posts: 48
    edited March 2014

    Hello again,

    maybe I need to be more clearly :)

    I have an player on top of the screen. This player should only move on the x-axis.
    So I use constrain attribute "self.position.Y" to "self.position.Y". The movable checkbox is set to true.

    And I have an actor which is spawned on touch and moving to the top until he is out of the screen. So and when I spawn a line of them, they should "push" the player along this line and move out of the screen.

    So the Problem is that the colliding isn't working, they move just through the Player, although there is a collide behavior.

    Does anyone has any idea why this is happen?

    Thanks,
    Justin

  • CrazyApeCrazyApe Member Posts: 64

    Rule

    When touch is pressed

    Constrain attribute self.position x to game.mouse.position x

  • JayJayDJayJayD Member Posts: 48

    Thanks but It's only the Colliding which is not working.
    I can draw a line, which is moving up. But the line doesn't collide with my player.
    The line should push him, but moves only through him.

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934

    The constrain overrides the collisions. You could try making a couple of invisible unmovable actors that could act as rails to hold your y position in place. Then remove your collision rules and see how that works for you.

  • JayJayDJayJayD Member Posts: 48

    Thank you, the problem was the constrain.
    Everything is working well now :)

Sign In or Register to comment.