Collision Detection

Posted By: 82RJZAE

Collision Detection - 03/31/10 23:01

Hello, could someone tell me what the best method would be for an object that is dropped by the player to be passable until they moved out of it?
Posted By: 3run

Re: Collision Detection - 04/01/10 08:23

I've the same problem frown can't get weapon pass through the player when he drop it frown
Posted By: Progger

Re: Collision Detection - 04/01/10 08:45

Can you explain ur problem with more detail because i read the post and i dont know what ur problem is.SHould the weapon be passable when the player drop it?
WFG Progger
Posted By: CoburnDomain

Re: Collision Detection - 04/01/10 12:31

Hm, you could set the varible to the dropped model to "passable", as this will allow models to go into each other. So say you wanted a chainsaw to cut through a tree, you'd have to make the tree passable to the chainsaw or else the tree model and chainsaw would either get stuck, spaz out, or just cut through each other.

Hope this helps.
Posted By: 82RJZAE

Re: Collision Detection - 04/02/10 01:20

I want the object to be passable only until the player moves out of it.

For example, say I want to drop a crate on the ground I am standing on. The crate has to be passable or else I will get stuck; however, the crate must become impassable once I step out of it otherwise it is not much of a crate.
Posted By: Rich

Re: Collision Detection - 04/02/10 06:03

Maybe like this:

use vec_dist to keep track of the object and player's distance.

When the two are far enough apart, set the object to no longer be passable.

Use a variable as a switch, and once the object and player are far enough apart, set the variable to 1. Use this variable to switch off being passable.

Optionally, you could also use the YOU pointer in combination with the IGNORE_YOU flag, so that other players could still collide with this object even though the player can't. You would just have to set the YOU pointer to the player who dropped it every frame until collision for the two is switched back on.

I hope that made sense!
© 2024 lite-C Forums