GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to make a slippery floor effect?

A_ConstantinA_Constantin EnglandPosts: 79Member

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

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

    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.

  • A_ConstantinA_Constantin EnglandPosts: 79Member

    @Socks I have 0.3 on both floor and character but it does not work still.

  • A_ConstantinA_Constantin EnglandPosts: 79Member

    @Socks I am using the change attribute for linear velocity, should I be using Move instead?

  • SEMASEMA Posts: 161Member

    when the character collide with floor change the friction of both to a negative number like -5.

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

    @A_Constantin said:
    Socks I have 0.3 on both floor and character but it does not work still.

    What does 'not work' mean in this context ?

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

    @A_Constantin said:
    Socks I am using the change attribute for linear velocity, should I be using Move instead?

    Change attribute / linear velocity should work fine.

  • A_ConstantinA_Constantin EnglandPosts: 79Member

    There is still no slippery effect, and I also tried what Wrek Games suggested

  • SLOCM3ZSLOCM3Z Posts: 797Member

    You could interpolate the actor's velocity to 0

  • Nate_SNate_S Nate - Pixel Artist - Developer - Graphics Designer Posts: 86Member

    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 **

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

    @A_Constantin said:
    There is still no slippery effect, and I also tried what Wrek Games suggested

    Have you tried reducing the friction to 0 on both actors ?

  • SocksSocks London, UK.Posts: 12,822Member
    edited May 2015

    @jdlcrater said:
    You could interpolate the actor's velocity to 0

    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).

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

    @A_Constantin said:
    There is still no slippery effect, and I also tried what Wrek Games suggested

    Friction values can't go below 0.

  • SLOCM3ZSLOCM3Z Posts: 797Member

    @A_Constantin do you want the actor to always slide or slow down to a stop?

  • A_ConstantinA_Constantin EnglandPosts: 79Member

    @jdlcrater I would like him to slide and slowly stop.

  • FrantoFranto Posts: 779Member
    edited May 2015

    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.

  • tiger27tiger27 Posts: 127Member

    @A_Constantin You can set the friction of both actors to a negative number. Tell me if it helps.

  • A_ConstantinA_Constantin EnglandPosts: 79Member

    @Franto where would I include this logic so I do not interfere with my regular left and right movement?

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

    @tiger27 said:
    A_Constantin You can set the friction of both actors to a negative number. Tell me if it helps.

    Friction values cannot be negative.

  • SLOCM3ZSLOCM3Z Posts: 797Member

    @Socks said:
    Friction values cannot be negative.

    Lol. He has said this twice :D

  • SLOCM3ZSLOCM3Z Posts: 797Member

    @A_Constantin said:
    jdlcrater I would like him to slide and slowly stop.

    Then I would use an interpolate rule like @Franto said:

    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.

  • zweg25zweg25 Posts: 738Member

    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?

  • zweg25zweg25 Posts: 738Member

    But I suggest doing more work with friction and the move behavior as that is more natural and better practice

  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO

    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.

Sign In or Register to comment.