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 NanoPaladin · Mar 08, 2015 at 12:11 PM · parsing error

Parsing Error(newObjRight)

So I was coding a multishot projectile in the form of a 2d missile. Ideally I want two missiles side by side to fire forward on the plane. I have not yet saved the code because I noticed there would be a parsing error (newObjRight and +=). I would like to know if anyone has any ideas on how to solve this. Also I believe the error is only in the Projectile2 script and not anywhere else. Thanks ahead of time!

 using UnityEngine;
 using System.Collections;
 
 public class Projectile2 : MonoBehaviour {
     
     // Used to control how fast the game object moves
     public float MoveSpeed = 7.0f;
     
     // Use this for initialization
     void Start () {
 
     }
     
     // Update is called once per frame
     void Update () {
         transform.position += 
             transform.up * Time.deltaTime * MoveSpeed;
         
     }
 
     public void FireMultiShotSideBySide();
     {
         //Right
         Projectile2 newObjRight = Instantiate (Projectile2, transform.position, transform.rotation) as Projectile2
         newObjRight.transform.position += newObjRight.transorm.right * 1.0f
 
         //Left
         Projectile2 newObjLeft = Instantiate (Projectile2, transform.position, transform.rotation) as Projectile2
         newObjLeft.transform.position += newObjLeft.transorm.left * 1.0f
     }
 }
 

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Mmmpies · Mar 08, 2015 at 02:27 PM

Where do I start :¬)

You've got a semi colon at the end of line 21 which is wrong, no semi colon at the end of 24, 25, 28 and 29. You misspelled transform on line 25 and 29.

Pretty sure you should have a

 public GameObject projectile2; // NOTE LOWERCASE P

at the top and change

 Instantiate (Projectile2,

to

 Instantiate (projectile2,

and change the other references to Projectile2 to the word GameObject.

Other than that transform.left doesn't exist but you could try just using transform.right with -= instead of +=

PS not getting email notifications so will not get notified if you comment but will try and look in on this in a few hours.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Unity stealth tutorial script problem 1 Answer

I need help with a max.x parser error -2 Answers

Parsing Error 2 Answers

Messed up script 0 Answers

Keystore causes parsing error 0 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