Bots and players both use playerRecord
s. From what I can tell, I think there is a race condition between setting the bot’s position and waiting for it to hit the ground (like in your screenshot) and the server waiting for the first command from playerRecord.BotThink
.
In other words, your bot is too slow to start telling the server what it wants to do before it sinks into the ground.
I think this could be avoided if, before sending any commands through .BotThink
, you send a command to the server upon spawning it in.
Somewhere between setting the position of the bot and defining .BotThink
, try constructing a command,
local command = {}
command.localFrame = playerRecord.frame
command.playerStateFrame = 0
command.x = 0
command.y = 0
command.z = 0
command.serverTime = tick()
command.deltaTime = deltaTime
encoding it,
local event = {}
event[1] = CommandLayout:EncodeCommand(command)
and telling the chickynoid to handle the event.
playerRecord.chickynoid:HandleEvent(Server, event)
The example Bots
module given in the example place works because playerRecord.waitTime
is 0 when .BotThink
is first called, so as soon as it’s good to go, the bot sends a command with x, y, z = 0.
If this is still an issue for you, I can try to look further into the source code to determine why the bot’s chickynoid collision hull is sinking into the ground. I can’t remember right now, but I think the server doesn’t take the bounds of the collision hull into account until the chickynoid is loaded after receiving its first event. I think it was to prevent players from falling through the world before the client can send in their initial load event. E.g. let the player flail in the ground until the server recognizes their input commands, similar to your current situation.