unity rotate object c#
C#
using UnityEngine;// Transform.Rotate example
//
// This script creates two different cubes: one red which is rotated using Space.Self; one green which is rotated using Space.World.
// Add it onto any GameObject in a scene and hit play to see it run. The rotation is controlled using xAngle, yAngle and zAngle, modifiable on the inspector.public class ExampleScript : MonoBehaviour
{
public float xAngle, yAngle, zAngle; private GameObject cube1, cube2; void Awake()
{
cube1 = GameObject.CreatePrimitive(PrimitiveType.Cube);
cube1.transform.position = new Vector3(0.75f, 0.0f, 0.0f);
cube1.transform.Rotate(90.0f, 0.0f, 0.0f, Space.Self);
cube1.GetComponent<Renderer>().material.color = Color.red;
cube1.name = "Self"; cube2 = GameObject.CreatePrimitive(PrimitiveType.Cube);
cube2.transform.position = new Vector3(-0.75f, 0.0f, 0.0f);
cube2.transform.Rotate(90.0f, 0.0f, 0.0f, Space.World);
cube2.GetComponent<Renderer>().material.color = Color.green;
cube2.name = "World";
} void Update()
{
cube1.transform.Rotate(xAngle, yAngle, zAngle, Space.Self);
cube2.transform.Rotate(xAngle, yAngle, zAngle, Space.World);
}
}
Also in C#:
- Title
- c# winform remove button border
- Category
- C#
- Title
- C# Into To Tring Debug.Log
- Category
- C#
- Title
- 2d object look at object
- Category
- C#
- Title
- use newtonsoft json to clone object
- Category
- C#
- Title
- unity image
- Category
- C#
- Title
- open link c#
- Category
- C#
- Title
- c# get last character of string
- Category
- C#
- Title
- declare string array c# without size
- Category
- C#
- Title
- never lose focus textbox c#
- Category
- C#
- Title
- c# move with arrow keys
- Category
- C#
- Title
- c# change label forecolor code
- Category
- C#
- Title
- get random point within radius
- Category
- C#
- Title
- landscape print gridcontrol devexpress
- Category
- C#
- Title
- c# create dynamic object
- Category
- C#
- Title
- unity monobehaviour
- Category
- C#
- Title
- eventos c#
- Category
- C#
- Title
- asking for user input integer c#
- Category
- C#
- Title
- C# for
- Category
- C#
- Title
- wpf make size fill all grid
- Category
- C#
- Title
- unity get velocity at point
- Category
- C#
- Title
- fly cam extended script unity 3d
- Category
- C#
- Title
- docker ssh
- Category
- C#
- Title
- unity making homing missile
- Category
- C#
- Title
- unity pro version free download
- Category
- C#
- Title
- string to guid c#
- Category
- C#
- Title
- how to start an if statement in c#
- Category
- C#
- Title
- unity rotate object relative to camera
- Category
- C#
- Title
- snake game
- Category
- C#
- Title
- to list c#
- Category
- C#
- Title
- json serialize object capitalization config
- Category
- C#
- Title
- how to redirect to extern page in .net core
- Category
- C#
- Title
- C# get all files in directory
- Category
- C#
- Title
- decimal to string whole number c#
- Category
- C#
- Title
- C# array index tostring
- Category
- C#
- Title
- c# split a string and return list
- Category
- C#
- Title
- how to select time and date in datetimepicker in c#
- Category
- C#
- Title
- reference to gameobject in different scene unity
- Category
- C#
- Title
- convert comma separated string to array c#
- Category
- C#
- Title
- unity 2d enemy field of view
- Category
- C#
- Title
- c# list tuple
- Category
- C#
- Title
- how to find object by ag unity
- Category
- C#
- Title
- c# using get set methods
- Category
- C#
- Title
- c# quaternion eular calculator
- Category
- C#
- Title
- c# one line set
- Category
- C#
- Title
- unity how to change rotation
- Category
- C#
- Title
- C# colours
- Category
- C#
- Title
- change textbox location C#
- Category
- C#
- Title
- c# return multiple value unity
- Category
- C#
- Title
- unity if gameobject exists
- Category
- C#
- Title
- devexpress objectspace to session
- Category
- C#
- Title
- how to add array to list in c#
- Category
- C#
- Title
- c sharp add item to dictionary
- Category
- C#
- Title
- create object in c#
- Category
- C#
- Title
- unity how to get transform scale
- Category
- C#
- Title
- c# foreach arra
- Category
- C#
- Title
- how do i foreach c#
- Category
- C#
- Title
- No context type was found in the assembly
- Category
- C#
- Title
- viewBag as a list
- Category
- C#
- Title
- how to set progress openedge driver name for odbc connection c#
- Category
- C#
- Title
- how to detected WindowCloseEvent in other window wpf
- Category
- C#
- Title
- open udp socket c#
- Category
- C#
- Title
- get user directory of file in c#
- Category
- C#
- Title
- ecs get specific entities with component
- Category
- C#
- Title
- c sharp exit while loop
- Category
- C#
- Title
- c# convert byte to char
- Category
- C#
- Title
- c# random number between 0 and 1
- Category
- C#
- Title
- ping with c#
- Category
- C#
- Title
- c# reverse list
- Category
- C#
- Title
- start a particle effect when a button is pushed
- Category
- C#
- Title
- bytes size c#
- Category
- C#
- Title
- instantiate object in circle
- Category
- C#
- Title
- how to flip selection in aseprite
- Category
- C#
- Title
- enums as numbers c#
- Category
- C#
- Title
- unity requirecomponent
- Category
- C#
- Title
- c# property get set
- Category
- C#
- Title
- c# duplicate object instance
- Category
- C#
- Title
- how to say or in c#
- Category
- C#
- Title
- c# auto property set default value
- Category
- C#
- Title
- c# while loop
- Category
- C#
- Title
- c# ^ operator
- Category
- C#
- Title
- unity scene name get
- Category
- C#
- Title
- Move player on planets in unity 2d
- Category
- C#
- Title
- random from list c#
- Category
- C#
- Title
- c# tostring mmm dd yyyy
- Category
- C#
- Title
- how to get joypad axis input unity
- Category
- C#
- Title
- c# convert column name to number
- Category
- C#
- Title
- c# stringbuilder
- Category
- C#
- Title
- c# char array to string
- Category
- C#
- Title
- set object to random color unity
- Category
- C#
- Title
- c# pull request
- Category
- C#
- Title
- get day month year from date c#
- Category
- C#
- Title
- c# index in select
- Category
- C#
- Title
- sort c#
- Category
- C#
- Title
- lista generica como parametro de un metodo en c#
- Category
- C#
- Title
- unity simple fps controller
- Category
- C#
- Title
- how to check if textbox is empty in c#
- Category
- C#
- Title
- check if enabled unity
- Category
- C#
- Title
- unity how to change max fps
- Category
- C#
- Title
- unity how to get y value
- Category
- C#
- Title
- c# windows application get current path
- Category
- C#