- Home /
please help me with my script
I am making a golf game and My code is not working im trying to make it so when the ball touches level_change (a empty game object) level 2 lodads Im geting "self" is not a member of unity.touch and can not convert UnityEngien.Qutianian to unityEngien.Transform so here is my code : var bullet : Transform; var self : Transform; self = Quaternion.identity;
function update (){
if (Touch.self){ Application.LoadLevel(2); }
}
So you are saying is that if that ball touches an object, it will change into a new level?
Answer by MountDoomTeam · Nov 18, 2012 at 03:20 AM
you can't do self : transform and self = quaternion identity.
you have to look on the quaternion identity page:
transform.rotation = Quaternion.identity;
it's a rotation parameter, not a transform parameter. so that's teh error message.
it's recommended that you format your question code properly, and copy the error message text to clipboard from the bottom of the debug log when you highlight it to get it faster than typing it and paste it on question.
Your answer
Follow this Question
Related Questions
How to add a script to a object in unity 1 Answer
Shot Gun Script? And can I make the graphics retro? Need Help Please. 0 Answers
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