Collision when I don't want One!?
by Matthew Harris · in Torque Game Builder · 10/05/2006 (6:14 pm) · 5 replies
I have my main player in my side scroller throw a gernade and if the gernade collides with the bad guy it "sticks" to it. I want the gernade to simply pass through the bad guy and only interact with the tile layer. I tried putting them on seperate layers but they still collided. Any suggestions?
#2
setCollisionGroups(%groups)
setCollisionLayers(%layers)
Note that collision groups and layers are ***WRONG***separate entities entirely***/WRONG*** from rendering layers!
I had some issues with this stuff too when I didn't completely understand the Collision Layers and Groups. If you're not already, it's a good idea to familiarize yourself with the collision functions on the page linked above. CollisionMasks in particular are nice-'n-useful!
EDIT: Please see subsequent posts for accurate responses. Heh...
10/05/2006 (10:03 pm)
Dan is talking of the following:setCollisionGroups(%groups)
setCollisionLayers(%layers)
Note that collision groups and layers are ***WRONG***separate entities entirely***/WRONG*** from rendering layers!
I had some issues with this stuff too when I didn't completely understand the Collision Layers and Groups. If you're not already, it's a good idea to familiarize yourself with the collision functions on the page linked above. CollisionMasks in particular are nice-'n-useful!
EDIT: Please see subsequent posts for accurate responses. Heh...
#3
10/07/2006 (3:13 am)
Actually, collisionLayers does refer to the layer field. It specifies what layers the object will be allowed to send collisions to. Similarly, collisionGroups specifies which graphGroups the object will be allowed to send collisions to. They both only apply to collision active send on a given object. Active receive is based on the reciever's layer and graphGroup vs a sender's collisionGroups and collisionLayers.
#4
What I should have written above was:
Note that collision groups and layers are the same as (or, actually, refer to) general layers and groups. You can set stuff with the following functions:
To set what an object should collide with:
setCollisionGroups(%groups)
setCollisionLayers(%layers)
To set an objects layer and group:
setGraphGroup
setLayer
Basically, you set certain objects to have a specific layer (0-31). Within that layer you can set a specific group to which it belongs (also 0-31). You can then tell other objects to collide with only those objects on that layer and within that group. Basically you can tell the collision system to look at how the items are generally organized to figure out collision.
I had some issues with this stuff too [obviously ;)] when I didn't completely understand the Collision Layers and Groups. If you're not already, it's a good idea to familiarize yourself with the collision functions on the page linked above. CollisionMasks in particular are nice-'n-useful!
(Heh... I tried so hard to get it right that I totally forgot the key that made everything work! Sorry for any confusion my original post may have caused!)
10/07/2006 (11:29 am)
Wow. I just went back in time to when I didn't understand everything and actually thought they were different. Thomas is 100% correct.What I should have written above was:
Note that collision groups and layers are the same as (or, actually, refer to) general layers and groups. You can set stuff with the following functions:
To set what an object should collide with:
setCollisionGroups(%groups)
setCollisionLayers(%layers)
To set an objects layer and group:
setGraphGroup
setLayer
Basically, you set certain objects to have a specific layer (0-31). Within that layer you can set a specific group to which it belongs (also 0-31). You can then tell other objects to collide with only those objects on that layer and within that group. Basically you can tell the collision system to look at how the items are generally organized to figure out collision.
I had some issues with this stuff too [obviously ;)] when I didn't completely understand the Collision Layers and Groups. If you're not already, it's a good idea to familiarize yourself with the collision functions on the page linked above. CollisionMasks in particular are nice-'n-useful!
(Heh... I tried so hard to get it right that I totally forgot the key that made everything work! Sorry for any confusion my original post may have caused!)
#5
10/07/2006 (12:09 pm)
No need to appologize, you are being very helpful.
Torque Owner Dan MacDonald