Search Unity

I Can walk through Terrain hills..

Discussion in 'Getting Started' started by Keksmanu, Mar 7, 2015.

  1. Keksmanu

    Keksmanu

    Joined:
    Jul 11, 2014
    Posts:
    11
    Since Unity 5 my FPS Character simply walks through Raised Terrain.
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You should look into why that's happening. Usually it will be a collision mask. This is in the wrong section too, so I've moved it.
     
  3. Keksmanu

    Keksmanu

    Joined:
    Jul 11, 2014
    Posts:
    11
    I dont know what to change in the collision mask, specially because everything worked fine in unity 4
     
  4. JustinLudlow

    JustinLudlow

    Joined:
    Jan 6, 2015
    Posts:
    2
    I'm having this issue as well. I created a new project in Unity 5 Personal x64, added a third person character controller and a plane as a test. Walked around just fine. Added a terrain and added a texture and walked around fine. Then I added some height to it, then smoothed it and I can walk through the terrain.
     
  5. MagicZelda

    MagicZelda

    Joined:
    May 1, 2013
    Posts:
    90
    there is an issue with terrain modification at the moment. Try saving scene after you have changed heightmap and then reopen it and this might fix it, works for me anyway.
     
    eric56379 likes this.
  6. Deleted User

    Deleted User

    Guest

    Sounds like a bug to me.
     
  7. BornGodsGame

    BornGodsGame

    Joined:
    Jun 28, 2014
    Posts:
    587
    I am having the same issue, very easy to reproduce. Use sample assets 3d or first person controll, make new terrain, raise portion of the terrain to where it should be walkable. Your character walks fine on the flat area, but when you get to the raised portion, you simply keep walking flat and the camera cuts through the terrain. it is not a display issue, it is that the raised terrain is not getting saved as a mesh collider.. the mesh collider of the terrain is still flat ( you do not fall)
     
  8. MagicZelda

    MagicZelda

    Joined:
    May 1, 2013
    Posts:
    90
    yes and same if you lower, save scene and reload is work around, that I have found. I have reported as bug, but always worth reporting as well
     
    Last edited: Mar 10, 2015
  9. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    Hi! We are aware of this issue and it will be fixed shortly in a patch release.
     
    MagicZelda likes this.
  10. MagicZelda

    MagicZelda

    Joined:
    May 1, 2013
    Posts:
    90
    awesome ty :)
     
  11. crushhh

    crushhh

    Joined:
    Mar 22, 2015
    Posts:
    12
    Has this been fixed yet? What is "shortly"?
     
  12. MagicZelda

    MagicZelda

    Joined:
    May 1, 2013
    Posts:
    90
    next Patch release probably
     
  13. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    Hi. The fix will be out with 5.0 p3.
     
    crushhh and MagicZelda like this.
  14. MF5

    MF5

    Joined:
    Apr 12, 2015
    Posts:
    15
    Deleted.
     
  15. _7

    _7

    Joined:
    Nov 19, 2015
    Posts:
    1
    I stumbled upon the same problem recently. And I was stuck there. But then I appliedcharacter Controller to the player and it no longer walks through the hills. Wasn't expecting it though.
     
  16. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    This is an older post, and is related to a specific version number.

    What version are you using? Can you reproduce this issue consistently? If so, can you please file a bug report?
     
  17. MahaGaming

    MahaGaming

    Joined:
    Feb 25, 2014
    Posts:
    82
    im having this issue today i'm using unity free latest version



    using UnityEngine;
    using System.Collections;

    public class Controller : MonoBehaviour
    {
    private Animator __animator;
    private float __speed;
    private float __Direction;
    private float __Sprinting;
    private float __jump;
    private bool __crouch;
    private bool __att;

    public void Start () {
    __animator = GetComponent<Animator> ();
    }
    public void Update () {
    __speed = Input.GetAxis("Vertical");
    __Direction = Input.GetAxis("Horizontal");
    Sprinting ();
    Jumping ();
    Crouching ();
    Fire ();
    }
    public void FixedUpdate (){
    __animator.SetFloat ("Speed", __speed);
    __animator.SetFloat ("Direction", __Direction);
    __animator.SetFloat ("Sprinting", __Sprinting);
    __animator.SetFloat ("Jump", __jump);
    __animator.SetBool ("Crouch", __crouch);
    __animator.SetBool ("Attack", __att);
    }
    public void Sprinting (){
    if (Input.GetKey(KeyCode.LeftShift)) {
    __Sprinting = 1.0f;
    }
    else {
    __Sprinting = 0.0f;
    }
    }

    public void Jumping(){
    if (Input.GetKey(KeyCode.Space)){
    __jump = 1.0f;
    }
    else {
    __jump = 0.0f;
    }
    }
    public void Crouching (){
    if (Input.GetKey (KeyCode.C)) {
    __crouch = true;
    } else {
    __crouch = false;
    }
    }
    public void Fire (){
    if (Input.GetKey (KeyCode.Q)){
    __att = true;
    }
    else{
    __att = false;
    }
    }
    }
     
    Last edited: Jan 7, 2016
  18. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Are you using "Root Motion" to drive your character? What type of collider are you using? I suspect this is a different issue.
     
  19. MahaGaming

    MahaGaming

    Joined:
    Feb 25, 2014
    Posts:
    82
    Hi sorry for late reply, im using root motion yes and capsule collider
     
  20. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    How are you taking into account height changes in your character controller, if it's being driven by root motion? Won't root motion simply drive the character forward, based on the root motion, and ignore any height changes, as they are not in the root motion?
     
  21. raheelzahid

    raheelzahid

    Joined:
    Jan 24, 2017
    Posts:
    1
    hi
    I had same problem
    mine was solved by adding character controller other than collider mesh for both terrain and chracter