Allowing player to go through walls?
by Christopher Gardner · in Torque 3D Professional · 03/03/2010 (3:06 pm) · 6 replies
Does anyone know how I would go about making an ability that lets the player walk through certain walls that I could defines in a datablock?
About the author
#2
PS: I was thinking of Steve's method too, but since it was used i had to think up another "smart" method :P
03/03/2010 (11:16 pm)
maybe some oncollide, trigger prefab which just teleports them to the other side if the player object type is detected ? :PPS: I was thinking of Steve's method too, but since it was used i had to think up another "smart" method :P
#3
03/04/2010 (2:21 pm)
Well, I want there to be an ability (like psychic) that allows you to go through certain walls for a limited amount of time.
#4
Doesn't have to be part of the wall, you could have a wall without collision and place a "StaticShape" (read DynamicShape) with no visible mesh but only a collision mesh, and then use it as a blocker for the wall, moving it out the way when you want players to go through the wall and then moving it back when you want to stop them.
03/04/2010 (3:10 pm)
How about having a dynamic collision mesh that you can move around? Doesn't have to be part of the wall, you could have a wall without collision and place a "StaticShape" (read DynamicShape) with no visible mesh but only a collision mesh, and then use it as a blocker for the wall, moving it out the way when you want players to go through the wall and then moving it back when you want to stop them.
#5
seems to work in a quick test with a DTS for me.
Someone who is far more clever than I could probably make textures sensitive in the way footprints are sensitive to the base texture they are stamped on.
03/05/2010 (1:54 am)
I would try and make the walls which can be affected by the power as models separate from the main structure and turn their collisionType property on and off via script.wallThingie.collisionType = "None"; wallThingie.collisionType = "Visible Mesh";
seems to work in a quick test with a DTS for me.
Someone who is far more clever than I could probably make textures sensitive in the way footprints are sensitive to the base texture they are stamped on.
#6
If all of your walls are potentially able to be walked though, then I would do something with the onCollision() callback in script so that you don't have a billion triggers in the level. This brings up issues with what happens when you walk away from it though, since collisions don't behave the same way as triggers do, so that part you'd have to figure out on your own (or maybe look at the mounted trigger resource and have the player mounted with a trigger that will do that functionality for you?).
03/05/2010 (5:35 am)
If it's only certain walls on the level, I would put triggers there. When the player enters the trigger, it checks to see if he/she is psychic. If the player is, then the trigger sets that wall to non-collidable. If not, it does nothing. When the player leaves the trigger, the wall is set back to collidable.If all of your walls are potentially able to be walked though, then I would do something with the onCollision() callback in script so that you don't have a billion triggers in the level. This brings up issues with what happens when you walk away from it though, since collisions don't behave the same way as triggers do, so that part you'd have to figure out on your own (or maybe look at the mounted trigger resource and have the player mounted with a trigger that will do that functionality for you?).
Associate Steve Acaster
[YorkshireRifles.com]
Do other "things" have to be blocked by these walls?
In other words ... can you just use a mesh wall without collision?
(I expect you really want something more complicated ...)