What do you want to save?
Add Code snippet
New code examples
-
Other 2022-01-30 11:30:22
Raycasting to find mouseclick on Object in unity 2d games
RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero); if(hit.collider != null) { Debug.Log ("Target Position: " + hit.collider.gameObject.transform.position); } Add solution -
Go 2021-10-18 04:23:09
how to make enemy go in one direction unity 2d
using System.Collections; using System.Collections.Generic; using UnityEngine; public class EnemyPatrol : MonoBehaviour { public float speed; public float distance; private bool movingRight = true; public Transform groundDetection; ... Add solution