change direction only not velocity?

guillefaceguilleface Member Posts: 1,014
edited November -1 in Working with GS (Mac)
i need my actor when hitting this corner to change the direction to certain degree but to keep same velocity is going, i cant use when hitting actor change velocity to ??? ,direction 90 degrees, i need the actor to have same velocity is going

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Velocity is, by definition, the "speed" something is going in a certain direction. I think the only way you change "velocity" without changing direction is to change and objects speed.

    Do you mean that you want to change the rotation of the actor (while keeping it's current speed and direction (velocity)? (That would require a rotate behavior).

    Or do you mean you want to bounce the actor (change the direction of movement but retain the same speed)? (That would require a change attribute behavior. Or a change velocity behavior.)

    Or perhaps I don't quite understand what you want yet. Can you give a little more information?

    RThurman
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I have a magnitude demo on my wall that might help you out: http://gamesalad.com/game/1804

    The balls collide off of each other and the walls and maintain a constant speed. It is not easy and requires a bit of math, but you are free to dig through the code.

    Hope this helps!
    Joe
  • guillefaceguilleface Member Posts: 1,014
    ok have you played a mini putt golf where in the corner there is a triangle shape. so i need when the ball is going straight and hit that triangle for example, if is moving from left to right then when hitting the triangle in the corner to change direction up exact 90 degrees, i can put a invisible actor there and saying when ball colliding change direction to 90 degrees but if the ball is coming from top to button how is going to move to 180 degrees? when the rule is saying 90 and yeah i need to keep the speed the ball is going
  • guillefaceguilleface Member Posts: 1,014
    if you have time play hole one and see the corner how it goes straight to a angle
    http://www.miniputtgames.com/1-4playerminigolf.php

    sorry i don know how do the link thing
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    OK -- I see what you mean now.

    The collide behavior is exactly made for this kind of thing. You will need to fiddle with both actor's density, restitution, and other physics a little bit, but basically an actor will change direction in a realistic manner if you use the collide behavior.

    RThurman
Sign In or Register to comment.