PRODUCTS
EXPERIENCES
APPS & GAMES
SUPPORT
Meta accounts are here: you can create a Meta account to log into VR devices.
Learn more
META HORIZON WORLDS
LEARN TO CREATE
INTRO TO CREATION
INTRO TO HAND TOOLS
INTRO TO GIZMOS
INTRO TO SCRIPTING
PUBLISHING
LOCAL SCRIPTING
EVENTS
MOTION
ACTIONS
RESOURCES
BROWSE TUTORIALS
LOCAL SCRIPTING
LOCAL SCRIPTING
LOCAL SCRIPTING INTRODUCTION
…
Local scripting allows for responsive scripts. By default, scripts run on the server.
…
CONVERTING SCRIPTS TO LOCAL
…
To create a local script, first click the gear icon at the top right of the script window.
…
CONVERTING OBJECTS TO LOCAL
…
If a script runs locally and references an object in the script, the object that it is referencing runs on the server unless its ownership is transferred to a player.
…
WHEN WORLD IS STARTED
…
When a script transfers ownership to a player, it automatically runs the “when world is started” event, and any event that was sent before or during the transfer is lost.
…
VARIABLE PERSISTENCE
…
When a script transfers ownership, its variables reset to their initial value.
…
CHECK IF OWNED BY PLAYER
…
The ‘server player’ value is a player value that identifies the server. It can be used to check if an object is owned by the server or by a player.
…
LIMITATIONS
…
Player enter and player exit events are unable to run on local scripts. If a local script needs to receive an event when its owner enters the world, use a default script to receive the player enter event.
…
QUEST 3
QUEST PRO
QUEST 2
ACCESSORIES
RIFT S
APPS & GAMES
SUPPORT
DEVELOPERS
VR FOR WORK
ALL PRODUCTS
Quest 3
Quest Pro
Quest 2
Quest 2 (Refurbished)
Rift S
Accessories
Quest
Go
Rift
Compare Headset
MORE META QUEST
Forums
Blog
Referrals
VR for Good
Creators
Download SDKs
ABOUT
Careers
Meta Connect
Research
ALL PRODUCTS
Quest 3
Quest Pro
Quest 2
Quest 2 (Refurbished)
Rift S
Accessories
Quest
Go
Rift
Compare Headset
MORE META QUEST
Forums
Blog
Referrals
VR for Good
Creators
Download SDKs
ABOUT
Careers
Meta Connect
Research
Privacy
Legal
© Meta 2024