I am wondering how i can always make something go exactly forward from the players head, I need it to just go straight forward (not using raycasting or anything). What is the best way to do this?? I am not asking how to tween something or set its CFrame, i need to know how to determine what to set the position of something to for it to be directly forward from the players head regardless of which way they are facing, etc.
Can you elaborate on what you mean? If you’re trying to set the position directly forwards from the players head, then you should consider using the LookVector property. In terms of actually setting the position, there needs to be some sort of offset in the LookVector direction. You wording though is slightly confusing, so I’m not entirely sure what you mean.
I want a fireball to move directly forward from a players head 25 studs, thats what i mean
First of all raycasting should be the way you go. I held off on raycasting for such a long time and regret not have learning it sooner. Anyways what if you try to multiply the look vector of the head and set that to the fireball
As stated above, directional unit vectors are the way to go and they already exist in every BasePart’s CFrame matrix.
Additionally, I would avoid tweening an interactable object like what I imagine a fireball would be- because you may see funny results if it attempts to land inside of another part. I would advise using BodyMovers over tween, you can achieve the same result with more environmental adaptability.
You arent taking into consideration the fact that a ray needs to hit a target within the lifetime of the fireball for it to work, which is why I can’t use raycasting.
Figured it out, thanks for sending me in the right direction
Well yeah you could do as above or you could try something like:
local pos = head.Position + rootPart.CFrame.LookVector * offset
fireball.CFrame = fireball.CFrame * CFrame.lookAt(pos - rootPart.CFrame.LookVector * offset, pos)
Now you can tween it using the pos variable.