Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: terrymorgan on April 14, 2012, 07:27:41 PM

Title: [SOLVED] Henk Dawson's grenade variation
Post by: terrymorgan on April 14, 2012, 07:27:41 PM
I tried to duplicate this video, a variation of the grenade prefab-

http://web.me.com/henkdawson/Unity/Tutorials/Entries/2011/7/22_Playmaker__Cannon_Ball_Explode.html

Except he uses a 'cannon' and 'input manager' where I was trying to use the 1st person controller and
scene from samples/testlab/physics/throw grenade. I make grenades but they just hang in the air, I think
there's a problem with the 'lastgrenade' which refers to the grenadeprefab. I can't select
'none' for the /wait-finish event action of shootcannonball.

 I'm basically looking for a
grenade that explodes instantly on collision with an object, a.k.a 'bullet'
Title: Re: Henk Dawson's grenade variation
Post by: Alex Chouls on April 15, 2012, 12:02:34 AM
Did you start wih the ThrowGrenade scene? Select the grenade prefab, and edit its FSM to go to the explode state with the COLLISION ENTER event. I'm not at my computer right now, but if memory serves, this should be a fairly straight forward modification to the grenade prefab's FSM.

Did you start with the grenade prefab? If you made a new prefab, double check the rigid body setup...
Title: Re: Henk Dawson's grenade variation
Post by: terrymorgan on April 15, 2012, 10:30:08 AM
I made a copy of the grenade prefab- FSM goes -countdown(finished)->blink(finished)->explode, not sure where to stick the
collision enter bit, do I edit 'countdown' to transition to collision enter and 'delete blink?' Rigid body hasn't
changed to my knowledge.
Title: Re: Henk Dawson's grenade variation
Post by: terrymorgan on April 15, 2012, 10:42:58 AM
I made a ctrl_d copy of grenadeprefab, on its FSM I deleted blink, and changed 'finished' on countdown to collision enter, connected to explode, voila, weapon. I guess I need a baddie next, and a way to make the
grenade subtract hit points, etc.