Oncollision behavior
by James Ford · in Torque Game Builder · 05/05/2007 (2:58 pm) · 3 replies
I'm working on understanding the distinction between a regular collision callbacks and those that are part of a behavior. What happens when an object has more than one behavior with oncollision functions? Or an object has a behavior::oncollion and a classname::oncollision? Hopefully they all get called?
About the author
http://jamesdev.info
#2
05/05/2007 (3:49 pm)
Sure it would make sense, you just wouldnt be able to do anything that needs to happen in a specific order. This way you can break up your collision responses into different functions that can be shared by other objects independently of each other. If its possible that is '-)
#3
I mean beside guaranteing that nothing can be guaranteed to work at all. (its just luck if it does and does not bomb, especially as non-hardcore programmers use TGB as well where this will not could lead to problems)
You could add a behavior that has a common callback part in and just calls its part from the classname callback or do it vice versa, that the behavior just calls the class specific part from its owner which would be what I would do to have it cleanly seperated and structured
05/06/2007 (3:33 am)
And wherefor would you need 2 callbacks in this case?I mean beside guaranteing that nothing can be guaranteed to work at all. (its just luck if it does and does not bomb, especially as non-hardcore programmers use TGB as well where this will not could lead to problems)
You could add a behavior that has a common callback part in and just calls its part from the classname callback or do it vice versa, that the behavior just calls the class specific part from its owner which would be what I would do to have it cleanly seperated and structured
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
wouldn't make any sense if more than one onCollision callback was called.
don't use the behavior if you already have a classname based oncollision I would say.