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 brycep98 · Feb 11, 2012 at 06:49 AM · fireballtornadotwins

Tornado Twins level 5 fireball

I followed the coding exactly and it still will not work. Please help.

var speed = 10.0; var rotateSpeed = 3.0; var bullitPrefab:Transform;

function Update () { var controller : CharacterController = GetComponent(CharacterController); //Rotate around y - axis transform.Rotate(0,Input.GetAxis ("Horizontal") * rotateSpeed, 0);

//Move forward/backward var forward: Vector3 = transform.TransformDirection(Vector3.forward); var curSpeed : float = speed*Input.GetAxis("Vertical"); controller.SimpleMove(forward*curSpeed);

if(Input.GetButtonDown("Jump")); { var bullit = Instantiate(bullitprefab,transform.find("SpawnPoint").transform.position ,Quaternion.identity); }

}

@script RequireComponent (CharacterController)

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 fafase · Feb 11, 2012 at 11:45 AM 1
Share

One word about the Tornado Twins' tutorials, I have been through 2 of their tutorials including one that they actually sell. If they are good for starting (the tutorials) they are also dangerous as some of their codes miraculously work on the video but when you try them on your project they go weird or return unexpected values. Also, they often get satisfied of their work clai$$anonymous$$g "That works nicely!!" while you clearly see something wrong. To be used carefully.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by DavidDebnar · Feb 11, 2012 at 11:31 AM

Here is the modified code, it should work properly, just make sure that you have a fireball prefab dragged onto the bullitPrefab variable and that you have a empty gameObject called SpawnPointer parented to the player/worm. And make sure that you use GameObject.Find instead of transform.find, or make a variable

 var spawn : Transform;

and use it as

 var bullit = Instantiate(bullitprefab, spawn.transform.position, Quaternion.identity);

In te if statement at the end and it should work.

 var speed = 10.0; 
 var rotateSpeed = 3.0; 
 var bullitPrefab : Transform;
 var controller : CharacterController;
 
 function Start () {
     controller = GetComponent(CharacterController); 
 }
 
 function Update () { 
     transform.Rotate(0,Input.GetAxis ("Horizontal") * rotateSpeed, 0);
 
     var forward: Vector3 = transform.TransformDirection(Vector3.forward); 
     var curSpeed : float = speed*Input.GetAxis("Vertical"); 
     controller.SimpleMove(forward*curSpeed);
 
     if(Input.GetButtonDown("Jump"))
     {
         var bullit = Instantiate(bullitprefab, GameObject.Find("SpawnPoint").transform.position, Quaternion.identity); 
     }
 }
 @script RequireComponent (CharacterController)

  • David

Comment
Add comment · Show 2 · 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 brycep98 · Feb 12, 2012 at 03:41 AM 0
Share

It still wont work. the errors are

unexpected token:var and ';' expected. Insert a semicolon at the end.

avatar image DavidDebnar · Feb 15, 2012 at 05:18 PM 0
Share

Which line? There was an error at the end of the if statement.

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

6 People are following this question.

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

Related Questions

please help me!!!!!!!!!!!!!!!!!!!! 2 Answers

How to convert joystick position to rotation? 0 Answers

How to make network player lose health after being hit by rigidbody? 1 Answer

Roll-A-Ball tutorial help. 0 Answers

Create Fireball with fire effect 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