#udon-general
59 messages ยท Page 14 of 1
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
Yea, but I only need the hud dupes for ones I want everyone to see right? Not just the client player
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
So if i have a counter, I need to make it a sync variable?
yeah
this queue will probably end up being used by only one player at a time huh? XD
just be aware only the owner of the object with the sync var can set said var
I'm guessing I should make playersWaiting synced right?
Does the trait handle most of that?
Oh i seeee about the syncvar
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
maybe there is different cases
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
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?
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
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.
but I may have done the timer after switching to onplayer join set var
Yeah
Synced variables take the exact same time as normal
meaning that they wont be ready on Start
oh okay
Just making an object that follows a player seems super simple to me tbh
i gotta get rid of that on player join bit then
I dont know why youd need a queue then
In mine @fiery yoke ?
ye
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";
}
}
}```
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
FollowHUD behavior turns null if you try to grab it right after instanciate, you need to give it a frame
Still doesnt make sense to me at all.
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.
Just the entire way youre approaching this just seems very inexperienced with the way that VRChat/Unity operates.
Explain?
Since there's no docs I'd love anyone who has the knowlege to set me on the right track
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.
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?
I guess? The wording is a bit weird
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?
Why does it need to be disabled?
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?
Yes.
Okaycool
this is my base player tracker
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
Thanks for the chats about object ownership, that has been a confuddling issue for me as well
The phasing of objects etc
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?
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
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
If you dont need it, then it will only add more complexity
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
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.
@grave cloud https://ask.vrchat.com/t/walkable-udon-vehicle-how-to-udonsharp/829
Is this the kind of thing you want?
I created a vehicle script that moves the local player along with a vehicle movement (no matter if animated or not) as long as the player is inside the collider box of the vehicle. It preserves the player rotation so that a vehicle does not rotate the player (to avoid motionsi...
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
try Update instead of FixedUpdate... weirdly i find fixedupdate to be way more jittery
i mean you may already be, but just a thought
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
Isn't it generally a bad idea to GetComponent during Update?
Yes
Eh, if you need to you need to, but try to do it in Start if anywhere
Yeah looks like that could be good for optimizing that platform routine
you just can't always in start given how udonbehaviors can take a second to load
Oh no way
Thats not how that works
That probably explains a lot of the issues I have been having
UdonBehaviours Start are definitely after Unity has initialised all components
Not if you VRCInstantiate
Yea, that's what that means
Start doesnt happen in the same frame as you instantiate an object
Start happens once the object is initialised and ready
Then youve done something weird since it has always worked for me
๐คทโโ๏ธ
You cannot instantiate Prefabs with UdonBehaviours btw
what do you mean 'cannot'
It's currently broken, correct?
I do, they just take a frame to attach the behaviors
The way prefabs are serialized clashes with Udon
hence my weird queue
you need to add the prefabs to the world descriptor, it works for me
Welp then its just the UdonBehaviour that is broken
@plush wadi you mean add the prefab as a child gameobject set to disabled?
No there is a section in the world descriptor for dynamic prefabs
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
What is the purpose of the Dynamic Prefabs section?
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
Can't believe I have never seen this ๐
I only found it because I watched a youtube vid haha
Oh nice, can you plz share the link to the vid if you can find it? I would like to watch
This tutorial shows you how to make a spawn a prefab object into your world, set a delay on a button so that players cannot spam the spawn action, individual object deletion, and delete all.
There are many ways to do things in VRChat, and this is only one of them. With this m...
yea~
Cool! My swimming hud dispenser is working as intended I think.
https://vrchat.com/home/launch?worldId=wrld_f6bfb923-50fa-4db7-a8b8-93b46a8059c6&instanceId=0
could someone join here and maybe help me check?
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
the wet and dry worked i just thought this might be a funny picture
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
are the huds going to be used for animations
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 .
mhm how come after interacting with something it breaks everything else? like cant click on anything or so
well the pick me up one adds a colider around you the size of you
i'm wondering if it blocks other colliders
yea, it turns on a collider
what collider?
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.
what do u think..
i said
when i interact with a clickable button
everything else breaks,. including the toggle
and triggers.
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
i do use udonsharp
oo @sharp fossil VRCSDKBaseVRCPlayerApi.__TeleportTo__UnityEngineVector3_UnityEngineQuaternion__SystemVoid'. ---> System.NullReferenceException: Object reference not set to an instance of an object. this is the problem
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
Is it possible to synchronize a livestream with a world using udon?
i hear its possible.
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?
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..
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?
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
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
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
assuming what your doing is doing a network event to do Network.localplayer.displayName, ya thats gonna show everyone their own name
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?
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
ah. so you do have to go that round about way.. dangit
All will mean all clients for that object will play that method
i was doing that already.
if you do owner, then only the person who owns the object will trigger
hmm so if i i want everyone to see the same i gotta do all ye?
ya
and lemme get this fcorrect Owner = the one who triggered it?
or the one who owns the object?
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
is there anyone by default that owns a object?
master by defualt owns everything, you have to transfer ownership
ahh
okay so i dont wanna have anyone own anything.
so i assume i just dont transfer ownership
by default the master will own everything
you cant unbind ownership because ownership is required to do anything in sync
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?
Can somebody help me I cant jump for some reasons in my world I made today?
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
thx
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?
does SendCustomNetworkEvent send the event to everybody including the person who sent it?
yes if set to all
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?
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
I'm guessing I somehow use UdonBehaviour.SendCustomNetworkEvent() but I'm not sure how to specify to enable an object with it
u# or graph
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...
oh these are objects you're attaching to players?
yea, usually. But not 'attaching' in any way VRCHat knows
yeah jut positioning it to be on them
just mapping their transform to the player location
does every player in the instance get an object when they join
or is it a finite number of pre defined objects
In this case, it's a finite number of objects (30) managed by a pool
ahh yea
thats actually exactly what I'm working on right now XD
haven't got it yet
I have it pretty much working. But only the person who enables the item can see it yea
I think the issue is you can't change ownership of an object while it's not enabled
ahh nice
the item this function is on is actually active at all times. The hud has a sub item it enables and disables for visibility
ooh I see
haha
I'm using a single object and looping through it's kids to collect the pool items haha. Was surprised that worked
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
yea I don't think that's the best way ๐ค
behaviour.SendCustomNetworkEvent(Common.Interfaces.NetworkEventTarget.All, "hide" + thisThingsNumber);
xD yeah
there must be a better way
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.
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
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
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.
I think that's a bug
so i got it to appear! Now I just need the tracking to update locationwise
What was the solution?
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?
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?
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
What is the difference using SendCustomerNetworkEvent vs. calling the function directly?
Calling it directly will just execute it locally
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.
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?
could you send a picture of your code/nodes?
custom event: Enable; send custom event: Enter; rename one or the other
Ah okay
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.
I see
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 ?
are you able to mark it as a trigger or does that break the raycast?
(public bool Collider.trigger)
you could probably put it on PickupNoEnvironment because pickups go through the player yet still get raycasted (i think)
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.
Anyone know all variable types UdonSynced supports syncing of?
i would assume only primitives but that's probably wrong
For some reason this isn't working, the activation of the Mesh works, but turning it off does not.
I'm assuming in goofing up with either comparing or grabbing the controller inputs.
Anyone able to help?
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
Nope
seriously the problems udon has with Sync is just annoying. makes one not wanting to make a map..
could a few people test this bug in their worlds to see if its universal or just my build? https://www.youtube.com/watch?v=vK5SqFBlV2Y&feature=youtu.be
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
Lol that is ridiculous
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
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
that's also a fresh world i tested it in, both the sdk and the project
if anyones on the canny and they get the same error start upvoting it here so they see https://feedback.vrchat.com/vrchat-udon-closed-alpha-bugs/p/pickups-break-on-teleport
it's really kinda gaming breaking for anything involving smacking stuff
ooh yea i had that problem to Dinky.
alot of things seems to break if u pick up stuff or interract.
gg devs
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?
yeah
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.
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
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
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?
Is there something similar as setting a custom pose for sitting in Udon/SDK3?
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
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.
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)
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.
Is OnStationEntered/Exited not working...?
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
Does anyone know how to stop pickup drop from crashing behaviors if the player isn't currently holding a pickup?
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
Does anyone know how to do a teleport trigger...?
I copied it but my trigger does not assume any location to teleport
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
Is there a way to define or know the execution order of udon behaviours ?
Your material property block is null
Call the constructor of MaterialPropertyBlock and assign the result to your variable
Yeah, but if youre not needing it anywhere else then you dont really need to save it in a variable
bc I'm still getting the same error
Are you sure it compiled correctly?
So this would work?
yes
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
As long as you dont need PlayerApi or other VRC specific classes it will
Then I guess it didn't work๐
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."
You have to get a reference to the MeshRenderer and yeah
OK XD
Another stupid question? How do I get object itself?
rn I'm using this but I think there's probably a better way
No This is the right way.
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...
Ohh yeah then you actually do need to save it in a variable sorry
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 sure - GameObject.GetTransform, and then Transform.SetScale
Ok
ah, I forgot to save the script, saw an error with Scale and though I messed something up xD
I need to get a blendshape from a game object, how to get type properly? x)
Noodles let you do this but no idea if it actually works
ok, got it
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?
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
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
Much of that is done through PostProcessing zones, basically boxes of PP effects.
Ohhhh okay, thanks! Hopefully that will help me get started, never heard those terms before so it's a jumping off point ๐
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
Assets > Export Package > All (Include Dependencies). New Project > Import VRChat SDK > Import U# > Import Old Project Unity Package > Load Scene.
Anyone know a way, compatible with UdonSharp, to delay the execution of a function by a few seconds?
thanks!
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
How would I attach something to a player's view?
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
How to check how heavy on performance is an Udon script?
@twilit breach Thanks, also found this (https://github.com/TheHelpfulHelper/UDON-Collection/tree/master/THH_DelayService). Will probably use a mix between both methods depending on how well they sync with network.
Is there a way to change the execution order of udon Scripts ?
wdym?
like a little more on the context cuz i could think of several fits to the question and idk what your situation is
https://docs.unity3d.com/Manual/ExecutionOrder.html might be a good reference if you haven't looked at it recently. I come back from time to time when things fire in an order that doesnt work for what im doing
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?
Anyone seen this error? I get it when publishing my scene to VRChat's servers. However, the error doesn't actually break anything.
@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
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?
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
@raven peak Would an object list rather than a VRCPlayerAPI list be a good solution in this scenario?
@chilly aspen what are you using this list for.

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.
do the objects have to be owned by the person in the list? or will it all be local?
@fiery yoke would you know what the IsObjectReady and IsNetworkSettled is?
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.
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.
Well an Event takes some time. I dont know what youre doing
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
@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.
btw i assume everything local does nothing to the network right?
so if i calculate something locally it wont count towards the limited update ?
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.
@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
@gleaming fractal yes no and yes. There's no direct normal output method, however OSC is coming (https://feedback.vrchat.com/vrchat-udon-closed-alpha-feedback/p/midi-and-osc-nodes). There's a method I'm currently using to output to debug, and use an external program to read the debug file, I'm making haptics =3
@twilit breach i am not using charactercontroller? through?
what causes the trigger? a player walking into it? or do you have another object colliding?
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
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?
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
its default. layers but i am making sure that if other returns null then its the player
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
ye. but why is that? how do i prevent it doing that
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
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.
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
so i changed everything to Localplayer Layer only now
lemme test this and see
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
so unityengine.charactercontroller? and make sure its only that?
and i cant get the object of whatever collides so it gotta be a String match ye?
kosher?
so i just do a other.gameobject.gettype.tostring ye?
i do ye
oh ye idk the full conversion but whatever matches my noodies
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.
?
the floor dissapeared when i did that lol.
idk if it does render camera stuff
wait
no it would
oh are you using the default player local layer?
yep
cuz I use a new made one that is only one check box
my noodle says that, dunno if its different from other.
the default player local which layer does it collide with on your end?
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
mm k
is this happening on collision or a trigger enter?
trigger
kk
only PlayerLocal
Hey any reason as to why I cant open the udon graph?
dunno, was it working earlier?
It was yesterday
@twilit breach mhm after i gave the trigger zones the Localplayer layer it no longer triggers
what was the other null stuff or anything else that happens in your script?
checking other is null
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
yea. it gives me a null reference cant do other.gameobject
oh
it only has UnityEngine.GameObject
its a class. the other one is a instance of it
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
so yea that works. now i just need to see if sync works
hit me up if you get sync troubles, I've gotten it all figured out at this point
@twilit breach omg it works.. its kinda stupid that the default layer settings for playerlocal hits everyone.
@twilit breach thanks mate ๐
yeah no problem, happy world making ๐
I cant open the udon graph anymore to do the visual scripting, does anyone know why?
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?
@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?
@full basin Are you using an Animator or Animation component?
@zealous mason thanks for the info! that's exciting
totes
@floral dove its because in the udon behavior script in the inspector window, it changed the drop down menu option that was selected
@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.
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
Yeah that is the one big advantage with how I do Player collision
@fiery yoke OSC will be bi-directional when it is integrated into Udon
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
ahh so its not possible yet
Well not really no
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
There is other approaches to the "player enters zone => do something" problem tho
yeah I'm thinking I'll just redo it by checking player coordinates on update
since it's a static trigger
Hmm thats odd. I thought that as long as a raycast starts inside a collider, it will not actually collide with it
hmm is there a difference if the target is also inside the collider maybe
Checking player coordinates on Update can get pretty expensive if you scale it up
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
@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
Did you read what momo said? They are planning on making it bi-directional
oops sorry missed it reading!
this is my thing, I'm trying to make it load the avatar pedestals only when people go to the room
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 :)
It also allows for crazy setups
Think of a DJ party, where they have a custom OSC listener
imagine just an github posted arduino code which takes that OSC and controls some fairly easy to build or 3D print perifferals.
what's OSC?
open sound control
ooo
Its a very simple message protocol
usually used with music gear or for software sending/recieving commands from other software
Used mostly for synchronizing audio data to other events like lighting and effects
But you can use it for almost anything
i use it with work from time to time. Since i do entertainment installs
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
im working in anticipation of some kind of world video sync I've been hearing about. A show triggered through livestream
that'd be cool ๐ฎ
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.
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
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?
no way to save stuff yet
Unfortunate. Creating hashed variable dumps is probably the only way to keep persistence then
yep. depending on how complicated your world is you could aways use an oldschool video game style password haha
how can i ajust the graphic settings?
like quality? or post processing?
i hold shift and click play nothing happens
@gleaming fractal thats awesome, i'd love to see that
this might be the wrong chat. try user support. but, holding shift and pressing the play button in steam should work
that is the problem it doesn't work ๐ฆ
I'll troubleshoot with you over in user support
@floral dove @fiery yoke I'm using a animated rain texture from the assetstore; the asset is using a custom script
Custom Scripts are not supported. You have to either redo the script in Udon (if possible) or you cant use it.
ok thank you
how would I take the C# approach to udon?
Are there any good materials/animations for a rainy window?
@hoary ocean There is a custom compiler written by Merlin: https://github.com/Merlin-san/UdonSharp/releases
thanks!
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?
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
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
Nice Idea Shaun ;w;
Is it possible to make custom "chairs" (sitting position) in Udon worlds?
is udon worth it for a horror map
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
hello! was wondering how to set a PickupObject to NotLocal?
i couldnt seem to find a Setting for making it Local or world
@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?
@cunning crown Add an Udon behavior and check the sync position option
thanks guys!
@hushed gazelle I tried to find the prefab for the custom avatar override and it isn't present in SDK3
@foggy raven Copy it from another project, you can't make avatars with the current SDK remember.
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
Hello everyone, can someone explains me more what is the ownership system and how does it works please?
This script is a great resource to understanding ownership: https://discordapp.com/channels/189511567539306508/657394772603830360/707837915719270460
Okay, thanks, ownership is for example to not let someone else take the object you have picked
There is no object sync in Udon system.
Can you tell me what to do?
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
How can I sync the pickup objects? @twilit breach
are you familiar with how to add components in unity?
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.
SDK3 doesn't have the override to do custom sitting poses natively ;w;
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 You are my hero. Thank you
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
@twilit breach there is no way to do custonnetwork event with parameter ye?
Not right now.
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?
Is the owner teleporting the object?
@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?
That is pretty much impossible. Depending on what youre doing there may be a work around
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
SetOwner takes networking time
normally itd be fine but its apparently jumping so much it sometimes breaks random destructibles, so it must be going all over
Meaning that teleporting the object right after leads to desync
oh
right
guess ill make a 2s delay and have the vending machine play a long dispensing sound xD
was good
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
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
so atm we cant get other peoples ID cause its all local and you cant show another person id etc?
playerID is an incrementing index. You cannot get a users "real" id
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?
i know. but thats also the PlayerID i count on. whoever joins has a ID assigned
What exactly is your point?
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?
I have no idea what youre trying to describe xD
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
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
but then the problem still persist. how do i display who signed up?
you doing some sort of hitbox assignment then tping players?
and adding to a roster
yea
sorta
like imagine
when u sign up to something
and your name gets written down
this is just for cosmetic effect.
you dont want my solution, its bad
others have done something to get player ids on a roster UI list
I have 8 separate triggers, each corresponds to its own UI and each is in its own area
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
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
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?
whatcha mean sync value?
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
hmm can i somehow force update a network event?
does anyone know if corutines are supported?
No. Udon is not asynchronous
its not?
As far as I know it runs on the main thread synchronously
Why does my Compile Break all the time?
like it stops Compiling and i have to restart Unity
@fiery yoke @twilit breach do any of u know how long it takes to change master?
Well the ping of the person sending the message to the photon server
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?
Well yeah and no
You can send a custom event to the owner
but you cant pass a value with the event
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?
You cant "send a string"
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?
I have no idea what youre trying to describe
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
There is no overly complicated way to do that right now
wtf. so when sending something to the master it wont actually change anything on the masters end?
How do you want to "send something" to the master?
An Event is an event
Theres no way to send something with it
you can just tell someone that something has happened
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?
I dont think you understand how Networking works currently
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
You cannot send any data
you can just tell someone to invoke a method
a method without parameters
thats exactly what i am saying atm.
it just tells the other user to invoke a method.
not really copying the master
Thats not what is supposed to happen
For synced variables it does
Synced variables will send other users the variable data
if youre the owner
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?
Do you know the difference between master and owner?
No
says so on their wiki .
Where?
or not wiki
The owner is by default the master, and it can only change if
just taking their words
Yeah but master is not synonymous with owner
It does matter for a lot of cases
There is only one master, but there can be multiple owners
what matters is that u cant even sync a string. that is added locally by a local person and send it.
Yeah you cannot directly send data right now, without a complicated setup.
how do you even display the correct users name atm? for everyone unless you do the onJoin event.
By using a complicated setup. I dont know where youve seen that
cause if you network Networking.Localuser.display name then mhm
in pretty much every world there is
For the Local player its easy
yea i know
but doing it for other players is not so easy, depending on what you want
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
is it even possible to attach a gameobject to a joined player?
@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
@fickle stirrup wont this cause a issue? with performence or network lag?
@light fjord i thought so as well, and ya its more performance intensive then parenting an object, but its not a massive hindrance
well since i got like 16 players that will spawn one i imagine so?
@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
It solely depends on what you need
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
Ive been developing stuff for VRChat for almost a year and a half. Plus general knowledge of game networking
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
you can get loc of player hands via playerapi.GetTrackingData if i'm correct, need to change head to left/right hand
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);
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
and there's only one master for ALL synonomous objects liked from different clients by a network ID right?
Master is bound to an instance, Owner is bound to an Object
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"
when master leaves another user get that role ๐ค
what a hard things it is lol
however, how does owner matter if an object isn't being synced?
No
arn't you always the owner since it's a unique gameobject in your own world that you can move?
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
but owner only matters for variables of type [UdonSync] right?
The Owner matters for synced variables, network events, and position sync
"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
Its literally clicking a checkbox
is that not some kind of set up?
Did you never see the "Synchronize Position" Checkbox on an UdonBehaviour?
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
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
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.
What do you mean different?!
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
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
synced strings are bugged above a certain limit. it cant handle all that
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
That too
how much text can the synced String take?
might not even be a bug as much as a limitation
Around 40 characters, there isnt a clear limit but not much
Wait, but only the owner can changed synced variables at all, that's expressly stated
so that's not true?
read the comments at the bottom too
No
some good info on that page
wait only 40 characters? thats barely any
"
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
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
So there's no consistent behavior for anything and UDON is all guesswork?
that explains some issues I've had, good to know
if someone who isnt the owner change it. nothing happens. its either overwritten or not.
this isn't unity stuff, you need to learn photon
Well not inherintly
if you network it that is
its also not just vrc, a lot of it is photon fundamentals
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
eh. Photon is fine. The devs of Vrc is not doing a good enough job lol.
like how can you make a VRCHat game where players can't interact in a 3D world?
how many times do we need to go around just to make something simple happen.
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
I do understand them, it doesn't matter if the way tha stuff is stated to work is a literal lie
the way Vrc has Sync done is kinda stupid.
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.
https://ask.vrchat.com/t/how-to-sync-with-udon/449
This is the ONLY doc and most of it is untrue
yea i know that
It's all still alpha guys
@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
Alpha isn't a excuse for something that has been out for years..
Yea VRCHat is going to die
They are synchronized. You just have to pay attention to doing it right.
No its not.
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
udon is alpha, one person doing it, maybe need to wait 3+ years lol, if i'm correct somewhere
everyone I talk to who makes worlds sighs and says "yea but it's kind of pointless now"
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?
They are more people working on Udon.
@fiery yoke play attention to what exactly? The DOCS literally lie
They are not lying. They are just not very detailed
WHY?
they assume you to look at unity docs and photon docs
Why after years are there Literally NO DOCS
that's the first step in developing anything successful
Because writing good documentation on a product that isnt finished whatsoever is hard
Can't add docs before something has been created
It's not hard
it's the point of Docs
you document what's not finished
hence doccumentation
it says the issues with syncs in that page?
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
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
the caveat is its alpha
not an excuse