#EntitiesSamples Step 4 Error

1 messages · Page 1 of 1 (latest)

main torrent
#

I have been trying to follow this sample:
https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/EntitiesSamples/EntitiesTutorial/README.md
using unity version 2022.2.9f1

I got to the end of Step 4 but when I hit Play I don't see any cannonballs, instead i get a bunch of errors.

Error 1:
InvalidOperationException: The previously scheduled job TurretShoot reads from the ComponentTypeHandle<Unity.Collections.NativeText.ReadOnly> TurretShoot.JobData.WorldTransformLookup. You must call JobHandle.Complete() on the job TurretShoot, before you can write to the ComponentTypeHandle<Unity.Collections.NativeText.ReadOnly> safely.

Error 2:
ArgumentException: System.ArgumentException: A component with type:{0} has not been added to the entity. This Exception was thrown from a function compiled with Burst, which has limited exception support.

I'm not sure sure if I am doing something wrong, or the samples are not compatible with my editor version.

Also copy+pasting TurretShootingSystem.cs gives this warning in my IDE:

There is no defined ordering between fields in multiple declarations of partial struct 'TurretShootingSystem'. To specify an ordering, all instance fields must be in the same declaration. [Assembly-CSharp]

GitHub

Contribute to Unity-Technologies/EntityComponentSystemSamples development by creating an account on GitHub.

#

EntitiesSamples Step 4 Error

frank dew
#

Usually There is no defined ordering between fields in multiple declarations of partial struct 'TurretShootingSystem'. To specify an ordering, all instance fields must be in the same declaration. [Assembly-CSharp] shows up if other errors exist. So check for other errors. I see the tutorial is slightly out of date, so LocalToWorldTransform is now LocalTransform.

#

Error 2 i recommend trying to turn burst off (and run again):

main torrent
#

Thanks for the tips! Couldn't see any other errors and didn't manage to make it work / figure out what's wrong unfortunately. Will try to follow the tutorial again from the start or find some other more up-to-date resource 🙂

frank dew
#

No worries! :3

wispy wadi
#

@barren sorrel ^

tired junco
tired junco
#

I've tried resolving it but so far no real luck

main torrent
#

@tired junco i did!

tired junco
main torrent
#

@tired junco yes

tired junco
#

This does however create a race condition problem with a former step, I imagine you got that too?

main torrent
#

I might have had that? But then I believe I had forgotten to add a script to some gameobject, so that error was on me.

tired junco
#

But then I believe I had forgotten to add a script to some gameobject, so that error was on me.
Had that too, was probably the bullet

#

Though that wouldn't fix the initial issue