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) 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.
Torque Owner Jacob Lynch