Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: jayf on June 18, 2014, 06:45:04 AM

Title: Bullets just won't work [SOLVED]
Post by: jayf on June 18, 2014, 06:45:04 AM
Hi.

I'm trying to make a projectile that damages enemies, so basically the just standard "bullet". After googeling and following various tutorials, I still can't seem to make it work. However the answer seems to be adding an "On Collision" transition to trigger the rest of the actions. But it still can't seem to work. I've attached the FSM setup. The "Hit Target" Action contains stuff like "Send Event" and "Get Collision Info".

Title: Re: Bullets just won't work
Post by: Lane on June 18, 2014, 07:06:35 AM
Does the bullet and the thing it hits both have colliders?
Title: Re: Bullets just won't work
Post by: jayf on June 18, 2014, 08:16:00 AM
Enemy has a collider, the bullet doesn't. If I add a collider to the bullet, it seems to disappear, or it can't seem to spawn for some odd reason. Without a collider, it works fine with an Add Torque action.
Title: Re: Bullets just won't work
Post by: Lane on June 18, 2014, 08:32:19 AM
The bullet must have a collider. It probably disappears because it spawns inside a collider such as the gun or the player. Can you confirm?
Title: Re: Bullets just won't work
Post by: jayf on June 18, 2014, 09:49:42 PM
Yes! That was the problem. They actually spawned inside the gun and got destroyed before actually leaving it, so I made them spawn outside instead and now their hits register with the enemy since they now have a collider. Thanks for the help! :)