Haven't tested with other custom objects, but tile.getBounds().size is {0,0,0} after spawning.
Edit: The same for 3DText
Haven't tested with other custom objects, but tile.getBounds().size is {0,0,0} after spawning.
Edit: The same for 3DText
Did you check if object finished spawning?
Note: the official description of the property 'spawning' is misleading IMHO. It is true as long as the object did not finish spawning. I use this simple function to wait for the spawned object:
Code:function waitSpawn(object) --[[ object.spawning is true, as long as the object is spawning (which usually takes 50-100 ms), and false if spawned. @param {object} object The object we are waiting to spawn. --]] while object.spawning do coroutine.yield(0) end end
Tiles are working for me (when I spawn a ScriptingTrigger with the data I get from getBoundsNormalized().size at the position of the object (offset added) and with its rotation, the zone occupies exactly the same space as the object. getBounds() works too, but zone is larger than, of course.
You could try to use getBoundsNormalized(), which I prefer to getBounds(). If you rotate it according to the object then this represents the bounds of the object much better than getBounds(). Maybe this works.
3DText is true though. I do not get {0,0,0}, but the values I get are nonsense and do not correspond to the real size in any comprehensible way.