#udon-general

59 messages ยท Page 14 of 1

plush wadi
#

This HUD code is for one that only the player who gets it will see.

twilit breach
#

you will have a pool of hud dupes somewhere in the world out of sight and mind

#

on start you have the player check a sync var, then add 1 to said var

plush wadi
#

Yea, but I only need the hud dupes for ones I want everyone to see right? Not just the client player

twilit breach
#

and they get the hud numbered to the var before addition

#

when they check for the specific hud number you can do things like have it only follow that player who started when the synced var was at 3 or whatever

#

or have it only locally turn on

#

and have a seperate network script that will turn it on for everyone

#

something in that direction

plush wadi
#

So if i have a counter, I need to make it a sync variable?

twilit breach
#

yeah

plush wadi
twilit breach
#

just be aware only the owner of the object with the sync var can set said var

plush wadi
#

I'm guessing I should make playersWaiting synced right?

#

Does the trait handle most of that?

#

Oh i seeee about the syncvar

twilit breach
#

also another fun bit about synced variables

#

they wont set on join

#

so on player join the owner of said set var needs to run set var to itself

#

to update the new guy

#

and this process takes around ~2s with our current servers

fiery yoke
#

What?

#

No

#

Synced vars are synced on join

twilit breach
#

nope

#

in unity yes

#

not in VRC

#

i tested

fiery yoke
#

I tried that

#

Welp

twilit breach
#

i had different results

#

thats odd

fiery yoke
#

maybe there is different cases

twilit breach
#

cuz i read the unity official doc

#

saying they sync netid vars or w/e on join

#

tried it and it was a bust

#

and made my own command

plush wadi
#

do sync'd vars need to be public?

#
  /// Add a player to the queue to wait to get a HUD object attached to them
  /// </summary>
  /// <param name="player">The player to wait</param>
  void addToQueue(VRCPlayerApi player) {
    if (hudToDispense != null && player != null) {
      Debug.Log("Add To Dispenser Queue" + player.displayName);
      Networking.SetOwner(player, gameObject);
      GameObject hudObject = VRCInstantiate(hudToDispense);
      int index = insertHubObjectIntoQueue(hudObject);
      playerQueue[index] = player;
      Debug.Log(playerQueue[index].displayName + " Added To Dispenser Queue at " + index.ToString());
      playersWaiting++;
    }
  }``` so on add to queue, I set the owner of this manager object to the player i'm going to give the hud to, this way the player can incrememnt and decrement this variable:

/// <summary>
/// The number of players waiting currently.
/// </summary>
[UdonSynced(UdonSyncMode.None)] int playersWaiting = 0;```

#

does that make sense?

twilit breach
#

actually maybe they do sync on join and I was just running a start script before it had synced

#

I know I gave it a timer to let things settle before making use of the synced variables

fiery yoke
#

I understand that you want to "learning by doing" but trying something this complicated as a learning project isnt ideal.
I would recommend to start with something simpler.

twilit breach
#

but I may have done the timer after switching to onplayer join set var

fiery yoke
#

Yeah

#

Synced variables take the exact same time as normal

#

meaning that they wont be ready on Start

twilit breach
#

oh okay

plush wadi
#

Just making an object that follows a player seems super simple to me tbh

twilit breach
#

i gotta get rid of that on player join bit then

fiery yoke
#

I dont know why youd need a queue then

plush wadi
#

In mine @fiery yoke ?

fiery yoke
#

ye

plush wadi
#

It's because of this:

        FollowHUD hud = hudObject.GetComponent<FollowHUD>();
        // if the follow hud has loaded for a gameobject, assign it to the waitng player
        if (hud != null) {
          Debug.Log(playerQueue[i].displayName + " Dispenser has loaded hud! " + i.ToString());
          hud.equipTo(playerQueue[i]);
          // then clear the spot in the queue
          if (debugText != null) {
            debugText.text = playerQueue[i].displayName + "has recieved their HUD!";
          }
          Debug.Log(playerQueue[i].displayName + "has recieved their HUD!");
          Networking.SetOwner(playerQueue[i], gameObject);
          hudQueue[i] = null;
          playerQueue[i] = null;
          playersWaiting--;
        } else {
          if (debugText != null) {
            debugText.text = playerQueue[i].displayName + "is waiting for a HUD behavior to load";
          }
        }
      }```
twilit breach
#

most people just make separate interact objects or enter triggers to assign each following thing. doing it all on join before things have synced and settled is rough

plush wadi
#

FollowHUD behavior turns null if you try to grab it right after instanciate, you need to give it a frame

fiery yoke
#

Still doesnt make sense to me at all.

plush wadi
#

What doesn't make sense? I'd love the critiscism

#

I should also note, this script also works with OnInteract. So you can make this an OnJoin give or an OnInteract give:


  /// <summary>
  /// Equip a new hud when the player joins
  /// </summary>
  /// <param name="player"></param>
  public override void Interact() {
    if (dispenseOnInteract) {
      addToQueue(Networking.LocalPlayer);
    }
  }```
#

I just figured since I can't inheret yet i'd just make a bool and have it to either.

fiery yoke
#

Just the entire way youre approaching this just seems very inexperienced with the way that VRChat/Unity operates.

plush wadi
#

Explain?

#

Since there's no docs I'd love anyone who has the knowlege to set me on the right track

fiery yoke
#

A local HUD doesnt need to be instantiated. You just have a single one in the scene and that is used for everyone.
You just need to put a PlayerTracker on it and youre done.

A HUD that others can see on you (aka Networked) is not recommended right now because networked instantiation isnt implemented yet.
The only way around that is object pooling which is something relatively advanced networking wise.

plush wadi
#

I understand the second part, and plan to use that workaround if needed.

#

Basically the hud would be a nameplate visible to other players is all for that second case.

#

For the first case :

Say I have a hud I only want users to see named OBJ#123 (that can be it's networkID)

There's only one in my unity scene... but every client would see it's own version of this object unless I synced them... is that what you mean?

fiery yoke
#

I guess? The wording is a bit weird

plush wadi
#

Can you maybe re-word an example of how that would be done.

I'm guessing I have my disabled HUD gameobject somewhere in the world, and I attach a PlayerTracker component to it.
I can then have some trigger event (start or interact) that activates it, and sets the Network.SetOwner() to the player who triggered the event.

would that only set the object visible for the client who interacted with it and have it follow them. Then allow other people to activate their own client version of the existing object in a similar way?

fiery yoke
#

Why does it need to be disabled?

plush wadi
#

so the user doesn't see it until it's attached to them

#

Oh wait, I thought PlayerTracker was a provided behavior. Is it just one you write yourself?

fiery yoke
#

Yes.

plush wadi
#

Okaycool

#

Using some other interacter it calls equipTo() to attach the hud to the player, and then enables the objects contained in the hud making them visible.

#

I'm hoping the set owner stuff is in the right place

wise bay
#

Thanks for the chats about object ownership, that has been a confuddling issue for me as well

#

The phasing of objects etc

plush wadi
#

Yea this has been super heplful for me too

#

how does one un-set the object owner? Is that a thing? Or does it matter?

fiery yoke
#

Ohh actually with the way youre doing huds you dont even need networked instantiation. And thats actually relatively useful.
But that will only confuse you even more

#

Also I dont know why youd need ownership on this

plush wadi
#

Is it not best practice?

#

I wish there was a better way to test with multiple chars lol

#

like you could spawn a dummy avi and switch between thenm

fiery yoke
#

If you dont need it, then it will only add more complexity

plush wadi
#

Mind if I just walk though what I have quick to make sure I don't need it?

#

I think I get it now but, I want some extra eyes if that's cool. May also help others see with examples?

#

step 1: Player A joins the world:

    playerQueue = new VRCPlayerApi[MaxQueueSize];
    hudQueue = new GameObject[MaxQueueSize];
    // if we want to dispense the hud when the player joins, we give it to them on the load of this script.
    if (dispenseOnJoin) {
      addToQueue(Networking.LocalPlayer);
    }
  }``` 
They're added to the queue to get a new object. The new object is created, and I set the owner of the manager to the player getting the hud, and I set the owner of the new hud to the player getting the hud.

Because the player getting the hud is the owner of the manager, they can now increment the synced variable playersWaiting.


```  /// <summary>
  /// Add a player to the queue to wait to get a HUD object attached to them
  /// </summary>
  /// <param name="player">The player to wait</param>
  void addToQueue(VRCPlayerApi player) {
    if (hudToDispense != null && player != null) {
      Debug.Log("Add To Dispenser Queue" + player.displayName);
      Networking.SetOwner(player, gameObject);
      GameObject hudObject = VRCInstantiate(hudToDispense);
      int index = insertHubObjectIntoQueue(hudObject);
      playerQueue[index] = player;
      Debug.Log(playerQueue[index].displayName + " Added To Dispenser Queue at " + index.ToString());
      playersWaiting++;
    }
  }```

```[UdonSynced(UdonSyncMode.None)] int playersWaiting = 0;```
#

While the player is waiting, Update goes through the queue and finds any huds that were created and have finally loaded their behaviors.

Using the loaded behavior, I equip the FollowHUD to the player, (who should already be the owner of the gameobject with the followHUD on it) and then re-set the owner of the manager to this client, so they can de-increment the playersWaiting count

      if (hudObject != null) {
        Debug.Log(playerQueue[i].displayName + " Checking to see if Dispenser has loaded hud " + i.ToString());
        FollowHUD hud = hudObject.GetComponent<FollowHUD>();
        // if the follow hud has loaded for a gameobject, assign it to the waitng player
        if (hud != null) {
          Debug.Log(playerQueue[i].displayName + " Dispenser has loaded hud! " + i.ToString());
          hud.equipTo(playerQueue[i]);
          // then clear the spot in the queue
          if (debugText != null) {
            debugText.text = playerQueue[i].displayName + "has recieved their HUD!";
          }
          Debug.Log(playerQueue[i].displayName + "has recieved their HUD!");
          Networking.SetOwner(playerQueue[i], gameObject);
          hudQueue[i] = null;
          playerQueue[i] = null;
          playersWaiting--;
        } else {
          if (debugText != null) {
            debugText.text = playerQueue[i].displayName + "is waiting for a HUD behavior to load";
          }
        }
      }```
#

On equip also sets the owner of the hud to the player getting it, just to make sure.


  /// <summary>
  /// Equip this hud to a player
  /// </summary>
  /// <param name="player"></param>
  public void equipTo(VRCPlayerApi player) {
    if (player != null) {
      Networking.SetOwner(player, gameObject);
      equipedPlayer = player;
      hudItems.SetActive(true);
      isActive = true;
    }
  }```
#

Does that track in some way? ๐Ÿ™ โค๏ธ Thanks again for all the help people

grave cloud
#

would it be possible to make a moving platform that parents the player to the platform when standing on it and unparents the player when they jump off.

plush wadi
grave cloud
#

it might be i'm trying to figure out a way to create a ride but i want to get rid of the weird rubber banding that i see in most rides in vrchat

plush wadi
#

try Update instead of FixedUpdate... weirdly i find fixedupdate to be way more jittery

#

i mean you may already be, but just a thought

grave cloud
#

i'm not sure how udon works but i thought i might as well ask before trying things because it would kind of suck to start something to find out that its imposable to do

wise bay
#

Isn't it generally a bad idea to GetComponent during Update?

fiery yoke
#

Yes

plush wadi
#

Eh, if you need to you need to, but try to do it in Start if anywhere

wise bay
#

Yeah looks like that could be good for optimizing that platform routine

plush wadi
#

you just can't always in start given how udonbehaviors can take a second to load

wise bay
#

Oh no way

fiery yoke
#

Thats not how that works

wise bay
#

That probably explains a lot of the issues I have been having

fiery yoke
#

UdonBehaviours Start are definitely after Unity has initialised all components

plush wadi
#

Not if you VRCInstantiate

fiery yoke
#

No that should work

#

you just cant use it in the same frame

plush wadi
#

Yea, that's what that means

fiery yoke
#

Start doesnt happen in the same frame as you instantiate an object

#

Start happens once the object is initialised and ready

plush wadi
#

but it still doesn't always have the behavior

#

I've tested it

fiery yoke
#

Then youve done something weird since it has always worked for me

plush wadi
#

๐Ÿคทโ€โ™‚๏ธ

fiery yoke
#

You cannot instantiate Prefabs with UdonBehaviours btw

plush wadi
#

what do you mean 'cannot'

wise bay
#

It's currently broken, correct?

plush wadi
#

I do, they just take a frame to attach the behaviors

fiery yoke
#

The way prefabs are serialized clashes with Udon

plush wadi
#

hence my weird queue

#

you need to add the prefabs to the world descriptor, it works for me

fiery yoke
#

Welp then its just the UdonBehaviour that is broken

wise bay
#

@plush wadi you mean add the prefab as a child gameobject set to disabled?

fiery yoke
#

No there is a section in the world descriptor for dynamic prefabs

wise bay
#

Oh, what is this

#

I never knew about this part of the VRC Scene Descriptor

plush wadi
#

I instantiate the 'hudObject' earlier, and FollowHud is an UdonBehavior.

It gets null from getcomponent on the first loop, but then on the second, getcomponent<followHud> finds the hud

#

it just takes a frame to attach the udonbehaviors to new prefabs

wise bay
#

What is the purpose of the Dynamic Prefabs section?

plush wadi
#

I think it's a list of all prefabs that the game can create using instantiate effectively.

#

it's probably used to cull a bunch of unneeded game data but keep the prefabs the world needs

#

I get trees and stuff auto-added to it too

wise bay
#

Can't believe I have never seen this ๐Ÿ˜‚

plush wadi
#

I only found it because I watched a youtube vid haha

wise bay
#

Oh nice, can you plz share the link to the vid if you can find it? I would like to watch

plush wadi
wise bay
#

ty ty ๐Ÿ˜„

#

so I see it's not an udon specific thing at all. okay

plush wadi
#

yea~

#

Cool! My swimming hud dispenser is working as intended I think.

grave cloud
#

it looks like it's fine till you start playing around with stuff

plush wadi
#

Hahaha, I was mainly making sure the wet dry one worked XD

#

the others are still very much tests~

#

next step is a clear button

grave cloud
#

the wet and dry worked i just thought this might be a funny picture

plush wadi
#

X3 haha

#

The huds should all also scale with the player height when you change avis :3

#

that took a bit to figure out. I use a capsule as a base height, and then calculate the user height using the distance between head to feet and scale all all items using that vs the base

grave cloud
#

are the huds going to be used for animations

plush wadi
#

It's modular so it can be used for anything.
I have FollowHUD and ResizeHUD. If both are equipped, the objects they point to will follow the equipped player and resize the attached gameobjects accordingly around the chest.

#

ResizeHUD requires FollowHUD, but FollowHUD is standalone too if you don't have anything you need to resize.

#

I also have a HUDDispenser that can dispense any prefab with a FollowHUD to players. Either on interact, or on join .

light fjord
#

mhm how come after interacting with something it breaks everything else? like cant click on anything or so

plush wadi
#

well the pick me up one adds a colider around you the size of you

#

i'm wondering if it blocks other colliders

light fjord
#

its not a pick up.

#

its a toggle

plush wadi
#

yea, it turns on a collider

light fjord
#

what collider?

plush wadi
#

so, the red pill will show you a mesh that re-sizes with your avatar. I use that to base the rest of the hud on so it re-sizes correctly with avatars.

The red pill is just a mesh for testing and visualizing.

The green pill adds a collider in the shape of the mesh you see from the red pill to your body. I'm trying to make it so another player can interact with the colider around the first player and do things. Like maybe pick them up in this case.

light fjord
#

huh?

#

why would interacting with anything cause everything else to break..

plush wadi
#

you need to be more specific when you say "everything broke"

#

what's broke?

light fjord
#

what do u think..

#

i said

#

when i interact with a clickable button

#

everything else breaks,. including the toggle

#

and triggers.

sharp fossil
#

probably some error is thrown

#

and then script will stop executing

#

check logs

light fjord
#

how do i bind test world to unity so it shows?

#

@sharp fossil

sharp fossil
#

you don't. tho if you use udon sharp it can do it for you. Othrwise go to C:\Users\%username%\AppData\LocalLow\VRChat\vrchat

#

and you can find log files here

light fjord
#

i do use udonsharp

sharp fossil
light fjord
#

oo @sharp fossil VRCSDKBaseVRCPlayerApi.__TeleportTo__UnityEngineVector3_UnityEngineQuaternion__SystemVoid'. ---> System.NullReferenceException: Object reference not set to an instance of an object. this is the problem

whole chasm
#

Hey, I've messed around with udon# for a couple of days now but since I haven't made any worlds in the past i'm not sure how I should handle input from the user

#

I was able to get input from the pc user by just using the unity input system but I'm not sure how that would work for VR

gleaming fractal
#

Is it possible to synchronize a livestream with a world using udon?

#

i hear its possible.

worthy beacon
#

Is there a proper way to add a listen to a Button's onClick event?i did it like so:
button.onClick.AddListener(ClickEventMethod);

#

but udon sharp gives this error: Assets\DBZ\TimeNest\TimeNest_UdonProgramSources\Tracker_KeepPos.cs(36,22): System.Exception: Get can only be run on Fields, Properties, Local Symbols, array indexers, and the this keyword

#

i suppose the issue is how i established my callback function?

light fjord
#

uuh. udon is terrible. why is it that a simple thing as Networking.localplayer gives the Local player of the user on the pc and not the actual local player..

worthy beacon
#

but that is the local players

#

player*

#

local player = player running the client

#

are you trying to find a player local to a location or somthing?

light fjord
#

well i know that. but what i mean is that. if i have to test a world my self i need 2 seperate clients and pcs ? or can i run it on the same pc but two clients?

#

because currently i am running two clients and when the master of the world triggers something it shows up as if the other client triggered it

worthy beacon
#

they way i do it is i upload the world (publish not test), then i do run test client with 2-3 clients. This launches 2-3 instances of vrchat. Then login to alt accounts on the seperate instances and have them all join in on the world

light fjord
#

yea did that. but what i get is wierd.

#

basicly i hjave a trigger

#

that displays the Local players username.

#

but for some reason when i do a networked event to show everyone in the instance it shows the other client the name of it self and not the other client

#

so what i am also curious about is that the Network target all seems to also target the master? which makes it happen twice

worthy beacon
#

assuming what your doing is doing a network event to do Network.localplayer.displayName, ya thats gonna show everyone their own name

light fjord
#

ahh i see

#

lemme ask another thing.

#

if i have a master that triggers something

#

do i want to use All or Owner networked target?

worthy beacon
#

you need to collect a list or somthing of each persons userName, and when the event triggers display the same number from that list for everyone

#

depends on what you wanna do

light fjord
#

ah. so you do have to go that round about way.. dangit

worthy beacon
#

All will mean all clients for that object will play that method

light fjord
#

i was doing that already.

worthy beacon
#

if you do owner, then only the person who owns the object will trigger

light fjord
#

hmm so if i i want everyone to see the same i gotta do all ye?

worthy beacon
#

ya

light fjord
#

and lemme get this fcorrect Owner = the one who triggered it?

#

or the one who owns the object?

worthy beacon
#

another way you can do it is by establishing owner of the object to that player, trigger the event for all, and get the owner of the object for the display nam

#

name*

#

owner is who owns the object

light fjord
#

is there anyone by default that owns a object?

worthy beacon
#

master by defualt owns everything, you have to transfer ownership

light fjord
#

ahh

#

okay so i dont wanna have anyone own anything.

#

so i assume i just dont transfer ownership

worthy beacon
#

by default the master will own everything

#

you cant unbind ownership because ownership is required to do anything in sync

fossil osprey
#

I have a door open animation, and I have an udon trigger script set up to make the door clickable. How do I connect the two so the door actually opens when I click it?

scarlet lake
#

Can somebody help me I cant jump for some reasons in my world I made today?

twilit breach
#

we don't have jump by default, you have to add it

#

something like that on a blank game object, its also on the VRCWorld prefab now

scarlet lake
#

thx

scarlet lake
#

is there a better way to do guns now?
i have been using particle guns and now, since udon is out, is there a better way to do it?

jagged crow
#

does SendCustomNetworkEvent send the event to everybody including the person who sent it?

raven peak
#

yes if set to all

plush wadi
#

So I'm using a bunch of hidden objects and turning them on to make them visible, but they're still only visible to one player... do I need to sync setting the object active with all players somehow?

jagged crow
#

yes

#

nothing you do in a script is synced unless you explicitly sync it

#

the simplest solution is probably to send network events since that doesnt require ownership afaik

plush wadi
#

I'm guessing I somehow use UdonBehaviour.SendCustomNetworkEvent() but I'm not sure how to specify to enable an object with it

jagged crow
#

u# or graph

plush wadi
#

u#

#
  /// Equip this hud to a player
  /// </summary>
  /// <param name="player"></param>
  public void equipTo(VRCPlayerApi player, HUDManager hudManager) {
    if (player != null) {
      Networking.SetOwner(player, gameObject);
      equipedPlayer = player;
      Debug.Log("MEEPLOG:: " + equipedPlayer.displayName + " equipped hud of type " + type.ToString());
      hudItems.SetActive(true);
      isActive = true;
      if (hudManager != null) {
        Debug.Log("MEEPLOG:: storing hud of type " + type.ToString());
        hudManager.storeHUD(player, this);
      }
    }
  }```
#

This is what I have now. I'm guessing setActive should be replaced with the custom network event but I'm not sure how...

jagged crow
#

oh these are objects you're attaching to players?

plush wadi
#

yea, usually. But not 'attaching' in any way VRCHat knows

jagged crow
#

yeah jut positioning it to be on them

plush wadi
#

just mapping their transform to the player location

jagged crow
#

does every player in the instance get an object when they join

#

or is it a finite number of pre defined objects

plush wadi
#

In this case, it's a finite number of objects (30) managed by a pool

jagged crow
#

ahh yea

#

thats actually exactly what I'm working on right now XD

#

haven't got it yet

plush wadi
#

I have it pretty much working. But only the person who enables the item can see it yea

jagged crow
#

I think the issue is you can't change ownership of an object while it's not enabled

jagged crow
#

ahh nice

plush wadi
#

the item this function is on is actually active at all times. The hud has a sub item it enables and disables for visibility

jagged crow
#

ooh I see

plush wadi
jagged crow
#

haha

plush wadi
#

I'm using a single object and looping through it's kids to collect the pool items haha. Was surprised that worked

jagged crow
#

this is probably not the way to do it but

#

you could have a unique event for each one

#

based on the object's name

#

since events can't pass parameters haha

#

~~```
void hide1() {
if (this is thing number 1) {
hideThis();
}
}

#

have a function like that for each number, then when you send the event you can just add the number to the name of the function easily since it's a string

plush wadi
#

yea I don't think that's the best way ๐Ÿค”

jagged crow
#

behaviour.SendCustomNetworkEvent(Common.Interfaces.NetworkEventTarget.All, "hide" + thisThingsNumber);

#

xD yeah

#

there must be a better way

plush wadi
#

having playercount*hudtypes functions per class sounds off to me

#

I think I just don't understand how networking events work with this

#

On the same script, if I have ```

public void showHUD() {
hudItems.SetActive(true);
}

#

could I just not send the action showHUD within the current instance?

#

How does SendCustomNetworkEvent find the event by name, is how I'm mostly confused.

jagged crow
#

oh, yeah you're right

#

I think?

#

it should only send the event to the same object

#

I've been banging my head on this all day lol can't think straight

#

yeah when you send an event, it runs the function on that instance of the udon behaviour for every player.

#

I keep thinking the events are broadcast to all behaviours for some reason

plush wadi
#

I think i may have got it

#

i'll need another person to test tho haha

jagged crow
#

make another vrc account :D

#

or is it vr-specific

plush wadi
#

yea i got a test account too haha

#

Weird, it still only shows up for me :/

#

SendCustomNetworkEvent(VRC.Udon.Common.Interfaces.NetworkEventTarget.All, "showHUD"); does get run, and it does enable the hud for the local player only

#
``` gets run
jagged crow
#

o.O

#

very odd

plush wadi
#

yea...

#

And i can see it, but just for local user...

jagged crow
#

add a debug to the showHUD function

#

see if that's getting called for everyone

plush wadi
#

I'm trying one more thing first

#

Making sure that they are appearing and just not following the player

#

Unrelated, is there a reason that Synchronize Position doesn't seem to stick for udonbehaviors on prefabs?

#

It stinks having to go through and manually set it on each new prefab.

jagged crow
#

I think that's a bug

plush wadi
#

so i got it to appear! Now I just need the tracking to update locationwise

chilly aspen
#

What was the solution?

plush wadi
#

SendCustomNetworkEvent(VRC.Udon.Common.Interfaces.NetworkEventTarget.All, "showHUD"); worked, but I wasn't moving the object using a network event as well

#

so it was just under the ground

#

unrelated; Anyone have any docs or guides on messing with what the player camera sees? Like adding underwater effects and reducing fov?

hoary ocean
#

I'm trying to pass a public string variable from one object to another. is there any way to do this using the node graph?

torn quail
#

on U# you will do something like
string mystring = anotherobjectnamehere.GetComponent<udonbehaviourscriptnamehere>().nameofthepublicstringhere;
not entirely sure how you can do it on the graphs but it suppose to be pretty straight forward similar to this

chilly aspen
flint urchin
#

Calling it directly will just execute it locally

chilly aspen
#

Ah I see. Basically if I wanted a this.gameObject.SetActive(false) to appear to everyone seeing that object, it'll have to go through SendCustomNetworkEvent.

wooden pond
#

Question: I'm trying to work with Udon more and I'm trying to do the Door/Player teleport. I followed a YT video from Vowgan and I followed everything he said but when I try my world in Local Testing, the door is highlighted but I don't get teleported to the other location, help?

oblique sand
#

could you send a picture of your code/nodes?

wooden pond
oblique sand
#

custom event: Enable; send custom event: Enter; rename one or the other

wooden pond
#

Ah okay

oblique sand
#

also your Transform.GetPosition node is not hooked up into anything
^ should be fine but IMO its good practice to use a this block just to clarify what the nodes are doing.

wooden pond
#

I see

vale current
#

So I'm trying to make a UI attached to the player hand but for some reason it can push the player

#

and if I change the layer to UI it's not interactive anymore

#

is there a solution to that ?

oblique sand
#

are you able to mark it as a trigger or does that break the raycast?
(public bool Collider.trigger)

vale current
#

it's a canvas

#

there is no collider

oblique sand
#

you could probably put it on PickupNoEnvironment because pickups go through the player yet still get raycasted (i think)

vale current
#

yep, this layer works thanks

#

I forgot that it existed

oblique sand
#

how does VRCPlayerApi.SetSilencedToTagged work? if someone's tag changes value then does the silence get lifted/applied? also i'm assuming by silenced it means you cannot talk.

chilly aspen
#

Anyone know all variable types UdonSynced supports syncing of?

oblique sand
#

i would assume only primitives but that's probably wrong

jade otter
#

I'm assuming in goofing up with either comparing or grabbing the controller inputs.

#

Anyone able to help?

vale current
#

Is there a way right now to save data ? like saving a value so when the player quit and join back it still has the same value

fiery yoke
#

Nope

vale current
#

aww, rip

#

it's sad that we can't use PlayerPrefs

light fjord
#

seriously the problems udon has with Sync is just annoying. makes one not wanting to make a map..

twilit breach
#

all you do is test a pickup by bumping walls to see how solid it is, then respawn or tp player in another way and see if it gets loose

fiery yoke
#

Lol that is ridiculous

twilit breach
#

for me its SDK2 and 3, ive noticed pickups being weird since udon but idk if its just mine

#

finally narrowed it down to teleporting being the cause yesterday

fiery yoke
#

Nah I think I had something similar happen to me too.
However Im not sure because I was doing something super weird in my world

twilit breach
#

that's also a fresh world i tested it in, both the sdk and the project

#

it's really kinda gaming breaking for anything involving smacking stuff

light fjord
#

ooh yea i had that problem to Dinky.

#

alot of things seems to break if u pick up stuff or interract.

fiery yoke
#

gg devs

twilit breach
#

do you understand what they meant when they said "networking IK (inverse kinematic) with the big update? cuz i also notice in my debugger it throws errors saying "kinematic rigidbodies only support continuous speculative smoothing" or something when pickups are held by other players

#

and it sounds related but i dont fully know what that change meant for player arms or bones i assume?

fiery yoke
#

Ahh yeah that is definitely related

#

Can you add that to your canny?

twilit breach
#

yeah

fiery yoke
#

Ahh so Pickups become kinematic when you pick them up. However Continuous Speculative is the only smoothing that is supported by Unity with kinematic Rigidbodies.
Im not sure but seems that it doesnt get set to that.

twilit breach
#

its gotta be something where they mess with rigidbodies kinematics and smoothing, i need to read up on that portion of the unity docs again

#

oh if they were kinematic they would follow hands transform

#

but when you bump a wall and force is pushed into em?

#

that would be odd for it?

#

or force is attempted to be pushed into some part of it lol

#

idk its all weird with pickups atm

twilit breach
#

I wonder if there's a work around to reset hand grips after they get miss aligned. I've tried changing avatars and disabling then re-enabling player pickup ability with no luck. It is okay on world load until the first teleport so I wonder if there's a way to reset that portion of the player

torn quail
#

hey guys. im trying to make multipe buttons for an interaction. for some reason only the first one (Mouse0) works, and the others wont. since i dont have vr i can only test if it works with another button so i assigned T aswell but it doesnt work. any reason why?

foggy raven
#

Is there something similar as setting a custom pose for sitting in Udon/SDK3?

plush wadi
#

Anyone have any clue why my stuff works fine when I launch and build it from unity, but the published world doesn't work?

#

That's what things do when launched from unity, but none of that seems to happen in game

broken gazelle
#

Are videoplayer components completely disabled on sdk3? I know the syncvideo stuff doesnt work but even direct linking to my mp4 doesnt seem to work.

foggy raven
#

I saw an update that they disabled it for now

#

And it also seems that I can't put a custom laying down animation on chairs just yet either (it resets my controller every time)

broken gazelle
#

ah damn :/ guess i'll store my stuff locally for now, rip filesize.

#

or just drop udon entirely. Ngl i have some major gripes with it and i get it's alpha, but damn.

sour wigeon
#

Is OnStationEntered/Exited not working...?

flint urchin
#

It is, but you are required to do some extra things than just adding the station and events.

Check the udon example on the station and you'll see some extra parameters on the station

twilit breach
#

Does anyone know how to stop pickup drop from crashing behaviors if the player isn't currently holding a pickup?

torn quail
#

how does it happen for you in the first place?

#

i have a script that has pick and drop. so theres never an option to drop if you didnt pick up the object

idle brook
#

Does anyone know how to do a teleport trigger...?

#

I copied it but my trigger does not assume any location to teleport

torn quail
#

you need to make an object that will be the location where the player will teleport to and attach it to the script. it will use the object's transfom

#

the script will go on the button

vale current
#

Is there a way to define or know the execution order of udon behaviours ?

willow dove
fiery yoke
#

Your material property block is null

willow dove
#

Do you know what should I do?

fiery yoke
#

Call the constructor of MaterialPropertyBlock and assign the result to your variable

willow dove
#

OK Thank you. I will give it a try

fiery yoke
#

Yeah, but if youre not needing it anywhere else then you dont really need to save it in a variable

willow dove
#

bc I'm still getting the same error

fiery yoke
#

Are you sure it compiled correctly?

willow dove
fiery yoke
#

yes

willow dove
#

ty. Pretty new to Udon XD

#

Udon't won't preview in Unity's run mode right?

#

I don't have any runtime error now but nothing has changed

fiery yoke
#

As long as you dont need PlayerApi or other VRC specific classes it will

willow dove
#

Then I guess it didn't work๐Ÿ˜…

fiery yoke
#

Well youre not doing anything with the MaterialPropertyBlock

#

Did you even read the documentation? It says:
"MaterialPropertyBlock is used by Graphics.DrawMesh and Renderer.SetPropertyBlock."

willow dove
#

I think it only works for dynamic object?

#

Renderer.SetPropertyBlock Might works

fiery yoke
#

You have to get a reference to the MeshRenderer and yeah

willow dove
#

OK XD

#

Another stupid question? How do I get object itself?

fiery yoke
#

No This is the right way.

willow dove
#

oh ok...

#

I don't think this works

#

since I'm still refencing the constructor not the block itself right?

#

Actually nvm idk how but it works the second time...

fiery yoke
#

Ohh yeah then you actually do need to save it in a variable sorry

willow dove
#

Nan it actually works

#

I don't even know how...

fiery yoke
#

Thats kinda odd then

#

Can you post a picture of the Disassembled Program?

oblique sand
#

is event ordering guarantied or will this cause a race condition? i'm having the master assign an object (SetOwner) to a player (to send them a specific message) then sending an event to everyone to process whether or not they received an object.

mortal star
#

Is there a way to scale game object?

#

Using U#

floral dove
#

@mortal star sure - GameObject.GetTransform, and then Transform.SetScale

mortal star
#

Ok

#

ah, I forgot to save the script, saw an error with Scale and though I messed something up xD

mortal star
#

ok, got it

mortal star
#

how can I create a custom toggle event out of a bool?

#

in U#

#

that triggers once only when Bool changes from false to true?

cunning mist
#

Have a variable called "boolnameOld" and make them the same on start. Then in update, check to see if boonameOld is equal to boolname, then do what you'd like out of that branch.

#

@mortal star

plush wadi
#

Anyone know how to add mods to the view-camera for stuff like underwater/fog effects?

#

I've seen some worlds with it, and it looks like the camera gets some mods but i'm not sure how

cunning mist
#

Much of that is done through PostProcessing zones, basically boxes of PP effects.

plush wadi
#

Ohhhh okay, thanks! Hopefully that will help me get started, never heard those terms before so it's a jumping off point ๐Ÿ˜„

iron fractal
#

I have a world I'm trying to get onto vrchat sdk3 to use udon, but not sure how to migrate everything over to a new project. I know that deleting sdk2 and adding sdk3 isnt an option and the world itself has too many objects so it would be hard to do everything completely from scratch.. anyone know a way around this? I don't mind losing previous functionality, just need all my assets and their positions in the scene

chilly aspen
#

Assets > Export Package > All (Include Dependencies). New Project > Import VRChat SDK > Import U# > Import Old Project Unity Package > Load Scene.

chilly aspen
#

Anyone know a way, compatible with UdonSharp, to delay the execution of a function by a few seconds?

iron fractal
#

thanks!

twilit breach
#

normally you do invoke or a second thing but i don't think udon supports those atm

#

my work around is to create a second inactive blank game object with a new udon behavior and when I want to wait I end the flow of my current script by sending a "set game object active" to the second object

#

the second object is basically on update get delta time and add it to a var float, then bool check until its greater than the desired time ( say 2 seconds)

#

when it finally goes above the float that allows it to pass bool it will send an event back to the original behavior to continue the flow, set its time var to 0 for the next timer use and turn itself inactive

#

the way unity works, the update function only fires on active objects so you can use an inactive object with update as a waiting timer

grizzled shuttle
#

How would I attach something to a player's view?

jagged crow
#

is it possible to have a trigger that only collides with local player and doesn't block raycasts

#

I've got a custom layer set up to collide with local player and it works fine on desktop but in vr I can't click anything in the room

mortal star
#

How to check how heavy on performance is an Udon script?

chilly aspen
vale current
#

Is there a way to change the execution order of udon Scripts ?

twilit breach
#

wdym?

#

like a little more on the context cuz i could think of several fits to the question and idk what your situation is

deep furnace
#

I have a rotating platform using a Transform rotate node but is there any way that i can set the vr player to rotate with it?

chilly aspen
#

Anyone seen this error? I get it when publishing my scene to VRChat's servers. However, the error doesn't actually break anything.

fiery yoke
#

@twilit breach Ikeiwa was talking about execution order of scripts which you can normally customize in Unity. i.e. If you want your Movement script to run before some other script you can do that. However because technically UdonBehaviour is just a single script you cannot do that like you normally would @vale current You have to manually make your own Update loop, by calling events from UdonBehaviours. You can make scripts run in a custom order, but you have to make that system yourself.

#

@chilly aspen When uploading your scene it goes into playmode which runs the UdonBehaviours. However in the Editor any PlayerApi will return null, which causes a NRE in the UdonVM for that Behaviour

chilly aspen
#

Thanks, I have another question to anyone familiar with networking.

I have an object with a VRCPlayerApi[] list. The master player manages this list as players join and leave. However, should the master player leave, a different player will become the new master, taking ownership of the object. How can I communicate the VRCPlayerApi[] list from the old master to the new master?

fiery yoke
#

You cant. This is a problem Ive been facing for a while

#

I have a PlayerManager in the working

#

not quite confident that its working perfectly however

#

But networking with Udon is really really really complex

chilly aspen
#

@raven peak Would an object list rather than a VRCPlayerAPI list be a good solution in this scenario?

raven peak
#

@chilly aspen what are you using this list for.

bright saffron
chilly aspen
#

Using it sort of like the key to a hash table. The VRCPlayerAPI list indexes would be mapped to, one-to-many, GameObject lists. If Player A was in index 0, the game would assign the objects at index 0 of multiple GameObject lists to Player A.

#

The alternative is having a game object list and assigning VRCplayerAPI ownership, one-to-one, on each object. I'm not sure which solution is more scalable, but I'll probably try this method next as preserving index position on master ownership changes don't appear possible.

raven peak
#

do the objects have to be owned by the person in the list? or will it all be local?

light fjord
#

@fiery yoke would you know what the IsObjectReady and IsNetworkSettled is?

fiery yoke
#

Yeah those are some Networking things but they can be ignored since the Network is always settled and objects are already ready, before Udon starts.

chilly aspen
#

Hmm, I'll look into that

#

Could be either or, depending on the layout.

light fjord
#

i find it super annoying that there are so many sync issues with just a simple counting.

#

@fiery yoke would you know why disabling a collider wont count it as being disabled? immediately. there is enough delay as to where the master would make it count up twice.

fiery yoke
#

Well an Event takes some time. I dont know what youre doing

light fjord
#

atm still just working on a simple sync of a int. when someone triggers a collider. but for some reason anyone who enters the trigger happens to trigger it twice.

#

@fiery yoke i assume the 150-200 ms of delay is what causes these problems?

#

hmm i could locally just have a delay for it to activate again. for like 0.5 seconds or so

#

like a buffer or so

raven peak
#

@chilly aspen the issue you will run into if the player needs ownership for syncing. is the master cant set ownership for other people. so the local player would have to handle taking ownerships of objects. but if its all local you dont have to worry about masters list changing. since the list can be local.

light fjord
#

btw i assume everything local does nothing to the network right?

#

so if i calculate something locally it wont count towards the limited update ?

gleaming fractal
#

udon question: is getting output out of udon possible through udon?. I know external input in any form is not there yet but super curious if output is possible.

#

say if you want to make a world utilising random perifferals for fun it would be interesting.

#

im still learning udon and am pretty early in but curiousity got quicker to me.

twilit breach
#

@light fjord if you have your collider/trigger set to only hit player local,and its triggering more than once on entry it might be because you have the fingers, arms and what not colliding at the same time. You should do collisions/triggers by checking for the player controller as there is only one of those (there ~16 pieces to the player local layer; limbs digits and stuff I assume) I get you a picture of a good bool

#

UnityEngine.CharacterController is the string

zealous mason
light fjord
#

@twilit breach i am not using charactercontroller? through?

twilit breach
#

what causes the trigger? a player walking into it? or do you have another object colliding?

light fjord
#

i am checking if the other is null. since we dont get anything back. and if so trigger it when a player hits it

#

and when it triggers i send to all @twilit breach

twilit breach
#

umm I'm having trouble picturing the situation. As far as I understand it you want to have a player add 1 to some sort of variable/counter when they walk into a certain area?

light fjord
#

yep

#

and i have alot of issues with it. like it wont trigger, or it triggers for each player in the world, and adds more then just 1. if one person triggers it, and also for some reason colliders enable/disable networked and not locally @twilit breach

twilit breach
#

what layer is the trigger on?

#

and what layers does said layer collide with?

light fjord
#

its default. layers but i am making sure that if other returns null then its the player

twilit breach
#

it would hit twice then

#

once for the local player

#

and once for the player, seen on the other clients

#

it would actually hit as many times as there is clients in the world

light fjord
#

ye. but why is that? how do i prevent it doing that

twilit breach
#

make a new layer that only collides with player local

#

are you familiar with the physics matrix and layers? or do you need that bit

light fjord
#

oh i am i know pretty much all about unity. and some networking. its just the way they are doing stuff that confuses me alot.

twilit breach
#

so in VRC in terms of colliders on players

#

there is a standard player controller collider

#

and like ~15 more, limbs digits, etc.

#

there are two copies of these

#

the local client has one set active, on player local layer

#

and the second set inactive which is the same copy but on player layer

#

other clients have other player's local player layer object inactive

#

and the player object active

#

so if I walk into a trigger, every other person has a set of colliders tracking me on player layer

#

and they will each see that floating set of colliders collide with the trigger

light fjord
#

so i changed everything to Localplayer Layer only now

twilit breach
#

noice

#

id still recommend that character controller bool

light fjord
#

lemme test this and see

twilit breach
#

because if you sprint into a trigger on one physics frame there will be nothing in it

#

and all at once on the next physic frame like 2 fingers and a forearm will be inside it

#

therefore causing multiple collisions before stuff can get turned off

light fjord
#

so unityengine.charactercontroller? and make sure its only that?

twilit breach
#

yup

#

UnityEngine.CharacterController

light fjord
#

and i cant get the object of whatever collides so it gotta be a String match ye?

twilit breach
#

you get the type, which is kosher in udon

#

and turn the type to string

light fjord
#

kosher?

twilit breach
#

not restricted

#

by VRC devs

light fjord
#

so i just do a other.gameobject.gettype.tostring ye?

twilit breach
#

oh do you use U#?

light fjord
#

i do ye

twilit breach
#

oh ye idk the full conversion but whatever matches my noodies

light fjord
#

i am doing other.gameObject.GetType().ToString().Equals("UnityEngine.CharacterController")

#

oo eh

#

soo i put everything including the floor and so on Playerlocal

#

but eh.

#

yikes.

twilit breach
#

?

light fjord
#

the floor dissapeared when i did that lol.

twilit breach
#

idk if it does render camera stuff

#

wait

#

no it would

#

oh are you using the default player local layer?

light fjord
#

yep

twilit breach
#

cuz I use a new made one that is only one check box

#

my noodle says that, dunno if its different from other.

light fjord
#

the default player local which layer does it collide with on your end?

twilit breach
#

i make that

#

cuz the layer called "PlayerLocal" collides with default and other layers

#

which isnt what we want

#

but dont do the floors and stuff with that layer, or default objects will fall through

light fjord
#

mm k

twilit breach
#

is this happening on collision or a trigger enter?

light fjord
#

trigger

twilit breach
#

kk

light fjord
#

does the new Localplayer collide with it self?

#

or just PlayerLocal?

twilit breach
#

only PlayerLocal

fossil osprey
#

Hey any reason as to why I cant open the udon graph?

twilit breach
#

dunno, was it working earlier?

fossil osprey
#

It was yesterday

light fjord
#

@twilit breach mhm after i gave the trigger zones the Localplayer layer it no longer triggers

twilit breach
#

what was the other null stuff or anything else that happens in your script?

light fjord
#

checking other is null

twilit breach
#

were the trigger zones working with the same code before, and the only change was adding the new layer?

#

or are they not working now that you've also added the controller bool

light fjord
#

yea. it gives me a null reference cant do other.gameobject

twilit breach
#

does U sharp have UnityEngine.gameobject....?

#

or maybe UnityEngineObject.

light fjord
#

it does

#

or no. wait

twilit breach
#

oh

light fjord
#

it only has UnityEngine.GameObject

twilit breach
#

yeah do that

#

that sounds close to or exactly mine

#

idk what other is tbh

light fjord
#

its a class. the other one is a instance of it

twilit breach
#

these triggers will definitely work, I've been using them to assign hitboxes and sync player in match count variables

#

its just a matter of finding out what code my noodles are I suppose

light fjord
#

so yea that works. now i just need to see if sync works

twilit breach
#

hit me up if you get sync troubles, I've gotten it all figured out at this point

light fjord
#

@twilit breach omg it works.. its kinda stupid that the default layer settings for playerlocal hits everyone.

#

@twilit breach thanks mate ๐Ÿ˜„

twilit breach
#

yeah no problem, happy world making ๐Ÿ™‚

fossil osprey
#

I cant open the udon graph anymore to do the visual scripting, does anyone know why?

full basin
#

Hey I'm currently working on a world. However my Animation is working perfectly fine in the Unity Player, but as soon as I start the testbuild the Animation seems to be frozen. How can i fix?

floral dove
#

@fossil osprey - can you give any more details? Do you have any errors in the console?

#

@full basin - do you get any errors in your game logs?

fiery yoke
#

@full basin Are you using an Animator or Animation component?

gleaming fractal
#

@zealous mason thanks for the info! that's exciting

zealous mason
#

totes

fossil osprey
#

@floral dove its because in the udon behavior script in the inspector window, it changed the drop down menu option that was selected

fiery yoke
#

@zealous mason @gleaming fractal afaik OSC can only be used to feed outside data into VRC not out of. So instead of pressing a button on a keyboard you can press a button on a Launchpad that is OSC compatible or even some Voice-Recognition thing.

jagged crow
#

is it possible to have a trigger that only collides with local player and doesn't block raycasts
I've got a custom layer set up to collide with local player and it works fine on desktop but in vr I can't click anything in the room

fiery yoke
#

Yeah that is the one big advantage with how I do Player collision

floral dove
#

@fiery yoke OSC will be bi-directional when it is integrated into Udon

fiery yoke
#

Thats good to know. However I dont know about the implications of that. Havent played around with the OSC protocol much, but generating a lot of trafic might block something

#

The canny I made about that problem

jagged crow
#

ahh so its not possible yet

fiery yoke
#

Well not really no

jagged crow
#

If the Trigger is *inbetween you and the other object you will not be able to interact with it. This does not happen if your hand is inside the collider. from your player collision thread this doesn't seem to be true

fiery yoke
#

There is other approaches to the "player enters zone => do something" problem tho

jagged crow
#

yeah I'm thinking I'll just redo it by checking player coordinates on update

#

since it's a static trigger

fiery yoke
#

Hmm thats odd. I thought that as long as a raycast starts inside a collider, it will not actually collide with it

jagged crow
#

hmm is there a difference if the target is also inside the collider maybe

fiery yoke
#

Checking player coordinates on Update can get pretty expensive if you scale it up

jagged crow
#

I was thinking maybe just make the collider really short so it's not blocking any raycasts, but then if people jump it thinks they've left the area haha

gleaming fractal
#

@fiery yoke ahw thats a shame

#

so output from vrc will not be possible through any protocol? would be cool. not common used but it opens up some interesting possibilities

fiery yoke
#

Did you read what momo said? They are planning on making it bi-directional

gleaming fractal
#

oops sorry missed it reading!

jagged crow
#

this is my thing, I'm trying to make it load the avatar pedestals only when people go to the room

gleaming fractal
#

thats EXCELLENT

#

thank you momo

#

it gives an option for weird experimental worlds like the cold and warm things that were available for VR or some weird haptics worlds

#

niche yes.. but available at least :)

fiery yoke
#

It also allows for crazy setups

#

Think of a DJ party, where they have a custom OSC listener

gleaming fractal
#

imagine just an github posted arduino code which takes that OSC and controls some fairly easy to build or 3D print perifferals.

jagged crow
#

what's OSC?

gleaming fractal
#

open sound control

jagged crow
#

ooo

fiery yoke
#

Its a very simple message protocol

gleaming fractal
#

usually used with music gear or for software sending/recieving commands from other software

fiery yoke
#

Used mostly for synchronizing audio data to other events like lighting and effects

#

But you can use it for almost anything

gleaming fractal
#

i use it with work from time to time. Since i do entertainment installs

zealous mason
#

thats what I'm developing right now laser, will have working prototype in about 2 weeks I hope ๐Ÿ™‚

#

i'll have a github of all the code and 3d prints when its done

gleaming fractal
#

im working in anticipation of some kind of world video sync I've been hearing about. A show triggered through livestream

zealous mason
#

that'd be cool ๐Ÿ˜ฎ

gleaming fractal
#

Yes working on a show design tool bridge for vrchat so professional shows can be pre-placed in world and triggered locally on a livestream so everyone can watch it together in sync.. over multiple world instances

#

most of it can be done just the livestream sync not yet.

jagged crow
#

oh yeah There is other approaches to the "player enters zone => do something" problem tho what other approaches are there?

#

I'm kinda stumped on the best way to move forward haha

hoary ocean
#

I am having some issues finding a way to save network variables. can I do this via SQL? or is there a way vrchat saves it?

jagged crow
#

no way to save stuff yet

hoary ocean
#

Unfortunate. Creating hashed variable dumps is probably the only way to keep persistence then

jagged crow
#

yep. depending on how complicated your world is you could aways use an oldschool video game style password haha

scarlet lake
#

how can i ajust the graphic settings?

hoary ocean
#

like quality? or post processing?

scarlet lake
#

i hold shift and click play nothing happens

zealous mason
#

@gleaming fractal thats awesome, i'd love to see that

hoary ocean
#

this might be the wrong chat. try user support. but, holding shift and pressing the play button in steam should work

scarlet lake
#

that is the problem it doesn't work ๐Ÿ˜ฆ

hoary ocean
#

I'll troubleshoot with you over in user support

full basin
#

@floral dove @fiery yoke I'm using a animated rain texture from the assetstore; the asset is using a custom script

fiery yoke
#

Custom Scripts are not supported. You have to either redo the script in Udon (if possible) or you cant use it.

full basin
#

ok thank you

hoary ocean
#

how would I take the C# approach to udon?

full basin
#

Are there any good materials/animations for a rainy window?

fiery yoke
hoary ocean
#

thanks!

hoary ocean
#
Assets\Cube(1).cs(12,64): System.Exception: Method is not exposed to Udon: Void .ctor(String, String)

#

it is blocking a constructor. is this normal?

fiery yoke
#

What are you doing?

#

Also for UdonSharp related things you might want to join Merlins Discord, as this is more meant for "official" Udon Graph and general Udon related questions

hoary ocean
#

I see

#

Thanks

jagged crow
#

imo U# should just be made official XD

#

is so good

jagged crow
#

hmm is it possible to set the owner of an object to null

#

trying to do some object pooling stuff but the master is counting as the owner of all unowned objects

foggy raven
#

Nice Idea Shaun ;w;

foggy raven
#

Is it possible to make custom "chairs" (sitting position) in Udon worlds?

stoic pond
#

is udon worth it for a horror map

arctic mica
#

Can we get an update in vr chat that alows to use a leap motion device?

#

Cause i dont have an htc vive nor oculus so i made one myself using kinect leap, motion and vr for a phone

#

And im tired of seeking for drives in google

#

Most of them dont work

cunning crown
#

hello! was wondering how to set a PickupObject to NotLocal?
i couldnt seem to find a Setting for making it Local or world

hushed gazelle
#

@foggy raven Same as in VRCSDK2 worlds, only you have an UDONBehaviour object driving it. There's a prefab in the SDK.

#

Is there a way to check what a player's avatar height is?

slim hound
#

@cunning crown Add an Udon behavior and check the sync position option

cunning crown
#

thanks guys!

foggy raven
#

@hushed gazelle I tried to find the prefab for the custom avatar override and it isn't present in SDK3

hushed gazelle
#

@foggy raven Copy it from another project, you can't make avatars with the current SDK remember.

foggy raven
#

Yes I know D>

#

Copying the override isn't enough, it pulls from another model and I can't copy it with the animations somehow

shadow tundra
#

Hello everyone, can someone explains me more what is the ownership system and how does it works please?

chilly aspen
shadow tundra
#

Okay, thanks, ownership is for example to not let someone else take the object you have picked

safe niche
#

There is no object sync in Udon system.
Can you tell me what to do?

twilit breach
#

add a component called udon behavior and check the checkbox called sync position

#

you may need to add an udon asset to the behavior for it to save the changes. you can use a blank graph if need be

safe niche
#

How can I sync the pickup objects? @twilit breach

twilit breach
#

are you familiar with how to add components in unity?

safe niche
#

It uses udon nodes to some extent, but is almost novice. Can you tell me how to sync the object pickup?

#

I want to make object sync in old sdk2.

foggy raven
#

SDK3 doesn't have the override to do custom sitting poses natively ;w;

brisk shoal
#

Is it possible to use an already made code for the udon kart on another vehicle?... like create an exact replica of the nodes and place them on another "object" but with only a different placement of the intractable objects?

twilit breach
#

this is the SDK3+Udon equivalent of Object Sync from SDK2

safe niche
#

@twilit breach You are my hero. Thank you

twilit breach
#

I'm not familiar with udon karts , but code is code so it should be able to integrate with something else. May just have to make sure each part and variable it normally works with lines up in the duplicate

light fjord
#

@twilit breach there is no way to do custonnetwork event with parameter ye?

fiery yoke
#

Not right now.

twilit breach
#

So when I teleport objects with pos sync on them, they get very jumpy and glitch around (likely due to it trying to sync the old position with a client before/after the tp). Has anyone found a good solution to this?

fiery yoke
#

Is the owner teleporting the object?

light fjord
#

@twilit breach @fiery yoke would you guys know if any clever ways to sync a array of ints that only get populated by whoever triggers something?

fiery yoke
#

That is pretty much impossible. Depending on what youre doing there may be a work around

twilit breach
#

my current set up is to change to owner and then tp, which makes it nice and steady on the person now teleporting, but the previous owner and other clients still get jumpy until the person picks it up. then the sync settles

fiery yoke
#

SetOwner takes networking time

twilit breach
#

normally itd be fine but its apparently jumping so much it sometimes breaks random destructibles, so it must be going all over

fiery yoke
#

Meaning that teleporting the object right after leads to desync

twilit breach
#

oh

#

right

#

guess ill make a 2s delay and have the vending machine play a long dispensing sound xD

forest lion
#

was good

twilit breach
#

although if the master (who's already owner) teleports it, other clients still get the lerpy slow moving bit. almost seems like pos sync turns off if it isnt in motion, so it tps real quick and then pos sync slowly lerps in over

fiery yoke
#

Ohh yeah I remember that

#

I think it has to do with the Rigidbody being asleep

twilit breach
#

or something like that, my hitboxes do something similar. if you are walking steady they follow nice but if you teleport and dont move i can watch them slowly moving towards the person

fiery yoke
#

Im pretty sure you can wake it up manually tho

#

Try adding: Rigidbody.WakeUp()

light fjord
#

so atm we cant get other peoples ID cause its all local and you cant show another person id etc?

twilit breach
#

oooh sounds fancy

#

ill try that thanks

fiery yoke
#

playerID is an incrementing index. You cannot get a users "real" id

iron fractal
#

anyone know a good way to detect an object is picked up? I was thinking of detecting trigger input, but not sure how to do that either.. or is there an easier way?

light fjord
#

i know. but thats also the PlayerID i count on. whoever joins has a ID assigned

fiery yoke
#

What exactly is your point?

light fjord
#

mhm? just finding it wierd and hard to teleport all users who triggers a trigger. and then use that to teleport them. otherwise its fairly impossible. ye?

fiery yoke
#

I have no idea what youre trying to describe xD

light fjord
#

you have a trigger. that happens to be a sign up sorta deal.

#

and everyone who enters this trigger

#

will be in a collection that happens to store peoples info so it can be used for teleporting them

twilit breach
#

just have the trigger locally turn on a var bool

#

and check the var bool before tp

#

those who havent previously entered the trigger/turned on the bool wont run the tp past bool

light fjord
#

but then the problem still persist. how do i display who signed up?

twilit breach
#

you doing some sort of hitbox assignment then tping players?

#

and adding to a roster

light fjord
#

yea

#

sorta

#

like imagine

#

when u sign up to something

#

and your name gets written down

#

this is just for cosmetic effect.

twilit breach
#

you dont want my solution, its bad

#

others have done something to get player ids on a roster UI list

light fjord
#

ye.

#

well i know one way.

twilit breach
#

I have 8 separate triggers, each corresponds to its own UI and each is in its own area

light fjord
#

or not. .

#

oo

#

oof

twilit breach
#

more work in a lot of ways

#

but it keeps stuff in order

#

a lot of my scripts are 8x as big now though so

#

also its limited to 8 players

#

I think they are gonna sort player api lists at some point so i guess thatd be the ticket

light fjord
#

hold up i think i know how.

#

i can have a string

#

that is synced

#

and i add to this string whenever someone triggers it

fiery yoke
#

Alright so I read up on what youre doing

#

There is a way to do that, but its not fun

light fjord
#

ehf.

#

i think i know of a way.

#

lemme make this real quick

#

i get back if it works

#

or not

#

actually does anyone know what the sync value on some things does?

twilit breach
#

whatcha mean sync value?

light fjord
#

so i noticed that string,ints etc has a Sync possiblity.

#

like when u make a varible

twilit breach
#

if you check the sync on the variable it functions as follows

#

whenever the owner sets that variable to a new value it sends a network event updating everyones var to match the owners new value, this takes around 2s

#

so if you have the owner set a var and try to have another client use the var in a short time they will use the previous value as they havent gotten the network update yet

#

but yes you can sync strings, ints, etc. here look at this

light fjord
#

hmm can i somehow force update a network event?

#

does anyone know if corutines are supported?

fiery yoke
#

No. Udon is not asynchronous

light fjord
#

its not?

fiery yoke
#

As far as I know it runs on the main thread synchronously

light fjord
#

kay.

#

yea i found it corutines requires a invoking method for it to work.

frosty basalt
#

Why does my Compile Break all the time?

#

like it stops Compiling and i have to restart Unity

light fjord
#

@fiery yoke @twilit breach do any of u know how long it takes to change master?

fiery yoke
#

Well the ping of the person sending the message to the photon server

light fjord
#

hmm so is there any way to send a change to the master of the world? like make him change a value if someone does something?

fiery yoke
#

Well yeah and no

#

You can send a custom event to the owner

#

but you cant pass a value with the event

light fjord
#

true.

#

but i assume i can take what locally has been set and set it?

#

so if i have a string

#

and the local player non master sends it to the owner, does the master of the world then set this data or? add to its own string?

fiery yoke
#

You cant "send a string"

light fjord
#

well what i mean is if you have a varible that has some data in it. and then in a networked custom event you set this varible to whatever is on the local end?

#

wont this be send to the owner then?

fiery yoke
#

I have no idea what youre trying to describe

light fjord
#

imagine two people

#

one is master

#

and other is not

#

the master is the only one that can change a value of something

#

but the other person wants to tell the master i have a new value can you add this to a already existing value

#

and then display it for everyone

fiery yoke
#

There is no overly complicated way to do that right now

light fjord
#

wtf. so when sending something to the master it wont actually change anything on the masters end?

fiery yoke
#

How do you want to "send something" to the master?

light fjord
#

network event..

#

Target owner.

fiery yoke
#

An Event is an event

#

Theres no way to send something with it

#

you can just tell someone that something has happened

light fjord
#

currently Udon doesn't make to much sense in this respect cause all its doing is litterly running the same function on every target, instead of actually sending the data. right?

fiery yoke
#

I dont think you understand how Networking works currently

light fjord
#

eh.

#

i know exactly how it should work.

#

but udon clearly just tell other clients to run this function.

#

atleast thats how i see it currently

fiery yoke
#

You cannot send any data

#

you can just tell someone to invoke a method

#

a method without parameters

light fjord
#

thats exactly what i am saying atm.

#

it just tells the other user to invoke a method.

#

not really copying the master

fiery yoke
#

Thats not what is supposed to happen

light fjord
#

thats how it should be done if its synced up

#

it copies the owners data

fiery yoke
#

For synced variables it does

#

Synced variables will send other users the variable data

#

if youre the owner

light fjord
#

ye i know.

#

but thats what iam trying to find out

#

if you as non owner can change the synced varible data.

#

or is that only the master?

#

and there is no way currently to change it unless your a master correct?

fiery yoke
#

Do you know the difference between master and owner?

light fjord
#

dude..

#

Master = Owner.

fiery yoke
#

No

light fjord
#

says so on their wiki .

fiery yoke
#

Where?

light fjord
#

or not wiki

#

The owner is by default the master, and it can only change if

#

just taking their words

fiery yoke
#

Yeah but master is not synonymous with owner

light fjord
#

doesn't matter.

#

its the same princible.

fiery yoke
#

It does matter for a lot of cases

#

There is only one master, but there can be multiple owners

light fjord
#

what matters is that u cant even sync a string. that is added locally by a local person and send it.

fiery yoke
#

Yeah you cannot directly send data right now, without a complicated setup.

light fjord
#

how do you even display the correct users name atm? for everyone unless you do the onJoin event.

fiery yoke
#

By using a complicated setup. I dont know where youve seen that

light fjord
#

cause if you network Networking.Localuser.display name then mhm

#

in pretty much every world there is

fiery yoke
#

For the Local player its easy

light fjord
#

yea i know

fiery yoke
#

but doing it for other players is not so easy, depending on what you want

light fjord
#

kinda need it to show to everyone.

#

mh

worthy beacon
#

is there any reason why GetComponentsInChildren would be inconsistent? somtimes it grabs all the objects i want it to grab, and somtimes it only grabs the first couple, and i dont know what causes the difference

light fjord
#

is it even possible to attach a gameobject to a joined player?

fickle stirrup
#

@light fjord onPlayerJoined spawn prefab-gamepbject, on each Update move that gameobject via player's position, playerjoined is local so everytime you connect somewhere - everyone is joining for you, and you join for them

light fjord
#

@fickle stirrup wont this cause a issue? with performence or network lag?

worthy beacon
#

@light fjord i thought so as well, and ya its more performance intensive then parenting an object, but its not a massive hindrance

light fjord
#

well since i got like 16 players that will spawn one i imagine so?

fickle stirrup
#

@light fjord that should be more performant than trigger method of spawning object and attaching them to Canvases of players via standard asset scripts which also calls each update and etc
actually you getting players position which also you do automatically each Update, so you just takes stored-received on your machine properties

fiery yoke
#

It solely depends on what you need

plush wadi
#

What does someone use to get the location of controllers? I know how to get bone transHUD or controller. Anyone got the functon name?

#

Also @fiery yoke where do you get your knowlege of master and owner from? The lack of a guide on that has caused most of my woes

fiery yoke
#

Ive been developing stuff for VRChat for almost a year and a half. Plus general knowledge of game networking

plush wadi
#

So why not help write some docs since they don't exist?

#

Seems like the only way to know anything is to ask people who don't like repeating themselves

#

Like it's not possible without hours of fiddling and days wasted currently to even learn what these terms mean

fickle stirrup
#

you can get loc of player hands via playerapi.GetTrackingData if i'm correct, need to change head to left/right hand

plush wadi
#

I still don't know what owner vs master actually means, how they're set, and when. Or when sync variables actually sycn and I've been messing with this for almost 4 days strait.

#

Thanks @fickle stirrup
The function I found is equipedPlayer.GetTrackingData(VRCPlayerApi.TrackingDataType.Head);

fickle stirrup
#

yeah, without head not know which one but hand :p
master is only one on instance, and owner you can change for the synced object, something like this but it's 10% information about it i wrote idk

plush wadi
#

and there's only one master for ALL synonomous objects liked from different clients by a network ID right?

fiery yoke
#

Master is bound to an instance, Owner is bound to an Object

plush wadi
#

instance doesn't really mean anything. it's a bad term vrchat uses because every player has their own instance of a "world" running at the same time as eachother it seems. Objects are only linked if they're there from the start by "network id"

fickle stirrup
#

when master leaves another user get that role ๐Ÿค”
what a hard things it is lol

plush wadi
#

however, how does owner matter if an object isn't being synced?

fiery yoke
#

No

plush wadi
#

arn't you always the owner since it's a unique gameobject in your own world that you can move?

fiery yoke
#

Thats not how Networking works

#

The Networking part of VRChat determines who is Owner

#

You can ofcourse move an object, but the owner will send you a message which will force you to update the position back to where the owner tells you

plush wadi
#

but owner only matters for variables of type [UdonSync] right?

fiery yoke
#

The Owner matters for synced variables, network events, and position sync

plush wadi
#

"You can ofcourse move an object, but the owner will send you a message which will force you to update the position back to where the owner tells you
" but this isn't default. You need todo a bunch to make sure this is the case afaik

fiery yoke
#

No

#

That is how position sync works

plush wadi
#

which is something you need to set up

#

so it's not how it works by default

fiery yoke
#

Its literally clicking a checkbox

plush wadi
#

is that not some kind of set up?

fiery yoke
#

Did you never see the "Synchronize Position" Checkbox on an UdonBehaviour?

plush wadi
#

unless you give an object an udon behavior that syncs it, it's considered a different object for every player.

#

I see it, but checking that box changes the default behavior of objects in an udon world

#

objectively, if you check that box, the objects no longer work the same way, and are linked via actions of the owner

#

before that, they don't seem to care who the owner is, and only effect client side changes of the object

fiery yoke
#

Thats not how Networking works.
If a GameObject has an UdonBehaviour it will get a NetID no matter what (afaik).
If you check the Synchronize Position checkbox it will tell the owner to send position updates to everyone via that ID.
Thats all that does

plush wadi
#

What I've found to be helpful, is making sync variables that are only updated behind a networking.localplayer == GetOwner(gameObject) check of sorts. So only the owner updates the synced variable... otherwise even with synced variables i've been getting inconsistent values between clients

#

I don't disagree with a single thing you say @fiery yoke . But that all only applies if you have an udon behavior with that special case checked on it.

Otherwise objects function different than you describe.

fiery yoke
#

What do you mean different?!

plush wadi
#

I have a giant wall of text showing the value of a synced string.
At one point, every time a player joined, the string was different for them.

#

IDK if i can replicate now because I've worked on fixing it, but I was baffled for a while about why every player had a different value for a synced string. Every player only saw their own username on the text wall, and the textwall was literally just defaultText = syncedstring

fiery yoke
#

If you try to set a synced string when youre not the owner, then it will desync, because updates are sent discrete and not continously. Meaning that you will not receive an "update" which would change it back

twilit breach
#

synced strings are bugged above a certain limit. it cant handle all that

plush wadi
#

I think it's because synced variables don't sync until updates begin happening on the object, and there's some ownership weirdness until that point

fiery yoke
#

That too

light fjord
#

how much text can the synced String take?

twilit breach
#

might not even be a bug as much as a limitation

fiery yoke
#

Around 40 characters, there isnt a clear limit but not much

plush wadi
#

Wait, but only the owner can changed synced variables at all, that's expressly stated

twilit breach
plush wadi
#

so that's not true?

twilit breach
#

read the comments at the bottom too

fiery yoke
#

No

twilit breach
#

some good info on that page

light fjord
#

wait only 40 characters? thats barely any

plush wadi
#

"
NOTE - Only the network owner of an object can set a synced variable"

#

WTF 40?

#

I really wish the devs would focus on making udon useable over pretty lol

fiery yoke
#

Yeah only the owner can set a variable successfully

#

if you try to change the value something weird happens

#

There is no inherit check to make sure that youre the owner

#

yeet

plush wadi
#

So there's no consistent behavior for anything and UDON is all guesswork?

zealous mason
#

that explains some issues I've had, good to know

light fjord
#

if someone who isnt the owner change it. nothing happens. its either overwritten or not.

twilit breach
#

this isn't unity stuff, you need to learn photon

fiery yoke
#

Well not inherintly

light fjord
#

if you network it that is

twilit breach
#

its also not just vrc, a lot of it is photon fundamentals

plush wadi
#

it doesn't matter what it is, it's inconsistent, undocumented, and impossible to work with

#

and the "roadmap" to fix is mostly visual stuff it looks like

light fjord
#

eh. Photon is fine. The devs of Vrc is not doing a good enough job lol.

plush wadi
#

like how can you make a VRCHat game where players can't interact in a 3D world?

light fjord
#

how many times do we need to go around just to make something simple happen.

twilit breach
#

im not saying theres an issue with photon, just that you need to understand unity as well as photon to understand network and sync work

plush wadi
#

I do understand them, it doesn't matter if the way tha stuff is stated to work is a literal lie

light fjord
#

the way Vrc has Sync done is kinda stupid.

fiery yoke
#

If you try to change a synced value when youre not Owner it will still locally overwrite the owners value, UNTIL the owner overwrites your value back. Which takes Network time because of Latency and afaik variables are updated only on change, so if the value doesnt change you wont get an update until it does change on the owner side.

plush wadi
#

https://ask.vrchat.com/t/how-to-sync-with-udon/449

This is the ONLY doc and most of it is untrue

light fjord
#

yea i know that

zealous mason
#

It's all still alpha guys

plush wadi
#

@fiery yoke so why are they called synced variables!?!? They aren't synced... they just hope you use them as if they are and function like all the others

light fjord
#

Alpha isn't a excuse for something that has been out for years..

plush wadi
#

Yea VRCHat is going to die

fiery yoke
#

They are synchronized. You just have to pay attention to doing it right.

flint urchin
#

No its not.

plush wadi
#

there's no excuse for the incredibly poor support and doc

#

you can't expect people tp play a game when they need to build a game from scratch with no docs and code that doesn't work even how it is documented for years

fickle stirrup
#

udon is alpha, one person doing it, maybe need to wait 3+ years lol, if i'm correct somewhere

plush wadi
#

everyone I talk to who makes worlds sighs and says "yea but it's kind of pointless now"

light fjord
#

like for instance how can they have such a massive oversight, in terms of making teleporting every player who touches a trigger and put into a roster so hard?

flint urchin
#

They are more people working on Udon.

plush wadi
#

@fiery yoke play attention to what exactly? The DOCS literally lie

fiery yoke
#

They are not lying. They are just not very detailed

plush wadi
#

WHY?

twilit breach
#

they assume you to look at unity docs and photon docs

plush wadi
#

Why after years are there Literally NO DOCS

#

that's the first step in developing anything successful

fiery yoke
#

Because writing good documentation on a product that isnt finished whatsoever is hard

flint urchin
#

Can't add docs before something has been created

plush wadi
#

It's not hard

#

it's the point of Docs

#

you document what's not finished

#

hence doccumentation

twilit breach
#

it says the issues with syncs in that page?

zealous mason
#

as a dev, docs are last, you can't write code then fix the docs, then write new stuff and fix the docs, its never ending

plush wadi
#

I work at a fortune 500 company and the first thing you do is document what you want

#

then you add the caveats to the docs

zealous mason
#

the caveat is its alpha

plush wadi
#

not an excuse