playMaker

Author Topic: How to Gun Scripting and make the gun Projectile?  (Read 2758 times)

PikabobAlex

  • Playmaker Newbie
  • *
  • Posts: 22
How to Gun Scripting and make the gun Projectile?
« 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

DARK_ETERNAL

  • Full Member
  • ***
  • Posts: 110
Re: How to Gun Scripting and make the gun Projectile?
« Reply #1 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.
Check out our new game: Nitro Chimp. Now live in App Store!

Trailer:
Download: https://itunes.apple.com/app/nitro-chimp/id557150450?l=en&mt=8