transform Vector3 help!

I need help how to do this logic on code

Vector3 myPosition;

myPosition = “Vector3 of this object”?

Vector3 myPosition;

myPosition = transform.position;

You can call and use an objects position, rotation, scale(and much more) by referring the transform of an object.

using UnityEngine;

using System.Collections;

public class example : MonoBehaviour {

public Vector3 p;

void Awake() {

p[0] = 5;


Access the x, y, z components using [0], [1], [2] respectively.

I use javaScript but this should work fine.