Unity Community


Results 1 to 9 of 9

  1. Location
    UK
    Posts
    64

    Slide across walls

    There's lots of posts on this and i've tried physics materials, but I can't get a real resolution to this basic requirement.

    What do I need to do to get my first person to slide across walls, not be slowed down by them?

    I'm using the standard first person controller, if this is the problem and there's a setup that works, would someone kindly help me to not reinvent the wheel.

    Thanks for the help!


  2. Posts
    736
    Slide scross walls and not be slowed down? I don't understand what this means; would you give us an example?


  3. Location
    UK
    Posts
    64
    When you walk into a wall at an angle with the first person controller, the wall slows you down rather than freely sliding across it. You get the feeling of getting stuck when you go near a wall. Make sense?


  4. Posts
    736
    Quote Originally Posted by GizmoBradwell View Post
    When you walk into a wall at an angle with the first person controller, the wall slows you down rather than freely sliding across it. You get the feeling of getting stuck when you go near a wall. Make sense?
    Hmmm... I think I see what you're saying, but that would be pretty unrealistic. What do you expect to happen if the player is running almost perpendicular to the wall, such that there's only 1 degree of bias towards the right? Do you expect him to slide to the right as if he were running parallel to the wall?


  5. Posts
    736
    Or do you mean that he's stuck at one point and won't budge at all, and you want him to slide very slowly to the right?


  6. Location
    Norway
    Posts
    364
    Seen from a non-game perspective, part of the force moving the player forward when you walk into a wall at an angle goes into "friction" so to speak. In Unity I think that the forward velocity somehow gets translated based on the angle of the wall when the two colliders collide. This is purely a guess though, but I guess this happens internally somehow in the physics simulator. So basically you have to get around that. Normally with no physics I suppose when the collider hits a wall it would come to a dead stop, no matter if the wall is at an angle. So basically what you could do is to rotate the players move direction dynamically based on collision angle. That might cause a whole heaps of other problems though.


  7. Posts
    736
    Assuming I'm correct in my assumptions I previously posted, then I would guess that the solution would involve detecting the collision, getting the collider's transform, and deducing the angle of the player in relation to the wall's collider, and applying the right amount of movement correction according to the slope.


  8. Location
    UK
    Posts
    64
    I've found the solution in the wiki.

    http://unifycommunity.com/wiki/index...dbodyFPSWalker

    Puttting frictionless physics materials on both the rigidbody and the wall does the trick.

    I knew there must be an already made solution somewhere! Hurrah!


  9. Posts
    736
    That's good to know!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •