Results 1 to 3 of 3

Thread: Can't get tile size

  1. #1

    Exclamation Can't get tile size

    Haven't tested with other custom objects, but tile.getBounds().size is {0,0,0} after spawning.

    Edit: The same for 3DText

  2. #2
    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

  3. #3
    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.

Similar Threads

  1. UI layout on tile?
    By goertzenator in forum Scripting
    Replies: 1
    Last Post: 03-29-2020, 11:59 AM
  2. The tile that will not rest
    By cche in forum Scripting
    Replies: 3
    Last Post: 02-26-2018, 10:41 AM
  3. setting exact tile size
    By poposhka in forum Scripting
    Replies: 2
    Last Post: 12-11-2017, 06:09 PM
  4. 3d UI Buttons size
    By Alatron in forum Scripting
    Replies: 2
    Last Post: 07-19-2016, 11:43 AM
  5. setNotes BBCode: no [size=???][/size] support
    By dizneyguy in forum Scripting
    Replies: 2
    Last Post: 03-24-2016, 01:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •