Forum Discussion
8 Replies
- SeeingBlueMentor
You would have to imagine and build the system yourself. Just a quick brainstorm to get you started, I think a couple planes with the footstep texture, keep about 5 or six per player or npc, periodically position them at the NPC's foot position with a timer to remove them later so you can reuse it.
- InaCentaurMember
can we get foot positioning?
- SeeingBlueMentor
Look in your player class at the foot property. It is a PlayerBodyPart type with all kinds of properties you can use.
https://developers.meta.com/horizon-worlds/reference/2.0.0/core_player
https://developers.meta.com/horizon-worlds/reference/2.0.0/core_playerbodypart - Smuggler3Member
You should get an award for this question.
The only things I can think of would be:
1. Vanishing footprints: These might be able to be done, conceptually speaking, with a form of smoke asset. The smoke miiight have the ability to linger if that trait is available in the asset.
IF this exists, insert little lights in the floor/on the ground. When the character walks over the lights the character enters then leaves an event trigger box-much the saw way a sound can be triggered when entering a specific area. There might be a way to put a timer on the event trigger/triggered and the footprints, sound, light, etc., end/disappear. A way TO make them slowly disappear might be to stack/place multiple trigger boxes inside each other/stacked on top of each other and set the timers at/to different durations. Then the footprints could sloooowly fade.
2. Sliding textures/floors. Once the character passes through an area an event causes a floor to slide/ascend. The new texture/floor has the permanent footprints on it. - SeeJayPlayMember
It looks like the left and right foot can't be identified separately which would make realistic footprints quite difficult. https://developers.meta.com/horizon-worlds/reference/2.0.0/core_playerbodyparttype
If you can recognize left from right, you could potentially spawn a footprint asset from a pool at the alternating left/right positions whenever the player is touching the ground.
I could imagine this getting pretty complicated π You might, for example, track the height of the feet (once you identify them) and spawn a footprint every time they move up from a collision. Then you'd also start to worry about which direction the feet are facing.
An easier approach, depending on what you are going for, might be to leave a sort of wide trail in the ground. Or scuff marks and such trailing the player as opposed to clearly identifiable footprints. You could then have the asset spawn on the ground wherever the player is touching and then return to a pool over time. This could enable gameplay where you might be tracking other players.An even easier approah that might be in-line with what you are thinking would be to have a specific floor type that would receive footprints. Scattered somewhat sporatically as prefab assets. Think of this like mud puddles. Each mud puddle could have its own associated footprint assets. So if the player walks through a trigger associated with this "mud puddle", a child entity (showing vague mud markings) would simply be set to visible. In this case, you wouldn't get clear directional and accurate footprints but you'd know whether another player had gone through this way or not.
I hope to see how this turns out for you. - Smuggler3Member
Jay,
1. Is it possible to track the height of the character's feet as they ambulate? What about tracking the height of the feet of a NPC? That might be a problem.2. The footprints might be able to synchronized with a timer or perhaps thru some sort of trigger boxes. Perhaps trigger boxes placed in two rows, alternating, and skipping spaces? O.O
3. 'return to a pool'. Can you clarify what you mean by that phrase? Thx.
4. Yes, the child triggered asset is a great idea. As is the vague steps/footprints. Footprints need not be accurate in shape, they can be partial one way, partial in another manner, etc.
Questions:
1. Can triggered events fade/die off after a pre-set duration? I mean, sound can-unless it can't and that's not what's happening when I hear sound. Can light?
- SeeJayPlayMember
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:// Make this object invisible after delaythis.async.setTimeout(() => {//add the things that you want to happen after the delay herethis.entity.visible.set(false);}, 500); //500 is the time (in milliseconds?) before the actions inside the brackets will be executed**I'm still learning myself but hopefully there is something helpful there.
- Ashes2Ashes2Partner
I was able to create a rough footprints mechanic years ago in code blocks, using a raycast attached to the player to get the ground position I could add the footsteps at. The forward position of the player to decide how to rotate them. If the splatter slingshot is still in the asset library you can try using that to help rebuild it in typescript. The world Splatter Slingshot that demos the slingshot is still alive/functioning if you want to test it out in VR: https://horizon.meta.com/world/10158830830808353/?target=release&hwsh=fVGdM9Gy8d
You'll need a friend to hit you with a balloon to trigger the footprints.