|
Hi I have an object that is supposed to instantiate a sphere object and then shoot it towards the player's current position, i have an object that is taking the rotation of the player so that it always looking at them, I have the object instantiating but I have no idea what to do when it comes to applying velocity to the rigidbody. Thanks
(comments are locked)
|
|
You'll need to AddForce to the Rigidbody.
Note that if you add this to Update(), it will accelerate (as the force is applied every frame). Also, you've said it's taking the rotation of the player - that won't necessarily mean the object is heading towards them, it's just matching the rotation, so it will move parallel. The object that spawns the Sphere object will need to Transform.LookAt the player position
(comments are locked)
|
|
use:
to look at your player, and:
to move forward
(comments are locked)
|
|
you can use
(comments are locked)
|
