2

Any level flow or lua script can get the object of animation in stingray? I try to use "set_local_position()", but it still not work.

Below have the code in project.lua

function Project.on_level_load_pre_flow()
    setObjPostion(Project.level_names.testLv,"mainobj",stingray.Vector3( 100, 100, 100 ))
end


function setObjPostion(levelsString,newObjString,newPosition)
    world = stingray.Application.new_world()
    world:load_level(levelsString)
    myobj = stingray.World.unit_by_name(world,newObjString)
    --local newPosition2= stingray.Vector3( 100, 100, 1 )
    stingray.Unit.set_local_position(myobj,1,newPosition)
end
MuertoExcobito
  • 9,741
  • 2
  • 37
  • 78
Philiphk
  • 21
  • 1
  • not related to your question, but is there any reason for world and myobj to not be local? "but it still not work" is no problem description btw. it says nothing. Provide more information. – Piglet Sep 08 '16 at 15:34
  • Can you provide more information? What are you trying to do? – Per Nov 08 '16 at 17:25

0 Answers0