I'm making a Brick Breaker Game using Ursina in python. I've created some entities which work as ball and bar.
bar = Entity(model='quad', color=color.blue, position=(4.5, -10, 0), scale=(3, 0.3), collider='box')
ball = Entity(model='sphere', color=color.red, position=(4.5, -9.5, 0), scale=0.25, collider='sphere')
I want the ball at the upper center of the bar without manually setting the x and y value. Like this:
For this I want the width and height of the bar. How can I get that? I tried bar.width
. But it returns 'Entity' object has no attribute 'width'