Hey there so basically im making a beatdown for a game and for the barrage I added a weld with the hit box but instead of the dummy looking at me it looks away so im tryna figure out how to use this look vector on humrp with a weld but i cant. Can anyone help me?
local Weld2 = Instance.new("Weld")
Weld2.Part0 = HumRP
Weld2.Part1 = enemyrp
Weld2.C1 = CFrame.new(0,0,7) * HumRP.CFrame.LookVector * 1
Weld2.Parent = HumRP
3 Likes
Downrest
(Down)
October 13, 2022, 7:25am
#2
Have you tried using a WeldConstraint?
Try doing
Weld2.C1 = CFrame.new(0,0,7) * HumRP.CFrame.LookVector * -1
Basically, LookVectors describe the direction of the Front faces, you can use these to move a part forward in your forward direction. For example,
enemyrp.CFrame.Position + enemyrp.CFrame.LookVector * 5
If you’re trying to change the enemy’s orientation based on the player, I would use CFrame.Angles, but I’m not sure what other ways you could do this.
Weld2.C1 = CFrame.new(enemyrp.Position - Vector3.new(6.412, 3,-7)) * CFrame.Angles(0, math.rad(enemyrp.Orientation.Y + 180),0)
This is how I did it, you can mess around with it or change it up to experiment. I recommend reading these topics below as this could get pretty confusing.
I’m trying to position a knife on the player’s torso. In the command line I’ve written this and for some reason the x and z axis are rotating on the same axis.
local knife = workspace.Knife
local torso = workspace.Dummy.UpperTorso
knife.CFrame = torso.CFrame * CFrame.Angles(math.rad(0), math.rad(90), math.rad(0))
[image]
This is what the knife looks like when rotated 45 degrees on the X axis or Z axis.
Two cframes equal same thing:
knife.CFrame = torso.CFrame * CFrame.Angles(math.rad(0)…
Hello people!
I’ve been trying for 10 minutes to use the “lookVector” property of a CFrame, but it won’t work.
Tried everything. Basically, I want my part to go 5 studs forward. That’s it.
How to use lookVector?
Thanks in advance,
-Meaxis
1 Like