In the object setting, I’ve prescribed that the z-position is 1 (greater than the background position), but if I spawn the monsters like this:
{...}
local position = vmath.vector3(800, 200, 1)
{...}
factory.create(monster[monster_name].factory_url, position, nil, {damage = monster[monster_name].damage, speed = monster[monster_name].speed, hp = monster[monster_name].hp, height = monster[monster_name].height, experience = monster[monster_name].experience})
They will still appear behind the backgound
You may not be able to see the monster, but it’s beating the slime right now.
Но если я реализую код таким образом:
{...}
self.position = go.get_position()
self.position.x = 800
self.position.y = 200
{...}
factory.create(monster[monster_name].factory_url, self.position, nil, {damage = monster[monster_name].damage, speed = monster[monster_name].speed, hp = monster[monster_name].hp, height = monster[monster_name].height, experience = monster[monster_name].experience})
Then the monster becomes visible
Почему при спавне с использованием vector3, моб не получат указанную z-позицию ? (для справки - z-позиция фона меньше 1)