Game Development Community

spawning bots on Top of a StaticShape

by Steve · in Torque 3D Professional · 07/23/2009 (11:03 am) · 1 replies

I am trying to get a bot to spawn on top of building and walk back and forth following the path markers I have placed on top of the building. No matter what I do, the bot spawns on the ground, directly below the path markers. He does follow the path markers, but he does so on the terrain at the foot of the building, instead of on top of the building. I know my collision mesh is good because if I pick up the bot via his gizmo and place him atop the building, he follows the markers...he does not fall through the building. He just won't spawn where I want him to! Can anyone help me with this please?

#1
07/23/2009 (11:20 am)
I don't believe that the new spawn functions account for that and the old one only did a poor job of it.

You can modify the pickSpawnPoint (player and/or camera) function in "core/scripts/server/spawn.cs" and introduce the getTerrainLevel() method from the "Slightly Better Spawn Function" resource. Just make sure you add Interiors and TSStatics to the mask for %ground (see comment #3) and remove them from the %mask of objects to not spawn upon.