![]() ![]() It’s worth noting that if the target is significantly above/below the character, it may appear tilted for a brief moment before the character automatically rights itself. Local newCF=CFrame.new(chrPos,tPos) -create our CFrameĬhr:SetPrimaryPartCFrame(newCF) -set the HRP's CFrame to our result, thus moving the character! Local tPos=target.Position -get the position of the target ![]() Local chrPos= -get the position of the HRP If chr.PrimaryPart then -just make sure the character's HRP has loaded So here’s a simple example of facing a character towards your target brick function lookAt(chr,target) -assume chr is a character and target is a brick to look towards Fortunately, instead of doing a bunch of math, we can take advantage of this CFrame constructor: CFrame.new(Vector3 position, Vector3 lookAt) You’re going to want to change the character’s PrimaryPart (typically HumanoidRootPart)'s CFrame to keep the same position, but change the orientation. ![]() (Someone already replied, but I might as well provide an answer anyway) ![]()
0 Comments
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |