I am having an issue getting my projectiles to move in laser defender. As far as I can tell all my code is the same, and all functionality up to lecture 121 seems to be working properly. I’m not sure where my issue might be, and I’d rather not start over if I can help it. Does anyone have any idea on what I might be missing?
Hi,
Welcome to our community!
Generally, game objects do not move themselves unless there is a rigidbody component attached to them. And in that case, they mainly fall down due to the gravity.
So if something that you expect to move is not moving and you have code, check the values with a Debug.Log during runtime. For example, if you give your lasers an initial velocity, the velocity
must not be (0f, 0f, 0f). Do use Debug.Logs and do not rely on what you see or think because a lot is going on during runtime that could change things during runtime. And if the velocity
is (0f, 0f, 0f), you simply assign a value higher than 0f to the y-component.
Did this help? If not, please share a bit more information on what you did and have in Unity. Screenshots of the situation in the Unity Editor might help.
See also:
- Forum User Guides : How to mark a topic as solved
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.