Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Jtheme on December 12, 2012, 03:09:40 PM

Title: Help With Bullet Force [SOLVED]
Post by: Jtheme on December 12, 2012, 03:09:40 PM
I have a top down 2d in 3d world shooter.  a lot like Zombie Estate http://www.facebook.com/zombieestate (http://www.facebook.com/zombieestate)

I have an empty Game Object named "Gun" as a child to the main player.  But when I shoot the gun the bullets just freeze in air.  They only move when I run into them.  They have a box collider and a rigidbody attached to the bullets.

(http://f.cl.ly/items/3o0R0B1p0L3R3g3p282W/Screen%20Shot%202012-12-12%20at%202.01.42%20PM.png)

(http://f.cl.ly/items/1Z3Z2v1X023j0o0h002Z/Screen%20Shot%202012-12-12%20at%202.01.46%20PM.png)

(http://f.cl.ly/items/0T0T3A3k1H3Z1P3N3N2j/Screen%20Shot%202012-12-12%20at%202.01.54%20PM.png)

(http://f.cl.ly/items/3y3P0Z0c3Y2c2u0J3q3y/Screen%20Shot%202012-12-12%20at%202.02.47%20PM.png)
Title: Re: Help With Bullet Force
Post by: MajorIdea on December 12, 2012, 03:31:41 PM
Do you have an action to make them move? Like an AddForce or a translate on the bullet for example. Sort of - Add force (maybe even explosive force, though I never used that one) on the Z (self, not world)
Title: Re: Help With Bullet Force
Post by: Jtheme on December 12, 2012, 03:47:05 PM
The only action I have on the bullet itself is a wait then self destruct
Title: Re: Help With Bullet Force
Post by: DARK_ETERNAL on December 12, 2012, 04:04:12 PM
Have you tried applying velocity, instead?
Title: Re: Help With Bullet Force
Post by: Jtheme on December 12, 2012, 11:47:23 PM
I'm fairly new to Unity and Playmaker.  

I added a set velocity to the bullet and then to the character that it is coming from.

Maybe I am setting it up all wrong.  Any Tips?
I can take more screenshots.

Edit* I used the ThrowGrenade Scene Example to set up my scene.

Edit 2* I imported my bullet prefab into the ThrowGrenade Sample.  And it works how it is suppose to :/ 
Does it just now work because it is connected to a game object that is child of my player?
Title: Re: Help With Bullet Force
Post by: Alex Chouls on December 13, 2012, 01:33:10 AM
You need to tell Add Force what GameObject to apply force to. Right now GameObject is set to none.

First make a GameObject variable in the Variables tab called bullet.

In Create Object, use the Store Object popup to store the created bullet in the bullet variable.

Now set the GameObject in Add Force to the bullet variable.




Title: Re: Help With Bullet Force
Post by: Jtheme on December 13, 2012, 04:44:21 PM
Thank you so much for the help!  I wasn't storing the bullet variable in the "create object"

Works perfect!  Thanks again!