- Home /
How to turn two scripts on/off with a button
Ok so i've been messing with examples from other people on how to turn a script off/on with javascript. Ive ran into a bunch of problems. I want to have an if statement look like this
if(Input.GetKeyUp(KeyCode.Q))
{
animation.Play("3dview");
player.GetComponent(playerMovement3d).enabled = true;
}
else{
player.GetComponent(playerMovement3d).enabled = false;
}
So what i want in the end result is to have the animation play which is played by pressing (q) (which works) and when it plays turn on the 3d playerMovement script and turn off the 2d playerMovement script. Once that works i also want to camera animation to play only one time until you press (e) which turns back to 2d. Please help me!!!!
Answer by Julien-Lynge · Jun 17, 2013 at 05:52 PM
Your post (as it appears now) isn't something we can give you a quick answer for, and isn't really appropriate for UnityAnswers. The UnityAnswers philosophy is:
"[Unity Answers] is a place to ask specific questions that have specific answers. The forum is a better place to post discussions and non-technical questions."
It sounds like what you're looking for is Unity training, rather than a specific answer. I would suggest visiting the following training websites to find the one that best helps you move forward. In addition to the sites below, you can always search YouTube, which has a large number of user-created Unity tutorials.
3DBuzz (hover over the Unity dropdown) - http://www.3dbuzz.com/vbforum/sv_home.php
Lynda - https://www.lynda.com/
BurgZergArcade - http://www.burgzergarcade.com/
Unity3DStudent - http://www.unity3dstudent.com/
UnityGems - http://unitygems.com/
CGCookie - http://cgcookie.com/unity/
Your answer
Follow this Question
Related Questions
Camera movement(I have no clue how to code) 0 Answers
How do i on the y axis my camera from moving? 0 Answers
rotate Y axis to face mouse 1 Answer
Connection between 2 scripts 1 Answer
Set Max Rotation On Weapon Sway 0 Answers