• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Mr Brightside · Nov 12, 2015 at 04:35 PM · shipweapon systemweaponchangingcannoncannonball

Weapon firing and weapon selection mechanism for C# game

Hi i will get straight to the point I'm building a little personal project (i say personal as in its for practice because its actually my first game) and i have done a lot of research for a couple days looking for answers and presets for building a weapon system that fires cannons on a large ship from either the Portside or the Starboard side or even the bow (front of the ship i also have mortars on the main deck). the only thing i can find coming close to what i need is scripts for modern day weaponry and since i don't even understand how to read code all that well if at all, i want to know if anyone out there knows how to either convert the scripts to what i need or help me figure out how to write it myself. any help is greatly appreciated, thank you.

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Cherno · Nov 12, 2015 at 05:05 PM 0
Share

Some tips.

Represent each cannon muzzle as an empty gameobject pointing in the direction the cannonball would fly. Create a simple gameobject with a cannonball mesh (sphere), give it a rigidbody, and make a prefab out of it. When a cannon should fire, instantiate a copy of that prefab and use RigidBody.AddForce to make it fly forward in a nice arc. Use the Unity User $$anonymous$$anual and Scripting API for further information on the required functions and variables. If you also want a muzzle flash, give the muzzle object a meshrenderer or particlesystem with the appropriate graphics. Use a Coroutine in for tformer case to enable the $$anonymous$$eshRenderer for a fraction of a second to simulate the flash. If using a ParticleSystem, use ParticleSystem.Emit to emit a number of particles. The cannonball itself can also be given a TrailRenderer or ParticleSystem for a trail or smoke effect.

avatar image Mr Brightside Cherno · Nov 13, 2015 at 12:33 AM 0
Share

i don't understand, i have the dastardly banana weapons pack but i can't even get that to work and i don't know how to read of write code languages. could you please give a basic example of what you mean ore even a link to a tutorial would help me, i just can't wrap my head around this weapon system. thanks

avatar image ijidau · Nov 13, 2015 at 01:25 AM 1
Share

To be honest, you will struggle to get anywhere unless you start learning to code. The Unity $$anonymous$$m have done a great job of making this as easy as possible. http://unity3d.com/learn/tutorials

They key is to realise that like most things, you'll need to start simple and build your knowledge and experience over time. If you don't understand something, work your way backwards to the simplest aspect you do understand and start tackling it from that point forward.

avatar image Mr Brightside ijidau · Nov 15, 2015 at 01:47 AM 0
Share

i've just tried googling answers and definitions to find out why my scripts are not working even though i write them exactly how it is down in the demonstrations and tutorials (i do replace their objects with my own so its compatible with my project) and still nothing is working for me i even went to the link u sent me for a couple hours watching their tutorial and nothing is working, my scripts don't bring up the options in the inspector where some scripts will have customisation options to place objects and things. what am i doing wrong? why can't i just build what i need and move to the next part?

Show more comments

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Best weapon system for multiplayer FPS? 0 Answers

How to make weapon match walking animation (2D)? 0 Answers

creating holes in a ship 0 Answers

Cannon2d rotation control and ball shooting 0 Answers

Shoot mortar on clicked floor 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges