Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 9 years ago

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.

0
Why would doing something very often but not in a loop be any better than in a loop? BlueTaslem 18071 — 9y
0
It wouldn't be any better. ZeptixBlade 215 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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)
0
No, I don't want any thrust. ZeptixBlade 215 — 9y
0
It doesn't need thrust, just set the cartoon factor without any force. aquathorn321 858 — 9y
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 ZeptixBlade 215 — 9y
0
no, it doesn't need to loop. Just set the target to the part you want the bot to face. aquathorn321 858 — 9y
View all comments (6 more)
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. ZeptixBlade 215 — 9y
0
Maybe it's too weak then. I'll go think of another way. aquathorn321 858 — 9y
0
Maybe you could use the changed event. aquathorn321 858 — 9y
0
edited my answer aquathorn321 858 — 9y
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. ZeptixBlade 215 — 9y
0
It worked for me, I tested it in studio before I posted it. aquathorn321 858 — 9y
Ad

Answer this question