Question by
Joebear · Dec 21, 2015 at 05:29 AM ·
c#javascriptmovementrigidbodyrigidbody-collision
Stopping Moving Objects?
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.
Comment
Your answer
Follow this Question
Related Questions
A script that doesn't allow moving objects to go through non-moving objects? 1 Answer
Smooth Rotation on WASD keys pressed? 1 Answer
Why is my character sliding? (Rigid Body) 1 Answer
Rigidbody player on top of a rigidbody vehicle 2 Answers
Error CS0201 when trying to change RigidbodyConstraints 1 Answer