Forum Discussion
1. Not sure at all. In theory, if you can identify the feet through the PlayerBodyPartType Enum and then continue to track them, you can potentially figure out which is which but sounds like a big project. I've ignored the NPC part of this problem - I am less sure about that.
3. Object Pooling is the practice of spawning a series of assets into a scene but hiding them from view. You create a group of assets that you continue to use throughout. This is particularly useful for repeated and commonly used assets that you need to access quickly. You might use them for projectiles for example. In this case you could have a "footprint/ground marking" prefab asset. You spawn maybe 20 of them into the scene at start in a pool. Periodically, you pull one of the "footprint/ground marking" from the pool and place it in a specific spot depending on the footprint system. At some point, you'd want to return the "footprint/ground marking" to the pool when it is no longer needed. In my message above, I am suggesting that each "footprint/ground marking" have a specific lifetime. So after a certain amount of time they would return to the pool so that they can be re-used. For pooling I have done, I setup 2 scripts, 1 that spawns in the assets into the pool of assets (moved to a non-visible point in the scene (100,100,100). Another script that will bring the individual asset to the play area as needed. When the player touches a specific collision for example, you place the asset at the foot of the player. Asking ai to generate 2 scripts like this should produce effective results and tutorials probably exist for object pooling in Worlds but I can drop a couple scripts here later if it proves useful.
1. Fading away over time.. I am not sure since material properties are still a chllenge for me in Worlds. Disappear from view instantly? Yes cetainly. You can set the visibility of an asset to false after x seconds - I believe you can still interact with that asset if it is invisible. So for the footprint asset make sure you turn collisions off in the inspector. Then at runtime you would toggle visiblity on and off. this.entity.visible.set(false);
This will turn off visibility for the asset it is attached to and all of it's children.
For the delay - my (*understanding of this isn't perfect) you can create a function in a script attached to the object with a timeout inside of it. Every time the object visibility is set to true, trigger the function which after the timeout will set the asset visiblity back to false.
Something like:
**I'm still learning myself but hopefully there is something helpful there.