btw, i am using tilemap collisions cause i made a tilemap, and for the player i have put a box collider and 2d rigidbody, heres my code:`using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour {
private float axisX;
private float axisY;
private Rigidbody2D rb;
public float jumpHeight;
public int speed;
// Use this for initialization
void Start () {
speed = 200;
jumpHeight = 300.0f;
rb = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update () {
axisX = Input.GetAxis("Horizontal");
transform.Translate(new Vector3(axisX, 0) * speed * Time.deltaTime);
if(Input.GetKeyDown(KeyCode.Space)) {
rb.velocity = new Vector3(0f, jumpHeight, 0f);
}
}
}
`
someone please help .