how to bounce the actor same height every time

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

  • LuiscriLuiscri Member Posts: 40
    edited November 2014

    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

  • SocksSocks London, UK.Member Posts: 12,822
    edited November 2014

    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

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    Yeah I was going to recommend you to make a self.interger & set it to the y position you want

  • http_gamesaladhttp_gamesalad Member Posts: 1,340
    edited November 2014

    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.

  • Simple AppsSimple Apps Member Posts: 158

    @ 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

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Here's another example...Not sure if you'll need it.

  • SocksSocks London, UK.Member Posts: 12,822
    edited November 2014

    @Simple Apps said:
    @ 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

    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.

  • SocksSocks London, UK.Member Posts: 12,822

    @Braydon_SFX said:
    Here's another example...Not sure if you'll need it.

    Good numbers ! Not sure how you worked that out, but the numbers work perfectly !

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    @Socks said:
    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.

  • Simple AppsSimple Apps Member Posts: 158
    edited November 2014

    @Braydon_SFX said:
    Here's another example...Not sure if you'll need it.

    Thank You very much its very simple!

  • SocksSocks London, UK.Member Posts: 12,822

    @Braydon_SFX said:
    ...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.

    No goats sacrificed ?

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    @Socks said:
    No goats sacrificed ?

    Only on Mondays.

Sign In or Register to comment.