Created
October 4, 2020 15:41
-
-
Save vallentiin/730187c5801bf63c9a82a33bac078938 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class FauxGravityBodys : MonoBehaviour | |
{ | |
public FauxGravityAttractor attractor; | |
private Transform myTransform; | |
Rigidbody rb; | |
void Start() | |
{ | |
rb = GetComponent<Rigidbody>(); | |
rb.constraints = RigidbodyConstraints.FreezeRotation; | |
rb.useGravity = false; | |
myTransform = transform; | |
} | |
void Update() | |
{ | |
attractor.Attract(myTransform); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment