Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is there a way to make a bot face your character without a while loop?

I've been able to make a bot face you by setting the CFrame in a while loop, but I don't want to do this because when there's a lot of bots this lags.

I've tried using a BodyGyro but this (unless it's in a loop) doesn't change when you walk around, so the bot only faces the position you started at.

Is there a way I can make the bot face you without a loop?

This is not a request, because I've done lots of work myself.

2 comments

0

Why would doing something very often but not in a loop be any better than in a loop?

0

It wouldn't be any better.

1 answer

Have you tried Rocket Propulsion?

or you could use the Changed event.

local t = target --what you want the bot to face at
local b = bot --part of the bot you want facing the target

t.Changed:connect(function(characteristic)
if string.lower(characteristic) == "position" then
b.CFrame = CFrame.new(b.Position,t.Position)
end
end)

10 comments

0

No, I don't want any thrust.

0

It doesn't need thrust, just set the cartoon factor without any force.

0

Oh, I see. Wouldn't that cause the same problem though, needing to be in a really fast while loop? http://wiki.roblox.com/index.php?title=API:Class/RocketPropulsion/CartoonFactor

0

no, it doesn't need to loop. Just set the target to the part you want the bot to face.

0

I just tried it, and it doesn't work. It doesn't even turn the bot a little. Even when I do it manually, without scripts, for some reason it doesn't turn to face Target.

0

Maybe it's too weak then. I'll go think of another way.

0

Maybe you could use the changed event.

0

edited my answer

0

That kind of defeats the purpose -- If I'm walking around, it's not gonna be much slower than a while loop. However, I tested it and it doesn't work (the event doesn't fire). I know the changed event doesn't work well with certain properties, maybe position is one of them.

0

It worked for me, I tested it in studio before I posted it.

This discussion is preserved as it was. New answers, comments, and votes are closed.