

More info See in Glossary, the GameObject updates its rotation so that it looks at the target point in world space. Now if you move the GameObject in the Editor, or change the values of “Look At Point” in the Inspector A Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. To do this, add the ExecuteInEditMode attribute to the class, like this: //C# Example (LookAtPoint.cs) More info See in Glossary, it’s often useful to make certain scripts execute during Edit mode, while your application is not running. When writing Editor scripts A piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. When you enter Play mode, the GameObject that you attached the script to now orientates itself towards the coordinates you set to the “Look At Point” property. Public Vector3 lookAtPoint = Vector3.zero In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces.


Think of each unique Scene file as a unique level. Attach the script to a GameObject in your Scene A Scene contains the environments and menus of your game.Open the script and replace its contents with the code below.Create a C# script and name it "“LookAtPoint”.More info See in Glossary always look at a point. A GameObject’s functionality is defined by the Components attached to it. This page shows you how to create a simple script to make GameObjects The fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. To speed up application development, create custom editors for components you commonly use.
