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 Azerial · May 04, 2011 at 01:40 PM · camerajavascriptchangelerpz

Lerpz tutorial cut scene

Just finishing up the Lerpz tutorial, but neither cutscenecamera1 or cutscencecamera2 will activate. All the rest of the sounds and motions work. I've gone over all the scripting, but can't seem to find the error in the LevelStatus script or the ThirdPersonStatus script. Any ideas I'll post the LevelStatus script since it's the one that effects them to see if anyone can see an error I passed over. //// LevelStatus: Master level state machine script. var exitGateway : GameObject; var levelGoal : GameObject; var unlockedSound : AudioClip; var levelCompleteSound : AudioClip; var mainCamera : GameObject; var unlockedCamera : GameObject; var levelCompleteCamera : GameObject;

// This is where info like the number of items the player must collect in order to complete the level lives.

var itemsNeeded: int = 20; // This is how many fuel canisters the player must collect.

private var playerLink : GameObject;

// Awake(): Called by Unity when the script has loaded. // We use this function to initialise our link to the Lerpz GameObject. function Awake() { levelGoal.GetComponent(MeshCollider).isTrigger = false; playerLink = GameObject.Find("Player"); if(!playerLink) Debug.Log("Could not get link to Lerpz"); levelGoal.GetComponent(MeshCollider).isTrigger = false; }

function UnlockLevelExit() { mainCamera.GetComponent(AudioListener).enabled = false; unlockedCamera.active = true; unlockedCamera.GetComponent(AudioListener).enabled = true; exitGateway.GetComponent(AudioSource).Stop();

if(unlockedSound) { AudioSource.PlayClipAtPoint(unlockedSound, unlockedCamera.GetComponent(Transform).position, 2.0); }

yield WaitForSeconds(1); exitGateway.active = false; yield WaitForSeconds(0.2); exitGateway.active = true; yield WaitForSeconds(0.2); exitGateway.active = false; levelGoal.GetComponent(MeshCollider).isTrigger = true; yield WaitForSeconds(4);

unlockedCamera.active = false; unlockedCamera.GetComponent(AudioListener).enabled = false; mainCamera.GetComponent(AudioListener).enabled = true;

}

function LevelCompleted() {

mainCamera.GetComponent(AudioListener).enabled = false; levelCompleteCamera.active = true; levelCompleteCamera.GetComponent(AudioListener).enabled = true; playerLink.GetComponent(ThirdPersonController).SendMessage("HidePlayer"); playerLink.transform.position+=Vector3.up*500.0;

if(levelCompleteSound) { AudioSource.PlayClipAtPoint(levelCompleteSound, levelGoal.transform.position, 2.0); } levelGoal.animation.Play(); yield WaitForSeconds(levelGoal.animation.clip.length); Application.LoadLevel("GameOver");

}

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 GesterX · May 04, 2011 at 01:55 PM 0
Share

Can you highlight all of your code and press the code button and make sure it's all in "code boxes" in the preview. It's almost impossible to read without this.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by mlemay · Sep 02, 2011 at 02:19 AM

Better late than never? I was having the same problem. I'd deactivated the camera in the inspector, rather than the game object to which the camera refers. I.e., in the inspector I have "CutSceneCamera1;" there's a checkbox next to that. Turn it off rather than the checkbox next to "Camera" below.

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
avatar image
0

Answer by Dajo · Mar 03, 2013 at 04:28 AM

Also make sure the activeFence audio is attached to the impound fence. the code wont work is no audio is attached.

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

throwing a ball camera position changes 0 Answers

3D Text - How to change colour - Doesn't seem to work 2 Answers

Main Camera Stops working or just freezes? 0 Answers

I want a HitMark(GUI) system like in Crysis-CoD that indicates where i am hit from and also a Camera/Screen shake effect 3 Answers

How to keep FPS Camera from flipping? 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