Affecting scale of 'child' entity based off of data in a parent entity (pinnochio's nose)

Here’s the Pinnochio’s Nose Problem ™ I’m facing:

Imagine we have a whole bunch of Pinnochio entities which are made up of a few primitive shapes, one of which is a nose. When one of the pinnochio entities lies, we increase the num_lies int in the PinnochioData struct. What I want is to then have the nose then grow (change z scale) in response to that change.

Right now the nose is just a primitive shape childed in the editor which is converted to an entity along with the parent.

What are my options here If I want this to be burstable and parallel? Creating a reference to the parent would require the entitymanager, which would prevent its use in parallel, right?

How would this sort of thing be accomplished?

You don’t need the EntityManager for this. Traditionally, the tool you are looking for is called ComponentDataFromEntity which lets you look up components on other entities from a job. However, in an Entities.ForEach, you can use the shorthand GetComponent().

Reading (getters only) the parent should work in parallel.

1 Like

Eyyooooo, it works!!