I’ve been trying to make a fireball attack for one of my enemies and I wanted the fireball to face the target player and then go towards it. The issue is that it’s incredibly inaccurate and doesn’t go towards the player, as seen in the attached image. I figured the issue was most likely with the cframe.lookAt() as the way the fireball moves is using the fireball’s lookVector.
returns wrong value?
I think the mistake lies somewhere else.
The fireball appears to go in a 90 turn from which you want to send it.
This means you are using the wrong axis to propell the fireball.
Easily fixable but can be overlooked often times.
instead of something likes this
vector3.new(0, 0, 1)
its
vector3.new(1, 0, 0)
or smth like that
Edit:
Maybe also check your operators? (things like *= and stuff)
sometimes its just the math done wrongly.
I just did a test my slamming a decal onto the fireball. It indeed does face the correct direction (the player) but moves incorrectly (not in the front face direction of the fireball for some reason). Any ideas why?
then just do the original *=
it should be that one of the values you used (vector3’s) has the first or the last in the wrong spot since either the X or Z axis has changed.
Try adding or subtracting those with 90? (order X Y Z so first and last)