I'm making a plane that drops a bomb onto the map, and I want the bomb to be facing the direction of the plane's "bombpart" which is the part attached to plane in which the bombs CFrame is set to. It is not positioning to this part anymore once I added LookVector. I know this is something that can be easily fixed, so please tell me how to use it properly.
local bomb = coroutine.wrap(function() for i = 1, bombnumber do local b = game.ServerStorage.bomb:Clone() b.Parent = game.Workspace b.CFrame=CFrame.new(script.Parent.bombpart.CFrame.LookVector) b.Velocity = Vector3.new(0,0,speed) wait(0.2) end end) --Line 5 doesn't function properly.
LookVector is just a unit vector, all values ranging from -1 to 1. If you were to try to set a value to the unit vector, it would be super close to (0,0,0). Instead, you should add the LookVector to the part's CFrame in order to get things working. If you want it a distance from said vector, multiply it by a scalar to expand. If you multiply the LookVector by 5, it will be 5 studs in front of the part. Multiplying by a negative would move it backwards.
script.Parent.bombpart.CFrame + script.Parent.bombpart.CFrame.LookVector
CFrame + Vector3 is still a CFrame, so you don't need the constructor. Cheers.