- Home /
Question by
jimpy · Jul 16, 2020 at 10:00 AM ·
unity 2dcrosshairpixel arttop down shooter
Pixel perfect crosshair.
I am making a top down shooter game and I was wondering if there was a way to move the crosshair smoothly while still having pixel perfect movement. I am using the pixel perfect camera component.
Comment
Answer by WildHunt777 · Jul 16, 2020 at 01:43 PM
This script drag onto your UI cursor in Canvas.
using UnityEngine;
public class Crosshair : MonoBehaviour
{
void Start()
{
Cursor.visible = false;
}
void Update()
{
transform.position = Input.mousePosition;
}
}
Your answer
Follow this Question
Related Questions
Pixel art is jittery while moving camera. 2 Answers
,Trying to flip a sprite to the left from the right side with a mouse 0 Answers
Unity 2D URP No Tilemap Shadows 2 Answers
2D Top Down Shooting Problem 1 Answer
Make the bullet in a 2d Top Down shooter get destroyed after passing mouse position 2 Answers