I made new project only to check this followPath function
local objProps = { name = "monster", x = 100, y = 100, assetName = "monster", xScale = 0.25, yScale = 0.25, followPathProps = {path = "path\_18", direction = 1, rotate = false, rebound = true, repeats = -1, delay = 1, autoStart = true, xFlip = true, yFlip = false}, } local obj = myLevel:createObject("animals", objProps).view obj.speed = math.random(1,4) obj:setSequence( "monsterFly") obj:play() local path = myLevel:getLayerObject("animals","path\_18").view obj:followPath( path, objProps.followPathProps)
but i still have nil value when I call followPath. I don’t know maybe I have not enough properties in followPathProps or I miss some library. (I have 3 files in my lib direcory: bezier.lua, LD_HelperG2.lua, LD_LoaderG2.lua)
I saw you wrote I should call
local obj = myLevel:createLayerObject(…)
but I call
local obj = myLevel:createObject(“animals”, objProps).view
(createObject not createLayerObject )
I can’t call
local obj = myLevel:createLayerObject(“animals”, objProps).view
or
local obj = myLevel:createLayerObject(“animals”, objProps) because I have nil value
In LD_HelperG2.lua, LD_LoaderG2.lua I can find createObject function but I don’t see createLayerObject
I don’t know is it important.