Heu guys! I don’t know how to do this and I’m pretty sure it should be simple but I’ve been trying for some time can’t figure it out. I’m trying to make a sword projectile that spawns in front of the player’s HRP and move it 2 studs in front of them but I’ve tried some stuff and they won’t work.
There are two types of CFrame spaces, World space and Local space. If you want to place it relative to the humanoidrootpart’s direction (local space), you’ll need the * operator, for world space it’s the + operator. Try this:
Correct me if I’m wrong, but instead of being between world space vs local space, I believe the * operator is for CFrame operations and the + is for vectors.
Also, after testing, it appears that you can only perform this on the client because the server doesn’t have CFrame orientation data for the player? I don’t know why.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
player.CharacterAdded:Connect(function(character: Model)
while character do
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
humanoidRootPart.CFrame += humanoidRootPart.CFrame.LookVector * 2
task.wait(0.05)
end
end)
works but only on the client for some reason.
This post may be helpful but I don’t have enough time to read it
Slash_Projectile_Clone.CFrame = Owner_HRP.CFrame * CFrame.new(0, 0, -2) -- may have change this value a little
Normally I’d gave an explanation but I’m too tired right now, so Ill just say, you can can’t add a Vector and a CFrame, you can get the Vector of a CFrame by doing CFrame.Position. ok bbyeyeto
Could you share your full script? Cause this should successfully position and orient the part relative to your character model, you may have some other lines of code possibly interfering with it, otherwise i got no idea
Is it the spawning thats the issue? Cause it looks like it correctly spawns in front of the player, but its just simply travelling in the wrong direction it appears