- Home /
Kinematic how to know rigidbody velocity vector?
Hello there, I have moving object and its son is a kinematic rigidbody, is there a way to know the velocity vector ? I tried to access with rigidbody.velocity but it says "there is no rigidbody attached" bug??
Thanks alot!!
Comment
Best Answer
Answer by Fubiou · Aug 17, 2011 at 12:09 AM
function Start(){
oldpos = transform.position;
}
function Update(){
newpos = transform.position;
var media = (newpos - oldpos);
velocity = media /Time.deltaTime;
oldpos = newpos;
newpos = transform.position;
}
Your answer
Follow this Question
Related Questions
Gravitational pull without losing speed 1 Answer
Calculating speed of rigidbody? 1 Answer
Rigidbody magnitude 3 Answers
Speed based on distance 1 Answer