-1
from ursina import *

# update sphere_2 rotation
def update():
    line.rotation_y += 1
    sphere_2.rotation_y += 1

app = Ursina()
sphere_1 = Entity(model = 'sphere',scale = 2)
# try to make sphere_2 follow the lines rotation
line = Entity(model = 'line',scale = 4,y = -1)
sphere_2 = Entity(model = 'sphere',scale = 1,x = -2)
app.run()
Jan Wilamowski
  • 3,308
  • 2
  • 10
  • 23
  • Please take the [tour], read about [ask] and how to create a [mcve]. – Peter Wood May 05 '22 at 08:20
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 05 '22 at 11:35

1 Answers1

0

Parent sphere_2 to sphere_1. sphere_2.parent = sphere_1 to make position, rotation and scale relative to sphere_2. Or sphere_2.world_parent = sphere_1, if you want to keep the original transformation intact after parenting it.

pokepetter
  • 1,383
  • 5
  • 8
  • for the sphere_2 to rotate around sphere_1. Do I need to add any mathematical rotation updates? – Radioactive Gaming May 05 '22 at 17:56
  • No, just parent it and rotate the parent. So if it has a child at position (0,0,1) for example, and you rotate the parent, any children will rotate with it, around the parent's axis. – pokepetter May 05 '22 at 23:58