What solutions have you tried so far?
There was something on this, I checked and used some of what was there but I still cannot get it to eject in its proper direction (towards the right)
Shell Ejection Script
spawn(function()
local ShellFolder = ReplicatedStorage:WaitForChild("Shells")
for _, GetShell in pairs(ShellFolder:GetChildren()) do
if GetShell:IsA("BasePart") and GetShell.Name == self.viewmodel.Offsets.ShellType.Value then
local ShellClone = GetShell:Clone()
ShellClone.Parent = workspace.Camera
ShellClone.CFrame = self.viewmodel.Receiver.ShellEjection.CFrame
local AngularCFrame = CFrame.Angles(math.rad(math.random(-10, 10)), math.rad(math.random(-10, 10)), math.rad(math.random(-10, 10)))
ShellClone.CFrame = ShellClone.CFrame * AngularCFrame
ShellClone.Velocity = (self.viewmodel.Receiver.ShellEjection.CFrame.RightVector) * 8 + Vector3.new(10,math.random(8, 23),math.random(-5,5))
game:GetService("Debris"):AddItem(ShellClone, 5)
end
end
end)
The reason why its doing this is because the position is in World space. If you change it to object space, It should work. If you dont know what Im taking about, see this, Object and World Space
Sometimes frontvector/rightvector/upvector arent actually facing the front or right etc
maybe thats the problem and to fix it maybe you can simply reverse the rightvector with *-1 so it is facing the left.