How to prevent Projectiles interacting with their Creator?

Post Reply
BSkin
Posts: 1
Joined: Wed Sep 11, 2013 10:21 pm

How to prevent Projectiles interacting with their Creator?

Post by BSkin »

I'm making a 2D game, and I have run into a problem. The "bullets" that the player shoots either collide with the player character, making him jump every time he shoots, or start too far away from the player, not correctly interacting with objects directly beside the player.

The obvious solution that I thought of was making it such that the player's bullets do not interact with the player, but being new to Bullet Physics, I do now know how to achieve such results.

What is the best way for me to have the bullets pass through the player as they are created, without affecting the player?
MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: How to prevent Projectiles interacting with their Creato

Post by MaxDZ8 »

A solution might involve collision masks and groups. Sadly, those are meant to be static for an object so I'm not quite on them.
The correct solution is probably to ask the artist to move the projectile spawn position out of the player/weapon model.
But, if everything fails, I'd just do a simple check on projectile owner id and simply ignore all collisions involving the spawner for a few ticks... because you're not really using dynamic bodies for player avatars are you?
Post Reply