Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Player stucks on ladder (with picture)

$
0
0
I have ladder script and it is work properly but when climbing down i have some bugs like the picture my player couldn't away from ladder i know i need add something stop the player when reach bottom to script but i dont know what it is. how can i fix this![alt text][1] [1]: /storage/temp/61644-ladderfail.png Green is the ground and red is the player This is the script; #pragma strict var ChController : Transform; var heightFactor : float = 3.2; private var inside = false; private var FPSInput : FPSWalkerEnhanced; function Start () { FPSInput = GameObject.Find("Player").GetComponent(FPSWalkerEnhanced); } function OnTriggerEnter (Col : Collider) { if (Col.tag == "Player"); { FPSInput.enabled = false; inside = true; } } function OnTriggerExit (Col : Collider) { if (Col.tag == "Player"); { FPSInput.enabled = true; inside = false; } } function Update() { if (inside == true && Input.GetKey("w")) { ChController.transform.position += Vector3.up / heightFactor; } if (inside == true && Input.GetKey("s")) { ChController.transform.position += Vector3.down / heightFactor; } }

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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