Getting a Gameobjects position

Afternoon Unity people,

Ok i have been trawling through help and support pages trying the find the answer to this but im an amateur scritper and I may have seen the answer i need on all of the support pages. Though I dont really have the skill to identify its or adjust it to my current situation.

What im looking for:

When an object with this script collides with another object i need it to get that objects postion and store it as a variable. I have looked into Vector3 and transform but as I said im not 100% sure of how to implement it.

Thanks for the help in advance

Terry

The property you’re looking for is Transform.position, which can be accessed via the ‘transform’ property that all game objects and components have.

As for detecting a collision and acting on it, you can use OnCollisionEnter() or OnTriggerEnter().

Cheers :slight_smile: