Hi all,
I saw something on the forums from a while ago that mentioned this issue, but there was never a decisive answer for fixing it.
I'm working on a platformer ATM. Since I'm simply using the physics engine for forces and collision detection for most of the entities in my game I don't want any bounce to occur, so I set the restitution for both objects (in this case the player and a wall) to 0, yet when the player hits it at any kind of speed there's still some bounce, making my wallsliding animation look kind of strange, and making walljump a bit weird too.
I can send you the code if you want it, but it's a fairly large project considering the small question I have, and most of it is irrelevant to the simple question: is there a way to ensure absolutely no bounce occurs?
Thanks
Restitution 0 still bounces
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Restitution 0 still bounces
It was the best of times, it was the worst of times . . .
Re: Restitution 0 still bounces
is it possible to set a negative value or will that just screw everything up?
- The Burrito
- Party member
- Posts: 153
- Joined: Mon Sep 21, 2009 12:14 am
- Contact:
Re: Restitution 0 still bounces
I assume you're using 0.7.1, in 0.8.0 restitution and friction seem to behave much more naturally. I don't think negative values will work. 0.8.0 is still a bit buggy but it might be worth upgrading or waiting if it's a key part of your game.
One kind of sloppy solution in the mean time would be to perform some check and 0 or reduce the player's horizontal velocity when they hit a wall, I assume you already have some way of knowing when this happens since you have a wall slide animation, so you can probably just throw it in with whatever triggers that.
One kind of sloppy solution in the mean time would be to perform some check and 0 or reduce the player's horizontal velocity when they hit a wall, I assume you already have some way of knowing when this happens since you have a wall slide animation, so you can probably just throw it in with whatever triggers that.
Re: Restitution 0 still bounces
Not sloppy at all; The player hits a wall, therefore they should stopThe Burrito wrote:I assume you're using 0.7.1, in 0.8.0 restitution and friction seem to behave much more naturally. I don't think negative values will work. 0.8.0 is still a bit buggy but it might be worth upgrading or waiting if it's a key part of your game.
One kind of sloppy solution in the mean time would be to perform some check and 0 or reduce the player's horizontal velocity when they hit a wall, I assume you already have some way of knowing when this happens since you have a wall slide animation, so you can probably just throw it in with whatever triggers that.
- The Burrito
- Party member
- Posts: 153
- Joined: Mon Sep 21, 2009 12:14 am
- Contact:
Re: Restitution 0 still bounces
I just mean every time you manually set velocities you introduce an opportunity for the physics to break, so you want to do it as little as possible.Ruirize wrote:Not sloppy at all; The player hits a wall, therefore they should stop
Re: Restitution 0 still bounces
Thanks for your reply. I could use your suggestion of triggering a cancel-x-velocity function, but as you already said; it's a bit of a hackjob solution.
Where could I download 0.8?
Where could I download 0.8?
It was the best of times, it was the worst of times . . .
- The Burrito
- Party member
- Posts: 153
- Joined: Mon Sep 21, 2009 12:14 am
- Contact:
Re: Restitution 0 still bounces
Since it's still in development you'll probably have to compile it yourself.Refpeuk wrote:Where could I download 0.8?
I use the PPA ( https://launchpad.net/~bartbes/+archive/love-unstable ) when developing under Linux and MSVC 2010 to compile under windows (you'll have to grab the source from bitbucket and the msvc2010 sdk from https://love2d.org/sdk/)
If there are non physics related components you can work on, 0.8.0 will be released officially sometime soon. At which point somebody (possibly me) will probably right up some details on how to upgrade your game (physics has changed a lot).
Re: Restitution 0 still bounces
I develop on Windows, but bitbucket only has 0.7.2 . . . are there any other repositories?
And when you say 0.8 will be officially released soon what sort of time frame are we looking at? (a week or two, or several months . . .)
And when you say 0.8 will be officially released soon what sort of time frame are we looking at? (a week or two, or several months . . .)
It was the best of times, it was the worst of times . . .
- slime
- Solid Snayke
- Posts: 3132
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Restitution 0 still bounces
Definitely less than several months, there are only a few more bugs left to fix.
You can find the Windows nightly builds of 0.8.0 at the bottom of the page here. Be sure to download 'default' rather than 'minor'.
You can find the Windows nightly builds of 0.8.0 at the bottom of the page here. Be sure to download 'default' rather than 'minor'.
Re: Restitution 0 still bounces
Awesome, thanks! Is there anywhere I can learn about how to upgrade my game in the meantime? I'd like to do that before I work on it too much more or it'll just become a bigger job.
It was the best of times, it was the worst of times . . .
Who is online
Users browsing this forum: Google [Bot] and 199 guests