• 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 difd 9999 · Nov 21, 2012 at 06:02 PM · java

java script problems

i am making a game and i am having scripting problems i want to make it so when var bullet is touching var self level 2 loads my problem is:

Assets/scripts/touch.js(3,18): BCE0022: Cannot convert 'UnityEngine.Quaternion' to 'UnityEngine.Transform'.

my code is:

var bullet : Transform;

var self : Transform;

self = transform.rotation;

transform.rotation = Quaternion.identity;

function update (){

if (self){ Application.LoadLevel(2); }

}

//please post a full script

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
Best Answer

Answer by Steve Steven · Nov 21, 2012 at 07:47 PM

put the

`transform.rotation = Quaternion.identity`

in any function. In Update, Start or Awake

Comment
Add comment · Show 6 · 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 difd 9999 · Nov 25, 2012 at 03:19 PM 0
Share

Thanks but next time please post a full script

avatar image Frix · Nov 25, 2012 at 03:24 PM 1
Share

He gave you enough information for you to do it yourself. He practically did it for you. difd, you're not going to learn if you don't play around with stuff, so have a go yourself first. It's the easiest way to learn.

Oh and next time don't post two threads exactly the same.

avatar image difd 9999 · Nov 25, 2012 at 03:27 PM 0
Share

Yah most of the time I do that cause one doesn't work but I think I'll start to wait

avatar image Frix · Nov 25, 2012 at 03:29 PM 0
Share

One more thing: make your titles more specific. Describe the problem in the title if you can, and don't have something vague. So far all of your titles have been really vague and don't say anything about the problem at all

avatar image difd 9999 · Nov 25, 2012 at 03:30 PM 1
Share

I get that a lot ill try

Show more comments

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

11 People are following this question.

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

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

How do i make a Video Intro at the start of a game using Java Scripting? 2 Answers

Java for android script help??? 0 Answers

A general script variable 3 Answers

How to add a script to a object in unity 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