Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class playerpush : MonoBehaviour
- {
- public float distance = 1f;
- public Transform pickup;
- public LayerMask boxMask;
- // Start is called before the first frame update
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- Physics2D.queriesStartInColliders = false;
- RaycastHit2D hit = Physics2D.Raycast (pickup.position, Vector2.right * transform.localScale.x, distance, boxMask);
- }
- void OnDrawGizmos()
- {
- Gizmos.color = Color.yellow;
- Gizmos.DrawLine(pickup.position, new Vector3(pickup.position.x + distance, pickup.position.y, pickup.position.z));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment