Question: i need the output Example code of Find Object using System.Collections; using System.Collections.Generic; using UnityEngine; public class Mouse : MonoBehaviour { // Use this for


Example code of Find Object using System.Collections; using System.Collections.Generic; using UnityEngine; public class Mouse : MonoBehaviour \{ // Use this for initialization //Light lightComponent; public Game0bject target; void Start () \{ // A variable to store the light component. target = Game0bject. Find( "Cube"); \} // Update is called once per frame void Update () \{ target.transform. Translate (.05f,0f,0f); target.transform. Rotate( 0f,0f,1f); target. transform. LocalScale = new Vector 3(1.5f,1.5f,1.5f); \} void Start() \{ \} // Update is called once per frame void Update() \{ Ray ray = new Ray(transform. position, Vector3.down); if (Physics.Raycast(ray, 10)) \{ Debug. DrawRay (ray . origin, ray.direction * 10); Vector 3 forceAmount = new Vector3(,20,); rb. AddForce(forceAmount); \} \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
