How to make an object face the direction the player is facing

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to make a knife throw, its simple and works as it should except for one thing, It doesnt look at the direction its supposed to go!
  2. What is the issue? Include screenshots / videos if possible!
    When the knife is thrown it doesnt face the direction the player is facing!

How could i possibly do this? Help is appreciated!

2 Likes

Set the orientation of the primary part of the knife model to the player’s humanoid root part orientation.

2 Likes

You can do something like

local plr = -- wherever player is in your script
local char = plr.Character or plr.CharacterAdded:Wait()
local knife = -- knife or wherever It's located

knife.lookVector = char.Head.lookVector

If It’s not a part,mesh part or union and It’s a model you can do

local knifechilds = knife:GetChildren()
for i,v in pairs(knifechilds) do

v.lookVector = char.head.lookVector

end

You got the point…

I tried this out, It says “LookVector cannot be assigned to”, Thanks for the reply tho

I tried it out, and the knife looks up instead of looking forward

You might need to offset the orientation to make it so it changes with the humanoid root part.

For example, you might need to do something like (I made up the numbers by the way, you’re gonna need to experiment to try and figure out the correct numbers.)

local rootPart = HumanoidRootPart.Orientation
knife.PrimaryPart.Orientation = Vector3.new(rootPart.X+45, rootPart.Y-45, rootPart.Z+10)
2 Likes

Try setting the orientation of the knife to the HumanoidRootPart orientation.

1 Like

Thanks!! (Didnt know i could do that lol)