Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 epicVoodoo · Jan 04, 2015 at 05:09 PM · animationanimation eventsspell

Can't make Spell structure and Animation with it

Hi! I'm making a spell system and i've already made certain part of it (recieving data from db of each spell class). Now my task is to connect these spells with player and make them usable (in network also).

1) Spell Interface class (attached to player): (also have classes "s"+id (s1, s2, s3))

     void OnGUI()
     {
         if (GUI.Button(new Rect(Screen.width / 6, Screen.height / 1.1f, 120, 40), "FIREBALL"))
         {
             CreateSpell(1, this.gameObject, this.gameObject.GetComponent<Player>()._target);
         }
     }
 
     void CreateSpell(int id, GameObject _caster, GameObject _victim)
     {
         createdSpell = GameObject.Instantiate(Resources.Load("Spells/s" + id) as GameObject, _caster.transform.position, _caster.transform.rotation) as GameObject;
 
         object s = System.Activator.CreateInstance(Type.GetType("s" + id));
         s.GetType().GetField("caster").SetValue(s, _caster);
         s.GetType().GetField("victim").SetValue(s, _victim);
     }

2) Then spell prefab whith certain script attached is being created.

My task is to add the animations in order to use anim event to instantiate particles or determine the moment when damage is being given. This requires changing my spell structure 'cause methods for animation event are taken from my player's functions, where THERE IS NOT CURRENT SPELL SCRIPT ATTACHED, it attached on this spell's prefab.

So help me please to make up the spell structure using animation events!

Comment
Add comment · Show 1
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 Graham-Dunnett ♦♦ · Jan 04, 2015 at 05:09 PM 0
Share

No-one is going to write your script for you.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Mmmpies · Jan 04, 2015 at 05:40 PM

@GrahamDunnett is right no one will write your code for you however I stumbled across this months ago on YouTube.

SpellMaker

A unity project is attached to that page, it might not be exactly what you want but as an example of what's possible it's pretty impressive.

Oh and as ever, virus scan that attachment, I did and it was fine but it's been on the Internet so always virus scan when you download.

If it helps give them some feedback as well, they were good enough to share it.

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.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Animation events get lost 1 Answer

How to detect if player hits enemy half-way into an animation? 0 Answers

Can the animation editor create local rotational data? 3 Answers

Animator question: need to play animation ONLY if current animation is at a particular frame 1 Answer

Adding animation clips via script 2 Answers


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