How can I give my character a Min Speed?

JamesNobleJamesNoble Member Posts: 19
edited November -1 in Working with GS (Mac)
When one of my actors collides with another actor that is moveable it changes speed, which I don't want. I was able to give it a Max Speed in the Actor Editor under Attributes > Motion > Max Speed > Apply Max Speed (checked), which is good, but now all I need to do is give it a minimum speed. Is there any way I can do that?
I've been struggling with this for a while, and this is the second time I've made a post on the GS forums, but I can't figure out what to do... help!

Thanks!

Comments

  • cbtcbt Member Posts: 644
    JamesNoble said:
    When one of my actors collides with another actor that is moveable it changes speed, which I don't want. I was able to give it a Max Speed in the Actor Editor under Attributes > Motion > Max Speed > Apply Max Speed (checked), which is good, but now all I need to do is give it a minimum speed. Is there any way I can do that?
    I've been struggling with this for a while, and this is the second time I've made a post on the GS forums, but I can't figure out what to do... help!

    Thanks!

    I think that will do...

    if self.att motion X<200
    change att. self.motion to 300

    if self.att motion Y<200
    change att. self.motion to 300
  • RHRH Member Posts: 1,079
    I know how you would go about this for one, constant direction. I.e. travelling at 0˚ to the scene.

    For this you could:

    constaint attribute `self.motion.X` to `max(300,self.motion.X)`

    Obviously it can be done with the Y motion as well. Remember that self.motion.X/Y are vectors so if you want it to be travelling "down" the screen you need to change it to -300.
  • ORBZORBZ Member Posts: 1,304
    Make sure restitution is 1 on both actors and friction is 0
Sign In or Register to comment.