public bool useGravity ;

Descripción

Controla si la gravedad afecta este rigidbody.

Si se establece a false, el rigidbody se comportará como el espacio.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Collider coll;

void Start() { coll = GetComponent<Collider>(); coll.isTrigger = true; }

// Disables gravity on all rigidbodies entering this collider. void OnTriggerEnter(Collider other) { if (other.attachedRigidbody) other.attachedRigidbody.useGravity = false; } }