Hello,
Got a problem. In the game i am making i got a platform which is constantly moving up (until it reaches a point when it gets destroyed).
The platform itself is a Factory object (due to it spawning constantly) (something akin to infinite runner games).
Anyhow, I would like some spikes to shoot out of the platform but i got the following problem. When i try to use an animator, well he checks the current coordinates and then keeps an object in a “loop” of his original coordinates so it is not possible to move it up by using an update anymore. I would have to move the parent so the child can have its separate movement.
1.) First method i tried
If i try to move an image that is part of that factory game object i created, it doesn’t have the position property (since it is not an GO), so even tho it is moving with the platform i can’t do anything additionally to it
go.animate(url, "position.y", go.PLAYBACK_LOOP_PINGPONG, 0.0, go.EASING_INOUTBACK, 3)
2.) I tried making the spikes themselves a separate GO and then parent them with
msg.post("sp_spikes", "set_parent", { keep_world_transform = 1 })
but this does absolutely nothing. Maybe because i am trying to parent it to a factory? i get no error or anything so at least i know it parented it to SOMETHING but obviously not to what i wanted.
3.) Tried for the test of it to make a fully separate object with its own script. If i do its own update to move up, and an animator it will be stuck in the animator loop (animator will always override its position)
I mean these two are the only methods that come to mind at the moment, is it possible to do it in the same direction?
I move the platforms this way
function update(self, dt)
local pos = go.get_position()
if pos.y > 1200 then
go.delete()
end
pos.y = pos.y + self.speed * dt
go.set_position(pos)
end
TLDR: The thing i need is a way to somehow parent spike trap to another game object (its parent) and which is currently a factory, so that i can use go.EASING_INOUTBACK on the spike trap
halp and ty will post additional code/explanation if this is not enuff
EDIT: additional info, both factory objects are kinematic, i mean their GO counterparts have kinematic phy attached to them. one of them can be trigger tho i tried didn’t change much