Teleportation of STKM Using Lua

  • BrianTheEngineer
    28th Dec 2019 Member 0 Permalink

    I am making my STKM teleport wherever my mouse is clicked for no reason other than to improve my coding skills. I was testing it when all of a sudden the STKM just exploded out of existence. I used the sim.partProperty function to alter the x and y coordinates of the STKM instantaneously. However, it appears that the legs don't teleport with the STKM's head and the STKM just slingshot itself out of the map and into the abyss known as the void. How can I fix this?

  • jacob1
    28th Dec 2019 Developer 0 Permalink
    STKM remembers the positions of its legs. There is no way to modify or access this data in vanilla TPT. So, any attempt to move the stickman will just cause it to slingshot like that, because it thinks its head is 200 pixels away from its legs.
  • DanielGalrito
    29th Dec 2019 Member 0 Permalink

    You could freeze the STKM in place for some frames, so that its legs can catch up.