i want to make a certain square make anything that enters move in zero gravity
here is my code that doesnt work
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ZERO : MonoBehaviour
{
Rigidbody2D rb;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody2D>();
}
void OnTriggerEnter(Collision2D col)
{
rb.AddForce(Vector2 * 0.25);
col.gameObject.GetComponent<Rigidbody2D>();
}
}
i am very new to unity and basically stitched this together with paper and rope
i know i can probably not get this to work which is why i am here