How do you constrain actor speed? ( Velocity )

MiloliMiloli Member Posts: 24
edited November -1 in Working with GS (Mac)
Hi I have tried to look around the forums and tried a few things but nothing seems to quite sort out the problem I am having. I am sure its really simple but its driving me bunkers :-)

I'm creating a Breakout type game for learning purposes and I have some rotating actors that are acting as barriers, I have changed density to reall high on barriers and contrained there position so as they rotate but do not move after being hit by the ball etc.

However when the ball hits the rotating actor it starts to increase in speed and can get really fast after hitting several times....I have tried to set the MAX SPEED on the actor but this does not seem to do anything.

I know its probably REALLY simple but I would appreiate someone's expertise on this :-)

Cheers GS Gang
Pete

Comments

  • RedlerTechRedlerTech Member Posts: 1,583
    Hey Pete,
    You should just be able to Constrain attribute: Self.linearvelocity.X/Y to whatever

    Or say... Rule: If self linear velocity X or Y doesn't = A, change linear velocityX/Y to A

    Regards,
    Matt
  • MiloliMiloli Member Posts: 24
    Hi NextGen

    I did exactly the first option you suggested and it seemed to make no difference... I will try the second option and let you know.

    Out of interest I made it slightly better by changing the density of the ball to ZERO (0)

    If anyone else has a diffeent otion for a fix please let me know.

    Appreciate your help NextGen :-)

    Cheers
    Pete
  • MiloliMiloli Member Posts: 24
    OK I tried the Constrain Self linear velocity again and it just makes the ball go crazy and fly upto the top right hand corner and stay stuck there bouncing around.

    I start the ball of with a chance velocity to say 330 and want the ball to stay at that velocity no matter what it bounces with :-)

    Any further help would be Fantastic

    Cheers
    Pete
  • MiloliMiloli Member Posts: 24
    OK so I worked out the MAX SPEED. I had to tick the max speed in the attributes and enter the max speed ... ooopss, ok so far so great

    BUT I want the exact opposite as in the minimum speed to be the same velocity. Now my ball will bounce around no faster than the MAX speed but it still slows down sometimes when hitting my rotating actor???

    Really apprecitae any insights you GS experts may have on this one. A MIN SPEED would be very useful in a update of GS!!!

    Cheers Gang :-)
    Pete
  • UtopianGamesUtopianGames Member Posts: 5,692
    For our Ball Puzzle Template we used change motion.linear.velocity.x to -motion.linear.velocity.x for the ball code when hitting left and right sides, you notice it never goes faster than 100 but also it never slows down.

    http://www.deepblueapps.com/Deep_Blue_Ideas_Ltd./GSTemplatePZL.html

    Darren.

    image
  • qewrqewr Member Posts: 54
    Yo utopian, nice job on bumps, some nice vectors (only been using illustrator for about a week but getting better :p) You know those wheel and axle style squares that could rotate freely but didn't move? Don't call me an idiot but how's you do that? Prob pretty obvious lol but can't figure it out for some reason.. thx
  • MiloliMiloli Member Posts: 24
    Thanks Darren!!!

    Rather than use the collide I tested the motion linear as you suggested above and it worked a treat. :-) thanks a million

    Think I starting to get to grips with Gamesalad. Hopefully in the future I can add value to the forum and answer peoples problems etc.

    Thanks to everyone

    Cheers
    Pete
Sign In or Register to comment.