#How to bake an entity?

1 messages · Page 1 of 1 (latest)

jolly burrow
#

Hello! I've worked with DOTS in the past to learn the system and recently decided to take a look at what has changed over the past couple years, but am stuck on an issue where the way that I understood how to bake entities in the past seems to be deprecated. My main issue is that the documentation and examples that I find all seem to point to an older method that doesn't seem to be supported anymore.

I've attached two images:

  • #1 shows some code that used to work right out of the box.
  • #2 shows the specific error that I am getting with respect to a deprecated method. I can't find a way to use any of the alternate method signatures to achieve what I'm trying to do.

Can anyone provide an example of how entity baking should be done in the most recent version of ECS/DOTS? Thanks so much.

autumn shard
#

AddComponent(entity, new RotationSpeed())

You need to always specify an entity as a target because Bakers can also bake data to additional entities that they create

#

Also RotationSpeed can't be a class, it must be a struct. To add a class you need ro use AddComponentObject but it is not recommended to use them as they can't be Bursted