Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

'UnityEngine.Component.GetComponent' is not a generic definition.

$
0
0
#pragma strict // ping-pong animate background color public var color1 = Color.red; public var color2 = Color.blue; public var duration = 3.0F; var camera; function Start() { camera = GetComponent.; camera.clearFlags = CameraClearFlags.SolidColor; } function Update() { var t = Mathf.PingPong(Time.time, duration) / duration; camera.backgroundColor = Color.Lerp(color1, color2, t); } I copied this from the help. But I get an error on line 8 When I change: camera = GetComponent.; to camera = GetComponent.() Then I get: Assets/flashjs.js(9,9): BCE0004: Ambiguous reference 'camera': flashjs.camera, UnityEngine.Component.camera.

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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