Behavior Acting Up
by Chad Smith · in Torque Game Builder · 07/28/2010 (11:44 pm) · 0 replies
It's been a while sense I've used TGB but I decided it would be what I use for this project I am working on.
Anyway I've been working my way through this Asteroids tutorial: http://tdn.garagegames.com/wiki/TGB/Tutorials/Asteroids
Just been reading it and trying things out as I go and see how everything works and get used to everything again. Anyway I am having a weird problem with the "smaller" asteroids. They spawn when the larger asteroid gets hit of course. When they spawn sometimes they do not spawn correctly. Sometimes they just spawn directly at 0,0 (center of screen) and just rotate around. They don't move in any x or y location. Then at the same time others will spawn perfectly and act just fine but then some how some black magic kicks in and it sets the smaller asteroid to the center of the screen.
It's really weird/hard to explain. They spawn correctly most of the time, but all the time it sets the x and y velocity to migrate to the center of the screen. Once they get there, they just stay there and spin in circles.
Here is an image of what I mean: http://i307.photobucket.com/albums/nn301/astar08_01/smallAsteroidBug.jpg
I have gone through and looked at all the behaviors the small asteroid has. I am lost on why this could be this way. I have also gone and looked at the spawn area behavior and the code LOOKS right, even though I am not the best with Tourque Script, I do know C++. So maybe I missed something? Anyone have any ideas?
I am only using the behaviors the tutorial says to use.
Any help on why this could be happening is appreciated! Thanks!
Anyway I've been working my way through this Asteroids tutorial: http://tdn.garagegames.com/wiki/TGB/Tutorials/Asteroids
Just been reading it and trying things out as I go and see how everything works and get used to everything again. Anyway I am having a weird problem with the "smaller" asteroids. They spawn when the larger asteroid gets hit of course. When they spawn sometimes they do not spawn correctly. Sometimes they just spawn directly at 0,0 (center of screen) and just rotate around. They don't move in any x or y location. Then at the same time others will spawn perfectly and act just fine but then some how some black magic kicks in and it sets the smaller asteroid to the center of the screen.
It's really weird/hard to explain. They spawn correctly most of the time, but all the time it sets the x and y velocity to migrate to the center of the screen. Once they get there, they just stay there and spin in circles.
Here is an image of what I mean: http://i307.photobucket.com/albums/nn301/astar08_01/smallAsteroidBug.jpg
I have gone through and looked at all the behaviors the small asteroid has. I am lost on why this could be this way. I have also gone and looked at the spawn area behavior and the code LOOKS right, even though I am not the best with Tourque Script, I do know C++. So maybe I missed something? Anyone have any ideas?
I am only using the behaviors the tutorial says to use.
Any help on why this could be happening is appreciated! Thanks!