#How can I make components cooperate?

1 messages · Page 1 of 1 (latest)

proven narwhal
#

Heyy guys, I'm new to DOTS and the ECS mindset. I want to recreate my "regular" (gobj/monobehaviour based) car controller in DOTS and I've gotten stuck. In the monobehaviour world, I had a parent gameobject "Car" with the CarController script, which had 4 fields of the Wheel type, a monobehaviour script on the child wheel objects. The CarController script would calculate the amount of forces and rotation for the wheels, and update a public property on the wheel which would in turn use that in it's own update func (to actually apply the forces and stuff). How would I design this with ECS? Should I grab the child objects at startup and just save them and do the rest as usual, or is there a more idiomatically correct way of doing this?