You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
385 B

  1. using UnityEngine;
  2. using System.Collections;
  3. public class centerOfMass : MonoBehaviour {
  4. public GameObject marker;
  5. public Rigidbody2D rigid;
  6. // Use this for initialization
  7. void Start () {
  8. }
  9. // Update is called once per frame
  10. void Update () {
  11. Vector3 temp = rigid.worldCenterOfMass;
  12. temp.z-= 0.2f;
  13. marker.transform.position = temp;
  14. }
  15. }