• 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 progres · Sep 05, 2016 at 04:17 AM · shootfirethrowwizardflame

Firing flame balls with animation and particles

I'm a beginner in unity and in programming the C#. I have a wizard with a moving script and a camera rotation script And i don't know how to make him shoot a flame balls that explode with animation I already have the animation but don't know how to write a script for firing the flame ball and playing the animation . If anyone can help me ,please answer the question.

Comment
Add comment · Show 2
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 Bigiansen · Sep 05, 2016 at 06:51 AM 0
Share

If you're a beginner you should probably try to go for simpler stuff. If you're still interested, look for info on trigger colliders, OnTriggerEnter, Particle Systems and Rigidbodies. Also you should familiarize yourself with most common Unity components.

avatar image Bigiansen · Sep 05, 2016 at 06:53 AM 0
Share

Also you should probably start with 2D stuff, since 3D is quite more complicated.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by sparkinfo · Sep 05, 2016 at 09:29 AM

you need to create a particle system using the particle system gameobject that will look like your flame ball. then you make it a prefab and use Instantiate function to make it appear ingame. then you can make that instantiate trigger on any desired input like when you press the shoot key.

Comment
Add comment · Share
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
0

Answer by Benjames · Sep 06, 2016 at 04:12 AM

Yeah under a tab in the particle system there is an option for animated particles the animation has to be an animation strip. There are many ways to simulate a fireball, you don't have to start with simpler stuff and you don't have to start with 2D.

If you wanted to code the animation onto a plane or other 3d object you could make a public Texture2D[] array or List<>() add single images of the animation to the list. Then on void Update you could write something like gameObject.GetComponent.material.maintexture=texturearray[slot]; slot++; if(slot>texturearray.Count-1){ slot=0; } but dont actually use GetComponent every frame like that it's slow lol get the renderer at start frame and store it in a variable or better yet make a public Renderer variable and drag and drop it in your editor.

Comment
Add comment · Share
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

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How could I shoot a chemical in a fire extinguisher? 1 Answer

How do I make a player shoot right and left 2D platformer firing left and right, help! 1 Answer

how do I shoot where my cross hair points? 0 Answers

Need Shooting C# script help 2 Answers

Last time cannonball fire physics. 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges