How to place a part infront of character while keeping its orientation relative to the character?

I’m shooting a slash projectile infront of the character 10 studs ahead but it’s orientation seems faced forward on the world axis and not in the direction of the character

I would like to simply keep the orientation it already has (in Replicated Storage)

EDIT: Here’s a visual demonstration of how the slash is supposed to face.

  • *The red arrow is just an aid to show the direction of the slash
  • The first row is the intended orientation, where the slash faces forward relative to the character’s direction.
  • The second row is the result of many solutions given in this thread, where it’s relative to the world axis and not the character’s direction, the result of
local rotation = Slash.CFrame - Slash.Position
--
Slash.CFrame = CFrame.new(torso.Position + torso.CFrame.LookVector * 10) * rotation
--or 
Slash.Position = CFrame.new(torso.Position + torso.LookVector * 10).Position
--or
local offset = torso.CFrame.Position + torso.CFrame.LookVector * 10 	
Swallow.CFrame = rotation + offset
  • The third row which is relative to the torso, but the slash is flipped, the result of:
local rotation = Slash.CFrame - Slash.Position
Slash.CFrame = torso.CFrame * CFrame.new(0, 0, -10) * rotation
local offset = CFrame.new(0, 0, -10) --10 studs in front of the player
 Slash.CFrame = torso.CFrame * offset

CFrame:ToWorldSpace should do the trick

Specifically, Slash.CFrame:ToWorldSpace(torso.CFrame)

This does not keep the orientation of the projectile

Tsk tsk, shouldve tried my method.

Your method doesn’t put the projectile infront of my character

Your offset should be on the x axis, thats why.

hello stop tiring yourself and just use weld constraints or something

Why would I use weld constraints on a projectile that’s flying forward or toward any direction?

Offsetting on the x axis does not put the projectile infront of the character

I believe something like this should work

local offset = CFrame.new(0, 0, -10) --10 studs in front of the player
local Look = torso.CFrame.LookVector
local slashPosition = torso.CFrame.Position + Look * offset.p.z
local slashOrientation = torsoLook * offset
Slash.CFrame = CFrame.new(slashPosition, slashPosition + slashOrientation.LookVector)```

What does it do???

Thats what I’ve used in the past.

Didn’t work, the part spawns at the center of baseplate, isnt anywhere near the character

Get the rotation matrix by subtracting the position vector from the CFrame. Also, the new CFrame position should start with the position of the Torso - then you add the offset.

local rotation = Slash.CFrame - Slash.Position
Slash.CFrame = CFrame.new(torso.Position + torso.CFrame.LookVector * 10) * rotation
1 Like
Slash.Position = CFrame.new(torso.Position + torso.LookVector * OFFSET).Position

where OFFSET is the amount of studs infront of the character.

then just use cframe dawg and set the cframe to the hrt and then move it forward in ur code u keep setting rotation and stuff but that ain’t nesscary

The slash appears infront, but unfortunately it doesn’t continue facing forward when the character turns to the right or left or any other direction, it keeps it’s sort of world-based forward orientation

Isn’t that what you had asked for?

Ah, sorry, it’s a bit difficult to explain
The slash is supposed to face forward infront of the character if that makes sense, so that it looks normal and not backwards or sideways when the character moves in other directions

It’s not supposed to be based on the world’s axis where it currently only faces forward

My objective was to keep the orientation it has in Rep Storage when it get’s parented into workspace and placed infront of the character

Slash.CFrame = CFrame.new(torso.Position + torso.LookVector * OFFSET, torso.LookVector)