Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: PikabobAlex on November 14, 2012, 10:07:15 AM

Title: How to Gun Scripting and make the gun Projectile?
Post by: PikabobAlex on November 14, 2012, 10:07:15 AM
Hello, I'm new to PlayMaker and I want to make a cool FPS game.  But I have no idea how the Gun works in Unity 3D. And the projectile object should I make in Raycast or rigidbody? TQ
Title: Re: How to Gun Scripting and make the gun Projectile?
Post by: DARK_ETERNAL on November 14, 2012, 10:41:25 AM
As far as I know, you don't have a default gun mechanics in Unity. That's your job here :D

I've made some shooters, not FPS's though, but the mechanics should be the same: You have your character (with a CharacterController component attached, perhaps) moving and such stuff, and, when you get input from your "Fire" button, you instantiate your projectile and add a force and... You know the rest, BANG! :P

As for the projectile, be aware that Raycast won't be visible, unless you cast a LineRenderer (or so I'd do), and it's function is to detect whether an object could collide with another. You would probably want to create a prefab with a non-kinematic Rigidbody. Remember to add a collider.

Hope this helps.