- Home /
Collider not floolowing my character
Hi there im making character sliding everytime I press right click. The problem is that my collider dont follow my character movement. What can I do ?
Here is my script of slide :
using UnityEngine; using System.Collections;
public class slide : MonoBehaviour { public float speed = 90.0f; public bool slideMove = false; public bool grounded = true;
void Update ()
{
if(grounded && Input.GetMouseButtonDown(1))
{
slideInit();
}
if(!grounded && Input.GetMouseButtonUp(1))
{
slideExit();
}
}
void slideInit()
{
transform.Rotate( new Vector3 (-90.0f, 0, 0) );
grounded = false;
}
void slideExit()
{
transform.Rotate( new Vector3 (90.0f, 0, 0) );
grounded = true;
}
}
Answer by Berenger · Feb 22, 2012 at 10:43 PM
The collider component must be on the game object being moved or on one its the children. Is that your case ?
Yes my gameobject is on my character ( the Unity constrictor dude ) and I dont have access to manipulate the collider.
Your answer
Follow this Question
Related Questions
Simple character rotation 1 Answer
How do you make 4 sided Doom like directional sprites? 2 Answers
Help with rotating my collider and ray origins 0 Answers
Can't rotate character in horizontal axis. 2 Answers
Turning character with transform.Rotate 0 Answers