Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[ Figured out ! ]CharacterController: stay on terrain, bounce on other

Discussion in 'Physics' started by TEBZ_22, Sep 11, 2015.

  1. TEBZ_22

    TEBZ_22

    Joined:
    Jan 28, 2014
    Posts:
    37
    I feel quite unsecure about the best (or at least a god way) to implement the physics.
    (I'm better at coding, at leas I think so :) )
    What I what is:
    * the player, a ball not rotating, to stay on the ground (terrain mesh, and maybe a loop).
    * the player bounces on most other objects. most objects are same size not moving, but not static, balls.
    * the player to, after initial acceleration, have a constant speed. Except for some sliding when turning.
    * player loosing points/health when bouncing. More for larger direction change.
    .
    My current implementation(modified standard FPC), player turning and speed works.
    No bouncing, and FPC climbing on the other balls.
    .
    This is in Unity5.
    Pleas HELP!
    /Thomas
     
  2. TEBZ_22

    TEBZ_22

    Joined:
    Jan 28, 2014
    Posts:
    37
    I'll managed to figure it out.
    The problem was that, for example, CharacterMotor.SetVelocity() don't work if I put in the OnControllerColliderHit()
    When I put it in LateUpdate(), it seems to work.