I am using the code below to create a bullet, the image sprite is called bullet.
How do i move the created factory bullet and how do i gain access to the go.position, rotation set and get methods etc?
local item = factory.create("#factory", vmath.vector3(x,y,0), nil, {bullet}, 0.6)
regards,
A
britzl
2
This should work:
local pos = go.get_position(item)
pos.x = pos.x + 100
go.set_position(pos, item)
1 Like
Ah that makes sense just a learning curve from php c++ etc…
1 Like
I had to amend slightly as the pos and item were back to front,
Thought I would post this in case other people have same issue
go.set_position(pos,item) for setting the position of factory created objects
Many thanks Britzl !
britzl
5
Ah, my bad. I’ve updated my post.