How to make a slippery floor effect?
A_Constantin
EnglandMember Posts: 79
I was wondering how could I create a slippery floor effect. I tried looking on the forum and found that you must turn down the friction. I turned it down to 0.3, but it is basically the same.
Any suggestions?
Comments
You need to turn down the friction for all actors involved in the interaction (rather than just the 'floor').
So if you have a square block sliding across a slippy floor, you need to turn the friction down in the floor and in the square block.
@Socks I have 0.3 on both floor and character but it does not work still.
@Socks I am using the change attribute for linear velocity, should I be using Move instead?
when the character collide with floor change the friction of both to a negative number like -5.
What does 'not work' mean in this context ?
Change attribute / linear velocity should work fine.
There is still no slippery effect, and I also tried what Wrek Games suggested
You could interpolate the actor's velocity to 0
I don't know how applicable this would be to your project, but using the accelerate behavior instead of the move behavior makes a pretty convincing slippery effect.
**Nate - Pixel Artist - Developer - Graphics Designer **
Have you tried reducing the friction to 0 on both actors ?
That would make the speed of the actor 0, which would bring the actor to a stop, I interpret a 'slippery' effect as the actor having no friction and continuing to move even when in contract with another object, rather than the actor slowing to a stop (which I would read as the actor experiencing friction).
Friction values can't go below 0.
@A_Constantin do you want the actor to always slide or slow down to a stop?
@jdlcrater I would like him to slide and slowly stop.
What you could do is use an interpolate to give a slide effect, BUT, at the part that says "For X seconds", for X put a game.attribute or self.attribute.
For the attribute, when you make it, make a rule that changes the attribute, based on what yoru actor is colliding with.
If he collides with say "dirt" that has lots of friction, make a "change attribute" behavior that sets the X attribute that will be in the interpolate to "0".
If he hits say "Ice", set the change attribute to say "0.9" which means he will keep sliding for 0.9 seconds before he stops.
Also, put in the "else" part of the rule that it resets to 0, so that when you aren't in contact with any surface, the slide effects default is 0, so that if your in the air, you won't have the slide effect happening mid-air after jumping off the ice or anything else.
@A_Constantin You can set the friction of both actors to a negative number. Tell me if it helps.
@Franto where would I include this logic so I do not interfere with my regular left and right movement?
Friction values cannot be negative.
Lol. He has said this twice
Then I would use an interpolate rule like @Franto said:
As a shaky work around you could try changing the linear velocity to a small number, and then do an after 1s timer change it to 0?
But I suggest doing more work with friction and the move behavior as that is more natural and better practice
Check out the Penguin Paradise template for some slippery floor movement. Movement is done with the Accelerate behavior with limits set by Rule conditions instead of the Max Speed attribute, so falling won't get affected by Max Speed.
Friction is essentially a deceleration modifier.