Serrattor
(Serrator)
April 27, 2022, 10:17pm
#1
hello so i got into the “new body movers” recently and they mad confusing so i need help yea
this code makes the rootpart’s cframe be the same as the target’s rootpart cframe but i want the rootpart to constantly face the target rootpart like look at it, this just gets confusing so any help is appreciated thx
local grabAttachmentCharacter = Instance.new("Attachment")
grabAttachmentCharacter.Name = "AssasinsGrabAttachmentOrigin"..plr.Name
grabAttachmentCharacter.Parent = rootpart
local grabAttachmentTarget = Instance.new("Attachment")
grabAttachmentTarget.Name = "AssasinsGrabAttachmentTarget"..plr.Name
grabAttachmentTarget.Parent = target.HumanoidRootPart
local alignOrientation = Instance.new("AlignOrientation")
alignOrientation.MaxTorque = 500000
alignOrientation.Attachment0 = grabAttachmentCharacter
alignOrientation.Attachment1 = grabAttachmentTarget
alignOrientation.Responsiveness = 10000
alignOrientation.Parent = rootpart
3 Likes
chima95
(chima95)
April 28, 2022, 12:40am
#3
Assuming you just want a smooth rotation, couldn’t you just tween the “rootpart” to face the “target.HumanoidRootPart”?
Something like:
game:GetService("TweenService"):Create(rootpart, TweenInfo.new(1), {CFrame = CFrame.lookAt(rootpart.Position, target.HumanoidRootPart.Position}):Play()
Also, not sure if this might help. Here’s 2 parts facing each other with the “alignOrientation”
PartsFaceEachOther.rbxm (4.2 KB)
Serrattor
(Serrator)
April 28, 2022, 8:36am
#5
nono i just need to use these cuz they respect physics, its like a, make the player face another player then make the player travel to another player, using align position later just the align orientation is a problem atm
Serrattor
(Serrator)
April 28, 2022, 8:36am
#6
they break if you rotate one part tho
kalabgs
(FartFella)
April 28, 2022, 9:51am
#7
Aligin orientation has CFrame property
local AO = Instance.new("AlignOrientation",part)
AO.Attachment0 = PartAtt
AO.Mode = Enum.OrientationAlignmentMode.OneAttachment
AO.MaxTorque = math.huge
AO.CFrame = CFrame.new(part.Position,part2.Position)
AO.Responsiveness = 200
Here is a test place:
aliginorientation.rbxl (33.7 KB)
9 Likes
Serrattor
(Serrator)
April 28, 2022, 1:28pm
#8
does the job very well thank you