Hey, im working on a gun and im trying make a shell come out the gun when i fire. The shells Velocity property is then set so it looks like its being ejected from the gun but the shell moves relative to the world so it doesnt look right unless my character is facing north, so for example, if i face south the shell looks like its being thrown out of the other side of the gun. I cant figure out how to set the shell velocity co ords relative to the gun and need help. Here is the code before i started messing with it.
replicatedStorage.glockEvents.FireEvent.OnServerEvent:Connect(slidePosition)
local serverShell = replicatedStorage.glockAnimations.Shell
local clonedShell = serverShell:Clone()
clonedShell.Parent = workspace
clonedShell.CFrame = slidePosition
clonedShell.Velocity = Vector3.new(10,8,0)
slidePosition is sent from this local script
local tool = script.Parent
local slide = tool.Model["Slide"]
local slidePosition = slide.CFrame
fireEvent:FireServer(slidePosition)

1 comment
I think this is done using lookVector. I have no clue how to use it so maybe you can search it up!