Game Development Community

Player Collision

by Austin Reynolds · in Torque Game Engine Advanced · 05/30/2008 (4:54 pm) · 4 replies

Hey all ive been trying to find this in the forumns and have found people with simular problems but none that are quite like mine, I dont think mine is quite as severe as others yet.

I am wanting to make it so when "Player" runs into "AIPlayer" and vice versa they dont "collide" they just run thru each other. But only them. If they run into a tree id still like there to be collision.

Any pointers would be great. Here are the places / things ive done so far messing around.

Script -
In the player.cs there is a onCollision method I tried in there to make it ignore everything but the engine does something befor the script is called I think because when i do if(%className = %col.GetClassName() $= "AIPlayer") it registers but the collision still happens.

.cpp/ .h -
Have tried things found in the forumns in both the player.cpp/h and convex.cpp/h and neither seem to help.

Thanks alot if anyone has any tips or knows of a post somewhere else ive over looked.

#1
06/03/2008 (7:20 am)
Hi Austin,

Head up to the top of Player.cpp and take out PlayerObjectType from the Collision Move Mask. This way it'll skip collisions with that object type in updatePos () and you'll be free to run trough any player you like.
#2
06/03/2008 (7:50 am)
Trying it now one moment.
#3
06/03/2008 (8:04 am)
That worked! Thanks alot, now to learn how to add my own types there and how that all works :)

Thanks again,
Austin
#4
06/03/2008 (8:07 am)
My next goal is to get it so I can tell it what objects are and are not, idk what you would call it non collision? Because for instance tree's yeah want them to collide with that but if I have a object I want them to run thru I dont want them to collide with it. So looks like I have some fun ahead at least I see where its establishing those variables at now.