- Create a game object
- Add PyBehaviour
- Drag your python file into script field
- Play the game
Hello word from Awake and Update functions in python:
import UnityEngine as unity
count = 1
def Awake():
unity.Debug.Log("Hello from python Awake " +
gameObject.name + str(count))
def Update():
global count
count += 1
unity.Debug.Log("Hello from python Update" + str(count))
Simple object rotator:
import UnityEngine as unity
def Update():
transform.Rotate(1, 1, 1)
- PC: supprted
- Mobile: not-supported