2D Toolkit Forum
2D Toolkit => Support => Topic started by: saeromm on July 25, 2012, 08:52:32 am
-
When I use 'Static Sprite Batcher', sometimes my objects disappeared....!
I can't explain in English well...
look at this, plz.
1. Edit Mode
Walls(Static Sprite Batcher)
tree(Sprite)
tree(Sprite)
tree(Sprite)
Game Object(It has only collider component)
2. Pressed Commit Button
Wall(Static Sprite Batcher)
3. Edit Mode(Pressed Edit Button)
Walls(Static Sprite Batcher)
tree(Sprite)
tree(Sprite)
tree(Sprite)
Game Object(It has only collider component) <- disappeared!
When I used '1.7 final + patch2' version, Static Sprite Batch was good. Objects dosen't disappeared.
Now, my Tk2d version is '1.75'.
*I'm Korean, so I know only easy words and sentence..... sry..
-
Any GameObjects without sprites would be removed from even the older versions.
The static sprite batcher doesn't batch any objects which aren't sprites and the collider on the game object would definitely not worked on older versions.
Did you add the GameObject recently (after updating)?
-
No, I didn't.
I used to added a object(without sprite) into static sprite batcher object(1.7 final + patch2 version).
'1.7 final + patch2 version' was no problem.
look at this plz..... this example is '1.7 final + patch2 version.
1. Edit Mode
Walls(Static Sprite Batcher)
tree(Sprite)
tree(Sprite)
tree(Sprite)
Game Object(It has only collider component)
2. Pressed Commit Button
Wall(Static Sprite Batcher)
Game Object(It has only collider component)
3. Edit Mode(Pressed Edit Button)
Walls(Static Sprite Batcher)
tree(Sprite)
tree(Sprite)
tree(Sprite)
Game Object(It has only collider component) <- didn't disappeared!
-
Hi saeromm,
This is expected behaviour in this current version, as with the current version you can build hierarchies of objects. I'll see if there is a way around it.
-
Hi saeromm,
I think the best thing to do here is to create an object parent, and create your static sprite batcher and gameobject as a child, as the alternatives would mean a lot more runtime complexity.
I'll explain the change which has made this break. In previous versions
SpriteBatcher
Sprite1
Sprite2
Sprite3
GameObject
Sprite4
etc. would work, as the gameObject would simply be left, but Sprite4 wouldn't be merged properly.
You can build complex hierarchies now, paving the way for a "Dynamic sprite batcher" in the future.
In the current version, this will work correctly. However, any components attached to GameObject would be lost, as it tries to remember the hierarchy, and will need to remember all other components too.
I suggest doing this if possible.
ParentGameObject
StaticSpriteBatcher
Sprite
Sprite
Sprite
GameObject (with collider)
If not it will be possible to make a mashup version which will work as it used to. Let me know if you'd like to do that and I can offer some advice on that.
-
thank you for your reply!
I'll try that!