Persistent Spawned Objects?
Hello! So I'd like to build a creator game, but... So I asked Horizon Gen AI llama whether it is possible to do persistent placement and it said I needed clarification on whether allowing users to spawn persistent objects would be against policies? Here's the generated: No, it is not possible for a user to throw an entity on the ground and have it be added permanently in a world. In Horizon Worlds, entities spawned or manipulated by users are not persisted across sessions by default. When a user throws an entity, it will be simulated by the physics engine and may come to rest on the ground, but it will not be permanently added to the world. To achieve persistent entity placement, you would need to implement a custom solution using Horizon Worlds' scripting capabilities, such as using the `World.persistentStorage` API to store the entity's state and re-spawning it when the world is reloaded. However, this would require significant development effort and may not be feasible or allowed by the platform's policies. Here's an example of how you might implement a basic persistent entity system: ```typescript import { PropTypes, CodeBlockEvents, Player, Vec3, Quaternion } from 'horizon/core'; import { Component, Entity, World } from 'horizon/core'; class PersistentEntity extends Component<typeof PersistentEntity> { static propsDefinition = { entityToPersist: { type: PropTypes.Entity }, }; start() { this.connectCodeBlockEvent(this.entity, CodeBlockEvents.OnPlayerEnterWorld, this.onPlayerEnterWorld.bind(this)); this.connectCodeBlockEvent(this.entity, CodeBlockEvents.OnGrabEnd, this.onEntityReleased.bind(this)); } onPlayerEnterWorld(player: Player) { const storedState = this.world.persistentStorage.getPlayerVariable(player, 'persistentEntity'); if (storedState) { const entity = this.props.entityToPersist!; entity.position.set(new Vec3(storedState.position.x, storedState.position.y, storedState.position.z)); entity.rotation.set(new Quaternion(storedState.rotation.x, storedState.rotation.y, storedState.rotation.z, storedState.rotation.w)); } } onEntityReleased(player: Player) { const entity = this.props.entityToPersist!; const position = entity.position.get(); const rotation = entity.rotation.get(); // Store the entity's state in persistent storage this.world.persistentStorage.setPlayerVariable(player, 'persistentEntity', { position: { x: position.x, y: position.y, z: position.z }, rotation: { x: rotation.x, y: rotation.y, z: rotation.z, w: rotation.w }, }); } } Component.register(PersistentEntity); ``` Please note that this is a simplified example and may not cover all edge cases. You should consult the Horizon Worlds documentation and consider factors like entity ownership, security, and performance when implementing a persistent entity system.266Views0likes3CommentsSkydome Help - Understanding the different maps to build painterly Sky in Blender
Hello, I was recently creating a painted skybox inside Blender and figured out how to bring it into Meta Horizon. However, I noticed the documentation button doesn’t lead anywhere, even though it appears active. I’m also based in Australia, so I don't have access to the AI tools. I’m currently trying to figure out the three other map types through trial and error and would appreciate some clarification: Radiance Map (256x128): I’m guessing this is an equirectangular black-and-white texture used for lighting? Reflection Map (768x256): I assume this is similar to a Unity reflection probe, though I haven’t seen that resolution before. Fog Map (384x64): This is a stretch, but I’m guessing it’s a depth map based on the display map, though I’m not certain. Any information you can provide to help break down these textures would be greatly appreciated. If I can get everything working correctly with my Blender setup, I’m planning to create a tutorial to show how to make rendered/painted skydomes in Blender for Meta Horizon. Thanks very much for your help!Sit Down, Ride Away and Die.
I'm going through the tutorials and in the web mobile one I see this Death script that triggers when you hit a target. It makes me wonder what other animations I can call for my avatar. I know I've seen others implement this in various ways, I'm wondering where the documentation is. I'd love to control the avatar to sit down and go for a ride. I'm seeing this line in the code of the tutorial player.playAvatarGripPoseAnimationByName('Die'); but then going through the various documentation and tutorials, I can't find details about it. I noticed a 'Respawn' call works too.354Views0likes3CommentsHow to Use unity_asset_bundles API in Horizon Worlds?
Hi there , I'm trying to import a Unity asset bundle into Horizon Worlds and use ssetBundleInstanceReference.setAnimationParameterBool() to play animations on a model. However, I haven’t been able to find any tutorials or examples showing how to do this. Could someone please help or point me in the right direction? Here’s the official API documentation I’m referring to: https://developers.meta.com/horizon-worlds/reference/2.0.0/unity_asset_bundles_assetbundleinstancereference Thanks in advance!495Views2likes2CommentsHow to change world creator to a different user?
Hi 👋 Is there a way to change the world creator to one of the editors? So that when the world is published, a different user will be stated as the creator? Perhaps there is a way to remove myself as the world creator, and then an editor would automatically become the creator of the world? Please let me know. I don't want to duplicate the world to avoid losing the likes and stats. Thanks!193Views0likes1CommentGrabAimPosition Not Aiming at Screen Center in Horizon Worlds (Desktop Version)
Hi everyone, I've built multiple worlds in Horizon Worlds and am experienced with setting up GrabAimPosition and GrabAimRotation. However, in the desktop version, the aiming does not align anymore with the center of the screen, even though I set everything up correctly. Here’s an example of the issue: Has anyone else experienced this problem? Could this be a bug, or is there a workaround? Thanks for any insights!