Collision Types - colliding with one object but not another.
Posted: Mon Sep 08, 2014 9:50 pm
[SOLVED}
This is actually trivially easy. There are two parts.
fixture:setCategory() - sets the collision types
fixture:setMask() - sets the collision types that get ignored
thats all there is to it, really
------------------------------------------------------------------------
------------------------------------------------------------------------
While this thread is active, I'm going to try to figure this out on my own. Once i figure it out, I'll update this post. I just haven't seen any tutorials that deal with this.
It would be nice to have a chain that the player can walk through but still collides with the evironment (doesn't clip through walls, etc) or a sword that collides with other objects, but can be layered over top of the player's sprite, etc/
The functionality is implied by the existence of such things as body:getType/body:setType and fixture:setCategory, but I'm not sure if there is a "right" way to do this that is established within the community, or a library, or what have you.
thanks for any insight you can give me!
Once I get this sorted out, it will become searchable in the forums for anyone else with the same question, so no one need ask again
This is actually trivially easy. There are two parts.
fixture:setCategory() - sets the collision types
fixture:setMask() - sets the collision types that get ignored
thats all there is to it, really
------------------------------------------------------------------------
------------------------------------------------------------------------
While this thread is active, I'm going to try to figure this out on my own. Once i figure it out, I'll update this post. I just haven't seen any tutorials that deal with this.
It would be nice to have a chain that the player can walk through but still collides with the evironment (doesn't clip through walls, etc) or a sword that collides with other objects, but can be layered over top of the player's sprite, etc/
The functionality is implied by the existence of such things as body:getType/body:setType and fixture:setCategory, but I'm not sure if there is a "right" way to do this that is established within the community, or a library, or what have you.
thanks for any insight you can give me!
Once I get this sorted out, it will become searchable in the forums for anyone else with the same question, so no one need ask again