Quantcast
Channel: Answers by "Peter G"
Viewing all articles
Browse latest Browse all 90

Answer by Peter G

$
0
0
You have 2 errors. It looks like you are trying to call the constructor to create a new Vector3. The issues is that there are no constructors that take a Vector3 as an argument (you can copy it, but that's not the same). //you're basically doing velocity = new Vector3( someVec3 ); Which is simply not allowed, fortunately it's a very easy fix. myTransform.rigidbody.velocity = Vector3(lookDir.normalize() * currentSpeed * Time.deltaTime); myTransform.rigidbody.velocity = lookDir.normalized * currentSpeed * Time.deltaTime; //deleted the constructor call. //also changed normalize() to normalized. You can also use Vector3.Normalize(lookDir).

Viewing all articles
Browse latest Browse all 90

Latest Images

Trending Articles



Latest Images

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