#how do i make something face where the player faces
1 messages · Page 1 of 1 (latest)
If you multiply the CFrame by a Vector, you get the position relative to the CFrame
So try something like hitbox.CFrame = root.CFrame * Vector3.new(0, 0, 3)
ill try that
Oh sorry you mean rotate the hitbox so it's facing the same way as the player
yeah
In that case, you need to make a new CFrame with the hitbox's position (which means the angles will be 0) then multiply it by the root's CFrame.Rotation, which is the CFrame with only the rotation
ok
wdym make a new cframe?
edit the cframe of the part?
actually i think i get it
multiply parts rotation by the roots rotation
Well
CFrame.new(hitbox.CFrame.Position) makes a new CFrame with no rotation.
root.CFrame.Rotation is the root's CFrame with no position, just rotation
So multiplying those makes a CFrame with the hitbox's position, but the root's rotation
ok
``lua
hitbox.Position = root.Position + root.CFrame.lookVector * 1.4
CFrame.new(hitbox.CFrame.Position)
print(hitbox.CFrame.Rotation)
hitbox.CFrame.Rotation *= root.CFrame.Rotation
Not quite
ok
I'd probably calculate the desired hitbox position, then use that to make a new CFrame, multiplying that by the player's CFrame.Rotation
What did you try
** You are now Level 23! **
nothing so far because i have no experience with making new cframes
yeah maybe not
Okay well you can also just set the Orientation of the hitbox to the orientation of the root instead of using CFrames
dw he just kinda overcomplicated it for me i just set the rotation of the part yesterday to the root
and it worked
didnt have to read all that cframe stuff]
i hate reading i learn through expirimentation
Experiment with reading.