Game Development Community

Critical: Dynamicly generating Mounted objects Causes Mounts to stop working

by Matthew Hoesterey · in Torque X 2D · 05/25/2009 (1:24 pm) · 4 replies

To reproduce.

1) mount a persistent particle fx to you player.

2) Create an object dynamically in code once every x sec. (This object should be moving so it's easier to see when the mounts stop working) Create a new particle system and mount it to your new object.

3) On World Limit destroy the object and the particle

Notice that eventually your mounts stop working.

In my game I spawn collectible orbs that float up toward the top of the screen. If they hit the top or are collected by a player they die and the manager spawns another at the bottom of the screen. There seams to be some sort of leak that causes mounts to stop working after creating and then destroying some number. (and the number isn't that high)

you can manually set the position of the particle system to the position of the created object every frame and everything will work fine (though using the mounting system would be optimal)

Thanks for any help.

#1
09/09/2009 (1:41 am)
Just thought I'd add that I'm seeing this bug with regular objects as well. I have some T2DSceneObjects that I clone from a template and mount to different objects as time passes. After anywhere from 3 to 7 mounts it stops working. From then on, about 90% of the cloned objects don't mount to the moving objects; the mountee objects will keep moving, but the cloned objects don't move along with it.
#2
09/09/2009 (3:33 am)
I've had issues with mounting as well. The easiest workaround is to add SceneObject.SnapToMount() inside a ProcessTick() function.
#3
09/09/2009 (4:49 am)
That's an idea I hadn't considered, thanks!
#4
09/09/2009 (9:10 am)
Hopefully GG will address this in their next update.