Quantcast
Viewing latest article 21
Browse Latest Browse All 90

Answer by Kleptomaniac

Nobody here is giving you a clear answer. I would set out your script like so: #pragma strict var topdownCam : GameObject; private var cameraFollow: CameraFollow; private var planeSelfMove: PlaneSelfMove; function Start () { cameraFollow = topdownCam.GetComponent(CameraFollow); planeSelfMove = GetComponent(PlaneSelfMove); } function OnTriggerEnter (collider : Collider) { if (collider.game object.tag == "SpawntriggerStopCamera") { cameraFollow.enabled = false; planeSelfMove.enabled = false; } } I declared the script component references so that it wouldn't slow your code each time when creating a new component reference. :) Hope that helps, Klep _________ EDIT: Now all you have to do is assign your TopCameraCollision object to the topdownCam variable in the Inspector, and you're good to go! :)

Viewing latest article 21
Browse Latest Browse All 90

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>