Why My BoxCollider2D elements don't work?
Hi Folks! Sorry for my bad english, i'm italian! I got a big issue. I'm developing a 2D Game in C# where i just moove my player by mouse. I have a player game object and a background. Both of them have a not triggered box collider2D, But i can't undestand why the boxcolliders don't work! the player is able to pass through the boxcollider put on the background. How is it possible?!!? Important: My BoxColliders are NOT Triggered
I post here part of the script attached to my player gameobject to move it. Please, can you help me posting some code? My english it's not so good to understand eglish written explanations, sorry :(
Thanks a lot to anybody who will help me :-)
void OnMouseDrag()
{
float x = Input.GetAxisRaw ("Mouse X");
float y = Input.GetAxisRaw ("Mouse Y");
Vector3 point = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x,Input.mousePosition.y, -1));
transform.position = point;
}
Your answer
Follow this Question
Related Questions
Make object move back and forth 2 Answers
Transform.find problem 1 Answer
How to call a function every second ? 1 Answer
Is there a transform method equivalent to assigning euler angle offsets? 1 Answer
Weird rotation when using Slerp!!? 3 Answers