of     1   

HarrySnotte
#213900296Sunday, April 09, 2017 4:45 PM GMT

I'm making my own kind of "bots" you could call them... I'm making an offensive mode where the bot would shoot you, other players or other bots, whichever is an enemy and the closest to him. In this offensive mode, I want the bot to constantly look at its opponent, regardless of how it's moving(kind of like when you're walking sideways in first person and keep your camera on a specific point). I already figured out I should disable "AutoRotate" in the humanoid, but from this point on I'm struggeling. I could use a loop and CFrame to keep the bots eyes on his enemy, but that's very messy and ruins the walking part. I thought BodyGyro might do the job, but I'm very unfamiliar with it and when I tried it, it glitched out a bit... So my question is, is there an easy and efficient way to make my bot constantly look at it's target? (note that the target is most likely moving as well)
Gomlsauresrex
#213900691Sunday, April 09, 2017 4:51 PM GMT

You can use a bodygyro and put it into the "bot"'s torso. local bot=script.Parent local Torso=bot:WaitForChild("Torso") local bg=Torso:WaitForChild("BodyGyro") repeat wait() until game.Players.Player1.Character local ##################################### #################################### lookat.HumanoidRootPart.Position)
HarrySnotte
#213901275Sunday, April 09, 2017 5:00 PM GMT

Too bad roblox very nice chat filtering system censored half your post, but I'll try BodyGyro again and see if I can get it to work better...
Wunder_Wulfe
#213901452Sunday, April 09, 2017 5:02 PM GMT

CFrame.new( torso.CFrame.p, targetCFrame.p ) --cast cframe looking toward target for only horizontal rotation local noY = Vector3.new(1 ,0, 1) CFrame.new( torso.CFrame.p * noY, targetCFrame.p * noY )
Sacrificable
#213901501Sunday, April 09, 2017 5:03 PM GMT

character look a certain direction* HumanoidRootPart.CFrame = CFrame.new(HumanoidRootPart.Position, Vector3.new(Position.X, 0, Position.Z)) 0
Wunder_Wulfe
#213901688Sunday, April 09, 2017 5:06 PM GMT

no that makes them look down into a void if they go up or into the sky if they go down
HarrySnotte
#213908972Sunday, April 09, 2017 6:45 PM GMT

Thanks for the suggestion, but the reason why I'm not using CFrame is because the bot is walking as well, using the MoveTo method from Humanoid. I need to somehow control the rotation of the bot without touching the position and as soon as you use CFrame, you set it's position as well.
Wunder_Wulfe
#213993225Monday, April 10, 2017 5:51 PM GMT

when you cast a lookat cframe from point A it will remain at that point and if u really are pesky about it just use the lookat cframe and a body gyro with no up-down rotation allowed

    of     1