how to bounce the actor same height every time
Simple Apps
Member Posts: 158
Hi All
i made an actor with some acceleration.
i made to collide the floor
i kept the bounciness of the actor to 1 and floor to 0
what i want was the actor should bounce to same height(I mean the y position) every time.
but the actor y position was increasing which i dont want.
If any one knows please help me .
Thank u
Comments
What do you mean with "I made an actor with some acceleration"? In theory if you set the bounciness stats as you have them set your character should bounce to the same height. Maybe you have another parameter which cancels that. If you created the acceleration in order to simulate the gravity you can delete that acceleration and include the gravity going to scene > gravity > Y
Constrain Y position to:
AAA *sin( self.Time *BBB%180)+CCC
AAA = height of bounce
BBB = speed of bounce
CCC = floor level + half the actor's height
Yeah I was going to recommend you to make a self.interger & set it to the y position you want
Or! You can try making an invisible wall across your screen that only collides with the ball & have the same bounciness as your ball & add some rules in there like when it hits the invisible wall interpolate self.postion y to the floor & when it hits the floor interpolate self postion y back up to the wall & make it ease in & out & I think that'll give it the effect of it bouncing it.
@ Socks
i did not get clearly
i Constrain self Y position to:
230 *sin( self.Time *1%180)+17+20
but the actor was sticking to floor
My Games Link:
https://itunes.apple.com/au/app/real-ants/id932999551?mt=8
lhttps://itunes.apple.com/au/app/horse-challenge/id930967102?mt=8
Thank you all i got it...!
My Games Link:
https://itunes.apple.com/au/app/real-ants/id932999551?mt=8
lhttps://itunes.apple.com/au/app/horse-challenge/id930967102?mt=8
Here's another example...Not sure if you'll need it.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Yep, with those numbers it will look like it is stuck to the floor !! But it's really just moving very slowly.
Self.time is measured in seconds, and we are using self.time as the angle that sin is operating on, so there are 360 degrees in a full cycle, so it will take 360 seconds (6 minutes) for a full cycle !!! . . . . if you increase the self.time multiplier (I would use *100 or more) it will move a lot quicker.
Also you don't need to split the two numbers at the end, you can just use 37 instead of 17 + 20.
Good numbers ! Not sure how you worked that out, but the numbers work perfectly !
...Neither am I..I just plugged them in. I think it just depends where you want the tip of the jump to be. You can set the change velocity number to any value and it'll always jump to that certain height. I just plugged in a number that made it jump to the top half of the screen. :P
...Err...I mean. Of course! I spent hours and hours working on dozens of equations that made this intense action possible. You should see all of the scratch paper I went through.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Thank You very much its very simple!
My Games Link:
https://itunes.apple.com/au/app/real-ants/id932999551?mt=8
lhttps://itunes.apple.com/au/app/horse-challenge/id930967102?mt=8
No goats sacrificed ?
Only on Mondays.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx