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

Stopping Moving Objects?

$
0
0
I need a non-moving wall to repel a moving object. Moving script: var target : Transform; var moveSpeed = 20; var rotationSpeed = 5; var myTransform : Transform; function Awake() { myTransform = transform; } function Start() { target = GameObject.FindWithTag("Player").transform; } function Update () { myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed*Time.deltaTime); myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime; } I've tried way too many things. I've been stuck on this problem for almost a month. Please respond if you can, I don't really care how. As long as the problem is fixed.

Viewing all articles
Browse latest Browse all 1875

Latest Images

Trending Articles



Latest Images

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