- Home /
Question by
Erhan · Nov 27, 2010 at 02:50 PM ·
collisionfpscollisiondetection
FPS Character Controller collisions detection
Hello, I have a problem with FPS Character Controller collisions detection. I'm using this script for a Jump pad object:
using UnityEngine; using System.Collections;
public class TriggeredJump : MonoBehaviour {
public Rigidbody player;
public float fForce;
void OnTriggerEnter(Collider other)
{
other.rigidbody.AddForce(Vector3.up * fForce);
print("Collision");
}
}
I added a rigidbody to my player Controller to apply the AddForce, but it doesn't work. For other game object it works fine, for example for a sphere I created.
Any ideas that can help me? :-) Thanks, Erhan
Comment
Answer by IJM · Nov 28, 2010 at 12:17 PM
Try something like this:
gameObject.GetComponent<Rigidbody>().AddForce(Vector3.up * fForce);
Your answer
Follow this Question
Related Questions
Understanding if an object is inside of another 1 Answer
Quick question about colliders 1 Answer
How to check Hypothetical Collisions in 2D 1 Answer
Collision in code 1 Answer