Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Character getting stuck on curbs..

$
0
0
Hey guys, My character works very well except when he hits something tiny, he just gets stuck. How can it automatically move up small things like this? Ive tried a box, capsule and mesh collider and nothing seems to be able to do it. What I'm talking about.. Notice its just his legs. lol.. ![alt text][1] You guys are lifesavers!! Thanks! The movement script.. using UnityEngine; using System.Collections; public class Addbuttons : MonoBehaviour { void OnGUI() { //Forwards if (GUI.RepeatButton(new Rect(65, Screen.height-125, 70, 30), "Forward") == true) { GameObject Player = GameObject.Find("objPlayer"); Player.transform.Translate(transform.forward/20 , Space.World); } //Backwards if (GUI.RepeatButton(new Rect(65, Screen.height-50, 70, 30), "Backward") == true) { GameObject Player = GameObject.Find("objPlayer"); //Player.transform.Translate(transform.forward/20 , Space.World); } //Left if (GUI.RepeatButton(new Rect(10, Screen.height-90, 70, 30), "Left") == true) { GameObject Player = GameObject.Find("objPlayer"); Player.transform.Rotate(0,-2,0); } //Right if (GUI.RepeatButton(new Rect(120, Screen.height-90, 70, 30), "Right") == true) { GameObject Player = GameObject.Find("objPlayer"); Player.transform.Rotate(0,2,0); } } // Update is called once per frame void Update () { } } [1]: /storage/temp/14820-untitled.jpg

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>