Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

How To Get The Global Position of a GameObject in a Variable

// for unity users only!

// use transform instead of GetComponent<Transform>

void Start()
{
  Vector3 LocalPosition = gameObject.GetComponent<Transform>().position;
  Vector3 GloabalPosition = gameObject.transform.position;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: maxheap c# 
Csharp :: bower azure repository tag 
Csharp :: unity check if audio playing 
Csharp :: c# check if string is directory 
Csharp :: c# memorystream to byte array 
Csharp :: enable canvas unity 
Csharp :: unity input.getkeyup not working 
Csharp :: c# convert int to pretty string 
Csharp :: how to draw a rectangle in monogame 
Csharp :: double tryparse dot comma 
Csharp :: aabb collision with direction 
Csharp :: base64 string to byte array c# 
Csharp :: How can I cast string to enum? 
Csharp :: how to make a for loop in c# 
Csharp :: c# get bits from float 
Csharp :: how to center text in console application 
Csharp :: data table rename column c# 
Csharp :: time.timescale 
Csharp :: unity lock cursor to center 
Csharp :: c# console play sound 
Csharp :: net use delete 
Csharp :: C# datetime.now to string only numbers 
Csharp :: group by linq multiple columns c# 
Csharp :: How to search for a string from readline in c# 
Csharp :: how to pause physics in unity c# 
Csharp :: unity how to stop the game 
Csharp :: c# update value in a json file 
Csharp :: c# how many lines in methods 
Csharp :: print random number unity 
Csharp :: unity chat system 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =