- Home /
How do i adjust the projectile path and direction?
Hi!
So im sitting with a problem that the direction the projectile is traveling.
So i will attach a screenshot of the problem, and try to explain the problem
Ok so you can see above. that there is a red cube, that is indicating the point in which the raycast hit, and i have made so the raycast comes from the center of the screen, not the barrel of the weapon/gun.
Then i point out in the picture the bullet trail that travels out from the barrel of the gun, it is not traveling toward the center of the screen and where the raycast is heading.
Just so you know the bullet is just visual.
So my problem is that i want the bullet to adjust toward the path the raycast is going and then following the path, so how would i achieve that?
Answer by DawidNorasDev · Nov 05, 2018 at 11:49 AM
If you made raycast from camera, You already have the destination point, where the bullet is going to hit. In case raycast haven't hit something, you can define max dinstance and calculate hit point which would be "in air".
When you have the destination point, you can just spawn bullet visual and make it move to this destination point.
Your answer
Follow this Question
Related Questions
How to avoid speed change in bullets while moving? 1 Answer
Raycasr in my fps? 1 Answer
Help with getting a bullet to move. 2 Answers
Gun Fire, sparks on Collision 1 Answer
Issue with Bullet Movement shooting 0 Answers