Object position in a display text

  • #1, by berthe-adrienFriday, 08. June 2018, 16:31 6 years ago
    I would like to obtain the position of an object in the currentcharacter display text

    Newbie

    4 Posts


  • #2, by afrlmeFriday, 08. June 2018, 17:13 6 years ago
    hmm... you would need to store the object position in a value as a string or in 2 values as numbers.

    1. create a new value in right hand values tab for the scene. rename it to something appropriate.

    2. just before the display text action part, create an execute a script action part & add this line to it...
    local obj = game.CurrentScene.Objects["example"].Position
    Values["example"].String =  ("x = " .. obj.x .. " y = " .. obj.y)

    3. now inside of your display text you need to link to the value so insert this...
    <vs=example>

    <vs=example></vs=example></b> into your display text somewhere.</vs=example></div>

    Quick note: "example" should be replaced with the actual name you gave the value & the actual name of the object you want to store the position of into the value.

    Imperator

    7278 Posts

  • #3, by berthe-adrienSaturday, 09. June 2018, 16:19 6 years ago
    Thank AFRLme I will try it.

    Newbie

    4 Posts

  • #4, by afrlmeSaturday, 09. June 2018, 19:46 6 years ago
    sorry, the auto-formatting on this forum sometimes. roll

    Imperator

    7278 Posts