Player don't collect the Cubes

hello,
i am trying to develop an app that similar to Roll-A-Ball and i tried to put the code of collecting the cubes in my app and it doesn’t work, i don’t have any errors , here is the code please help i need to give beta of this project in few days and it can cost me a lot of money
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerControl : MonoBehaviour
{
public Rigidbody2D rb;
// Use this for initialization
void Start()
{
rb.GetComponent();
}

// Update is called once per frame
void FixedUpdate()
{
rb.velocity = new Vector2(2, rb.velocity.y);
if (Input.GetKeyDown(“w”))
{
rb.velocity = new Vector2(rb.velocity.x, 3);

}

}

void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == “PickUp”)
{
other.gameObject.SetActive(false);
}

}
}
thanks a lot

Please check out this page for how to post code on the forums: Using code tags properly

Unfortunately, whether you have to post a beta in a few days or not, will not necessarily mean you’ll get an answer faster :wink:

Okay, so is there a rigidbody on the object moving around? Is there a collider on it? Is there a collider on the pickup item, and is that collider set to “IsTrigger” ?
Ah, kinda only half read your post… so it’s a 2D game!. You need to also change the method to OnColliderEnter2D(Collider2D other)

Let me know if anything there helped ya out :wink:

I have to ask, out of curiousity, how can needing a beta in a few days cost you lots of money? :slight_smile: