Scripting

Search The Documentation:

  1. Home
  2. Docs
  3. Scripting
  4. Examples
  5. Use Object As Avatar

Use Object As Avatar

Platform Compatibility

PC Mac OSX Oculus Quest
X X

Drop this script on an object to make it replace the player object with itself. Learn more about
moveStored for how it places the object directly at the player location.

1
2
3
4
5
6
7
8
9
10
11
12
--Position this object to player, hide player, and voila a fake avatar!
if obj.firstRun() then
    player = obj.tryStore("Player")
   
    if player > -1 then
        obj.setParent(-1, player)
    end

    obj.moveStored("0,0,0", -1, true)
   
    obj.setPlayerHidden(true)
end
Tags
Was this article helpful to you? Yes No

How can we help?