using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class objectInvert : MonoBehaviour {

	public bool isInverted = false;
	public float GravityMultiplier = 1.0f;

	private float gravitySign;
	private Rigidbody m_RigidBody;

	// Use this for initialization
	void Start () {
		m_RigidBody = GetComponent<Rigidbody>();
		gravitySign = isInverted ? 1.0f : -1.0f;
		m_RigidBody.useGravity = false;
	}
	
	// Update is called once per frame
	void FixedUpdate () {
		m_RigidBody.AddForce(-Physics.gravity * GravityMultiplier * gravitySign);
	}
}
