Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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.