Possible to create colliders without sprites?
by bentgarney · in Torque Game Builder · 03/08/2005 (5:18 am) · 7 replies
#2
The ability to add entry/exit trigger zones is on the list though.
- Melv.
03/08/2005 (5:50 am)
Yes, just use a fxSceneObject2D. They don't render anything but have all the core capabilities such as collisions, physics, picking etc.The ability to add entry/exit trigger zones is on the list though.
- Melv.
#3
This object is setup to receive collisions from "groupsToHit"/"LayersToHit" (whatever you want here).
- Melv.
03/08/2005 (10:41 am)
You can setup a fxSceneObject2D just as you would a sprite. Setup its collisions and you will get a standard callback if anything hits it.new fxSceneObject2D(goalTrigger) { scenegraph = t2dscenegraph; };
goalTrigger.setImmovable();
goalTrigger.setGroup( xxxxxx );
goalTrigger.setLayer( xxxxxx );
goalTrigger.setCollisionActive( false, true );
goalTrigger.setCollisionMasks( groupsToHit, layersToHit );This object is setup to receive collisions from "groupsToHit"/"LayersToHit" (whatever you want here).
- Melv.
#4
Can you post your code? You do know how to size an object?
- Melv.
03/08/2005 (1:35 pm)
I'm really confused now. ;)Can you post your code? You do know how to size an object?
- Melv.
#5
I'm about to go to sleep (so knackered), I'll check this out in the morning for you. :)
- Melv.
03/08/2005 (3:17 pm)
@Rob: Not at all mate.I'm about to go to sleep (so knackered), I'll check this out in the morning for you. :)
- Melv.
#6
As it mentions in the reference doco, "setCollisionScale()" only accepts parameters between 0 and 1 where 1 is the size of the object. If you want a bigger object then use the standard "setSize()" as you would any other T2D object.
Typically, you'd only want to use "setCollisionScale()" when you've got a standard polygon shape and just want to size it inside the objects size.
Other than that, you should be ready to rock. :)
- Melv.
03/09/2005 (4:24 am)
Robert: You're being naughty again! ;)As it mentions in the reference doco, "setCollisionScale()" only accepts parameters between 0 and 1 where 1 is the size of the object. If you want a bigger object then use the standard "setSize()" as you would any other T2D object.
Typically, you'd only want to use "setCollisionScale()" when you've got a standard polygon shape and just want to size it inside the objects size.
Other than that, you should be ready to rock. :)
- Melv.
#7
Each to their own fu!
Good Luck.
- Melv.
03/09/2005 (4:43 am)
I can't draw for toffee, I wish I could, I really do!Each to their own fu!
Good Luck.
- Melv.
Torque Owner Corey Martin