r/pythonhomeworkhelp • • Jan 28 '26

My code is committing unalive.

Hi I came here for some help on my code. It's collider is WAY above the ground. Anyone know how to fix it?

from ursina import *

from random import randint

def update():

if held_keys\["a"\]:

	cube.position += cube.left \* time.dt \* 2

if held_keys\["d"\]:

	cube.position += cube.right \* time.dt \* 2



cube.v_speed += 25 \* time.dt



cube.y +=cube.v_speed \* time.dt



if cube.y < 0.5:

	cube.y = 0.5 \* 0.5

	cube.v_speed = 0



	if held_keys\["space"\]:

		cube.v_speed = 10

cube=Entity(model="cube", color=color.white, scale=2, collider="box")

ground=Entity(model="cube", scale=8, color=color.white, collider="box", position=(0, -7, 0))

cube.v_speed = 3

app=Ursina()

app.run()

1 Upvotes

Duplicates