Collision Won't Work!!
I'm currently working on a team working on a 2D rogue-like dungeon game and I need help with the movement script. The Player moves fine but he ignores the collider I have for him. Here is my Script: { [SerializeField] %|171932097_2|% void Update() { float horizontal = 0; //Used to store the horizontal move direction. float vertical = 0; //Used to store the vertical move direction. //Get input from the input manager, round it to an integer and store in horizontal to set x axis move direction horizontal = (int)(Input.GetAxisRaw("Horizontal")); //Get input from the input manager, round it to an integer and store in vertical to set y axis move direction %|-1266208280_10|% //Check if moving horizontally, if so set vertical to zero. if (horizontal != 0) %|1884962521_13|% vertical = 0; %|-1117646614_15|% %|945500248_16|% if (vertical != 0) { %|915160176_19|% } var move = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0); %|1153318485_22|% } }
Your answer
Follow this Question
Related Questions
How to move an object on a terrain that will always stay on top of the terrain? 2 Answers
My health potion worked and now it doesn't. 1 Answer
GameObject not destroying on Collision 1 Answer
Restrict held object movement 0 Answers
Jitter with Tilemap Collider's but no Jitter on standard Box Collider 1 Answer