#udon-general
59 messages · Page 43 of 1
Sorry I'm late to the convo, I haven't tried an SDK3 version of that yet. I'm not sure how to integrate Udon behaviors with editor scripts at this point, sorry 🙏
@mossy atlas @unborn hornet The better way would probably be to make the text on the cards UIText rather than a texture, and have a long array of all the possible card sentences stored in another Udon object. That way you only need ten physical white cards per intended player that can each be remotely-assigned a randomly-selected sentence.
🤔 good points, not far enough I think...
I'm trying to prototype logic for waffle's use case atm though. We'll see how it goes.
A nice simple one of here have the the class name or not its not a thing. Set player capsule size. Anyone? or get player collider? That I can then set . Disable player capsule and add new stuff. Or even odd work arounds like with the old (just use the combat system). Before I spend hours digging thru the player api.
Goal Make loli capsual smole, make normal people normal, make big people... normal they dont get to be big.
I need to sync a float for each player in my instance, and synced arrays aren't a thing right? Do I have any options besides making a ton of float vars and hoping udon sync doesn't choke
You could bundle them by combining the data into a single string and parsing them once received.
Depending on how much precision you want that can get more expensive than just syncing floats directly
hahaha, I remember picking through the 8ball source looking at packing up the gamestate and thinking "oh good thing I'll probably never have to do this"
It's a balance. A choice that is made with one eye closed. Sometimes both. It's hard to tell between the two with Udon sometimes.
Well its relatively simple
As long as you stay within ASCII every character is a byte
plus some overhead per string in general
So that means you have 4 ascii characters, before you can basically just sync a float anyway. Plus you need some seperator character etc.
ever update a world and the viewpoint changes on avatars..?
ah kk
i am still very new to udon do you know any good tutorials i can follow for that?
I don't know of any tutorials to do this exact thing you want, but you could start by learning the basics of Udon - this is a pretty easy thing once you have a start with how to make stuff.
https://docs.vrchat.com/docs/getting-started-with-udon
i was talking about making a object with two pickups
i know enough to get by i know how to use events and triggers and basic network events but the only way i knew to make a object possible to pickup was to use a vrc.pickup
A VRCPickup will not allow for two connection points, so you'll need to handle the object movement yourself. Learn the basics of how to work with Udon and I'm sure you'll be able to handle this.
ok
how would i do a safe reinstall of a project with udon after installing the new SDK3 wrong?
I kinda went too far i think to fix all these compiler errors
Need help ASAP, can’t get audio in a world for quest users. Any help would be great.
Please DM me if any knows a solution
fixed my issue disregard
So I updated to the new SDK3 to see if that would solve my world problems but now I get this issue when trying to run my world:
[UdonSharp] Checker.cs(47,52): Udon runtime exception detected!
An exception occurred during EXTERN to 'VRCUdonCommonInterfacesIUdonEventReceiver.__GetProgramVariable__SystemString__SystemObject'.
Parameter Addresses: 0x00000019, 0x0000004D, 0x000000CC
Object reference not set to an instance of an object
How would I make a pulsing light on to the blade of a sword? Where only the blade pulses as if it had an out glow to it
Ok so I had probably the worst idea for a spaceship/arwing vehicle thing. I have everything working using a chair and a small ui to control it's speed, but my only problem is how I would rotate the ship using the player's input or view. Is there any way I can make this possible (hopefully without throwing up in vr)?
is using melonloader for my bhaptics vest bannable
Officially, using any modded clients is a ban risk.
Is there a way to multi-object edit udon Behaviour ?
Probably would require the editor scripting via u#.
Other than that, I dont think so.
is there currently some kind of bug with udon? everytime after upload it strips all my scripts so its just an empty world, for example the usharp video player
@dawn oxide cut the blade off the sword and add the mesh in the same place as the original blade, then scale up like 0.01 or whatever and apply a material with a lightning bolt shader or something lol
Toggle visibility to turn the effect on and off I guess
Has anyone ever had issues with Udon and Bakery + Bakerys RTLighting ?
This combo worked fine for me on a recent project, what are you seeing?
Do you get any new warnings or errors in your console? Haven't seen this issue pop up.
@floral dove seems like something was messed up with my cache, so i tried to reimport the assets i need but that made it even worse, so i made a new project and started to migrate 😄
guess it was some kind of issue with umodeler
Hi everyone,
I want to "unlock" an object so anyone can change it and not just the master,
Or such like transfer ownership to whoever is using the object.
Example:
Player A is master.
Player B tries to change the value of object but it wont register because Player A is master.
If player A updates the value of the object, Player B will see the change as well
How can I do this?
Thanks!!
use VRCNetworking.SetOwner to change ownership of a GameObject to another VRCPlayer
Possible to send you a DM?, I use something similar today but can't get it to work
im new to world making i made a mirror toggle for my world and im trying to create a separate one for another mirror in my world and its not letting make another interact node on my udon graph nor do i know if you can make another graph or not
Can you just add the script as an udonbehavior on the other mirror and just leave it?
yeah
think of the whole thing like a single prefab
and copy the whole shootin' match over
wow it's really not obvious at all how to do audio
sorry, I only answer questions in the open so that others can learn
so I would like to play the audio source (if it's not already playing) when any player enters the trigger zone
does this look right?
and the audio source distance is set to the limit of the trigger
I think you want to use OnPlayerTriggerEnter there since it's not an object colliding with the player
https://docs.vrchat.com/docs/player-collisions#physics
Udon has three ways to detect when a Player and an Object Collide - Triggers, Physics, and Particles. Triggers If you want to detect when a player has entered or exited an area, your best bet will be to use the OnPlayerTrigger events. There are three of these: OnPlayerTriggerEnter is called when a ...
was working on possibly making a nerf gun work in a world where people can pick it up and shoot
I have a gun just dont know how to make it sync etc
Is any PostProcessingStackv2 stuff exposed in udon?
they're Whitelisted for use in the scenes but direct control through Udon is not yet available. You can make an Animator that changes properties and control the Animator through Udon.
https://feedback.vrchat.com/vrchat-udon-closed-alpha-feedback/p/post-processing-support
FYI - just added a bunch of new docs about VRCPlayerApi nodes. If you want to learn more about how to interact with Players, check them out!
Understandable!
VRCNetworking does it work for Udonsharp too?
as a side note with the combat system under review. if it is removed we would need a way to get the scale of the players camera. currently the combat system is the only to get that.
thanks for the note. Does that even work right now? Can you demo how you get that scale?
i use it for my mic detector. one sec.
Yes, U# uses the same Networking system as the Udon Graph - everything gets turned into UAssembly
I re parent a object to the players head and other objects have a constraint with the re parented object as the source.
If I want to give someone ownership of a slider,
Pasting this in a U# script should give them owner access,
But for me that isn't working
Networking.SetOwner(Networking.LocalPlayer, gameObject);
I am also using an Event Trigger that calls on the SetOwner
Ah - nice trick! Thanks for sharing. Yeah, finding that Combat stuff is mostly non-working but won't remove anything until we have replacements for functionality. I think a more direct route to get this number from the VRCPlayerApi would be a better method. Also want to support ragdoll/un-ragdoll and a method to add the special colliders
It's a matter of timing for now. Ownership will be transferred, but not immediately. You can listen for OnOwnershipTransferred to get notified when that player is the new owner.
I tried this with a friend in a server, He took control of the slider, Gave it 30 seconds but I was still the owner of it, I don't think the timings could have that much delay, So I must be doing something wrong I think
hm - definitely shouldn't take 30 seconds. it usually just takes a few frames.
You are transferring ownership on the player who owns the object, right?
You can't just have anyone try and claim ownership over something. The person who already owns it has to transfer it.
Currently the master of the world 'owns' the object.
I want anyone that walks up to this GameObject be able to change the value of it and reflect it into the world
Yes, I know.
You need the master to transfer ownership of the object somehow; but you can't have the client try to take it. The owner has to transfer it.
If it's something interactable, it may be easier to just fire an event when you interact with it instead.
is there hand tracking in vr chat
this channel is for discussing our Udon creation system. If you're asking about native hand tracking on Quest, that is not currently supported in VRChat. Please read #faq for future questions.
If someone triggers logic that contains an ownership transfer to local player, the ownership is transferred to said localplayer regardless of previous owner.
This is not true. A non-owner can Request Ownership and it will transfer to them.
Guess I had too much faith in VRC having even the most basic network security...
You write that security yourself into the logic.
How can you write security if anyone can just say "my object now"
Not everyone wants to restrict ownership transfer like that.
You check for player ownership BEFORE setting the new owner.
the upcoming Reliable Sync system has a way to approve/deny ownership transfer, and allows this all to happen on a single frame. For now, it's the wild west, yes.
👀
That has nothing to do with someone sending malicious packets
Never said it did?
My point is that in the current system there's no way to prevent malicious behaviour. There's no security
There is, but you have to learn how to implement it properly.
As said, wild west. Udon is still in alpha. Chill brah.
if you don't add a method that performs ownership transfer into your objects, then no one can transfer them. Or check for some other flag you set before allowing a user to request ownership.
we've integrated that check into the actual transfer in the upcoming Reliable Sync system, and I'm sure people will complain that it's now too complicated 😛
Yea. Ownership transfer is an explicit action defined by the world creator. With the exception of pickups having certain implicit stuff, but can be mitigated partially if done right.
You're missing the point that I'm not talking about the world creator putting something in to transfer
I'm talking about someone walking in with a client and sending a packet saying "my object"
Thats... not possible? afaik.
All they can do is send custom events that are exported in the udon VM.
Which are defined by the world creator.
Yes, it's possible. Because the game has some method of transferring objects. This is going to send a packet that says "this object is mine"
You literally just have to replicate that packet
Have you actually done/seen that?
or is this speculation?
Cause if that works, that's a bug and you should report in on canny.
That's...not a bug that's just how it works when you have no networking level verification for object transferring
we've blacklisted built-in programs from being called via RPC. You're getting pretty close to writing a how-to on attempting to exploit the system, I don't think we should go further down this road. If you have knowledge of an active exploit, you're welcome to contact us privately.
^
...heh
I don't know of any implementation done in practice, I'm just pointing out an obvious glaring flaw in the networking that anyone could do if they aren't afraid to manually throw together some packets...
At any rate, the new system fixes it anyways, so I'll be looking forward to that.
It's not like VRC hasn't had rampant issues with this exact thing before. Remember when clients could change your avatar?
Eh, I'll drop it.

Hey @floral dove , I am curious why you would mark https://vrchat.canny.io/vrchat-udon-closed-alpha-feedback/p/allow-enabling-and-disabling-of-arbitrary-components as complete when it is currently not possible to enable and disable arbitrary components without UnityEngine.Behaviour.enabled being exposed even after it being pointed out. I normally don't like to ping VRC staff as I understand your time is precious and it is generally frowned upon, however it is not the first instance I have seen where a post would be marked as complete when it has not fulfilled the original poster's request, and comments on the post are usually not addressed after the decision is made to complete or reject a post. Currently the closest method of enabling/disabling components is https://pastebin.com/XhVrUfL8 which not only is a hacky mess, but also does not support a large number of component types as they are not exposed to Udon despite being valid components to use in a world.
thanks for providing some follow-up information. I closed the post with a comment requesting more information. Now that I have that, I've re-opened it for review. However, ping-ing me here is not appropriate. This is a canny conversation, let's continue it there.
Much appreciated
What does UdonBehaviour RunProgram(string) do?
how is it diferent to SendCustomEvent(string)
UdonBehaviour.RunProgram isn't exposed to Udon so it doesn't really matter, but I imagine SendCustomEvent calls it internally
Right, you can use it from UI events, in that case it does the same thing as SendCustomEvent
Broke a keypad that spawns a teleporter globally via udon behavior. Installed the RTLighting and it broke every teleporters location & says the object isn’t being referenced however it is. Searched far and wide for scripts that could be causing it to crash for hours.
Now on load the keypad being incorrect triggers the teleporter to spawn and the right combination turns it off. I give up for the night lmaoo.
For reference Jdoggs teleporters.
Also package manager doesn’t event detect bakery and showcase a clean way to uninstall. However after deleting things I manually went through its import and deleted everything that could be related to it.
Reinstalled the SDK, UdonSharp & both prefabs I’m using for the keypad & teleporter. The udon behavior script should be fine but it’s being unity. Might just export and redo the whole world at this point.
looks like the array drawing stuff got borked
no worries I just like 3 seconds ago found out you can set it with default value in the variables panel
but it's borked yes
Oh yeah, most array size dropdowns are entirely unusable haha
I guess I has assumed this was reported
of course, I fix them in the Inspector and they break in Nodes. Not likely related, just one of those
moments
if I'm in a node graph that's a component of a light and I'm referring to the current light, do I need to plug anything into instance?
yes - only GameObject and UdonBehaviour can be 'guessed' by the graph.
thx
I thought Transform was also implicit when empty?
had to roll back a bit to find a working version - it should look like this. Will fix.
see that's nice lol
So I have a button that when i press it, it deletes the floor for a "the floor is lava" game. Right now, it just turns it off for whoever pushes the button. Does anyone know how to set it so it deletes it for everyone in the instance?
Also, how to make a video player usable by anyone, not just the owner?
Plz and thank you
Have the script send a custom network event for the event that connects the floor toggle logic.
UdonBehavior -> SendCustomNetworkEvent: All, "MyEvent"
you'll need to transfer ownership of the video player to the person who's going to update it
How to do that? I'm working with the prefab included with the SDK.
Thanks, I will refer back to this later when I'm actually doing it made the mistake of join a Discord and allow myself to be pressured into imbibing alcohol. I'm not gonna try to code while inebriated lol
Networking.SetOwner will transfer ownership of an object to a new Player. You'll have to decide how you want to trigger that.
would just putting a button next it that says "take ownership" work?
with that event attached to it
Y'know I should stop asking questions and just double back around when sober
igoner me for now lol
ye, sorry
@dapper lion so far nothing's working for me, but it is for Temporal so i just have to figure out what's the difference. discord offers less lag though?
Turn off "play on awake" on your audio source, use the Play audio source graph. @pliant spade
what did temporal say?
oops sorry reposted in the proper thread now
How do I know which hand fires Interact()?
Whelp, I guess I'm keeping this function...
Seems to be a CyanEmu problem. Message CyanLaser.
Would i just dm him or something?
I dunno. Maybe he has some bug reporting section somewhere?
For anyone else who finds issues with CyanEmu, feel free to ping me. I'll basically ask about how to repro the bug so I know how to fix it though, so be prepared 👀
Is there any way to, given a URL, load an image from that URL? Like a video player but for images specifically.
In SDK2 there was the badly named "VRC_Panorama", but there is no equivalent in SDK3 (yet)
I see, that's a bummer. Which sources did it allow?
No idea, never used it, only heard about it.
I had an idea for a system in which you can encode the world state into a texture, and let people reload it later by uploading a screenshot of the texture and loading it in game.
I know I can pull it off with video players, but it's a lot to ask people to upload still image videos just for that x)
Yeah that was something I had in mind before as well
But I think its too big for simple syncing
So it could only work as a "Saving" mechanic
For that sculpting world I posted, I already have half of it working. Just missing the loading part
I am encoding the state of sculpt into a texture
And there is ball with a screenspace shader so you can snapshot it with your camera
In actuallity the "uploading" part is the more difficult part.
I would just have people put it on imgur or something, I don't care about that part being feasible
Hmm I see, not sure how you would make sure that it always has the correct format and everything, but I guess thats up to you.
But yeah maybe at some point it will be easier to load resources (other than videos) from the web in VRC.
For the way I am storing the data, it doesn't really matter. As long as the colors are approximately correct, it's fine.
Didn't some guy make a prefab that let you send discord messages to a server from within vrchat
how the hell did that work
no fun allowed x) /s
I get that it seems bad, but what is the concern actually?
If you give someone a way to fuck with you, someone will fuck with you. Web Access is really scary for security concerns.
Hmm, I wonder...
How much of the url they check. If I wrote a custom video player, maybe I could use that
The whitelist is a temporary solution.
How so?
In the end you will have an individual check, where you have to confirm if you want to accept a URL or not. The specifics of that are up to them and afaik not decided yet.
So theoretically people will be able to reject each and every url. So dont build stuff expecting that it will ALWAYS work for everyone no exceptions. Just a heads up.
No harm in trying though. Even if it only works for a while, I don't really care
Yeah yeah I get ya
Ohh yeah you can definitely receive texture data from Video Players. People have done that before.
I'm more interested if it will allow me to get images and videos
Basically how much of the url they check. If it is just the domain
well videos yeah. You can just have a short video thats basically just a still frame.
That's really tedious though, which is what I am trying to avoid
If youre trying to avoid "tedious" in VRChat then I recommend you look somewhere else ;D
I'll take a look at USharpVideo real quick, I can probably get some leads there
the video player just calls LoadURL which then sends a HTTP GET request
Indeed, though I like trying to push the limits of the game
Yeah, then expect tediousness.
A large portion of my avatars have some kind of gimmick, quite often involving cameras
And we all know how those are to use x)
OOohh new idea
Have people take a screenshot, link them to a site that lets them encode it as text, have an input field for them to paste it
I hope the limit on how much text you can put in an input field is pretty generous
You dont even need to link them to a site
you can technically do the encoding yourself
?
and then have a readonly Input field where people can copy it from
yeah yeah I get it
but should work as long as you dont exceed the 10s limit
hmm, I honestly might
I might have to downscale and live with the loss of detail
Something tells me even just iterating over pixels in a 1k texture will exceed that limit
I tried blitting to a 256x screen every frame pixel by pixel once which brought me to 10 fps ingame
Oh yeah the downscaling isn't an issue, I'd just rather not have to
Since you will lose detail
Gotta have to compromise somewhere with Udon ¯_(ツ)_/¯
I might give it a try, maybe I can get it to like 5 seconds or so if I handwrite some uasm
ohh boy
U# still doesn't have very optimized codegen in some cases, I've had to do it before
Last time I wrote uasm was a nightmare, but that was before you could define a label and then jump to it afterwards.
Imagine not having label-lookahead in an assembly...
Simply doing an if-else in uasm itself was basically impossible.
I really wish they had chosen a different method of sandboxing than literally rolling their own instruction set, ngl
Things get really slow really fast
There's a reason most languages that compile to some bytecode also have JIT
But hey man thanks for the tips
ahh shit it looks there might not be anything exposed that will let me get the pixels of a RenderTexture specifically
Only Texture2D and 3D
My only other immediate idea is to write the contents to a buffer in a shader, and then read from that buffer in udon
Tedious but probably doable
Guys
If you wanted to make light rays come from a disco ball, would you use:
A particle emitter
artifacts in png and wave them around and turn them on and off with an animation
3d artifacts like cylinders and use udon to move them around and light them up
A shader
Something else?
Idk if this is a good use of udon or if there's another function that would lighter and easier.
Are you trying to capture vrchat in 360/cubemap video?
I feel like writing a shader too
Nope, just trying to access pixel data of a rendertexture
Ohh someone recently had that issue as well
There are no exposed methods that let you do it as far as I can tell, so I thought I could render to a single face in a readable cubemap
Very illegal technique
The "intended" way is to do RenderTexture.active
Looks heavy based on the documentation
What as in like perf heavy? It's very fast
Is it? Sweet.
Iterating the pixels is what will kill performance
The rendering itself is not even noticable
all rendering goes into the currently active rendertexture
you don't want to give people that power
@wise isle Ohh interesting so instead of using a RenderTexture you render the Camera to a Cubemap manually?
yeas
yep x)
How do you read from the Cubemap face?
ahh it has a GetPixels method
oh for fucks sake
That is genius. Thanks @wise isle
I misread the exposure list
Which one? GetPixels?
yeah
Welp
there goes that idea I guess
still neat that you can do it at all
What about taking the Cubemap and putting it into a shader somehow?
Is that something you can do?
What would the point be?
Then you can maybe write the cubemap data to a different texture
Not sure about graphics stuff, havent done that in a while.
you don't write to textures in shaders
if i may just pipe in, your shader works by taking in the depth camera from different angles right?
why not just feed the video output to the shader directly?
can you check if Texture2D.CreateExternalTexture is exposed?
It's not
Damn.
@viscid reef I'm trying to implement a saving function
I need to be able to access pixel data of the rendertexture in udon
only other way I can think of now is writing to a buffer in a shader like I said but it will be very slow, not to mention probably crash unity when it tries to unroll the loop
oh, i misunderstood nevermind
@wise isle A janky but potentially the only way is to render the content to the screen, and then use Texture2D.ReadPixels
if that is done before the actual content is rendered, you would never see it.
But good luck with that.
Also I guess Texture2D.UpdateExternalTexture is also not exposed?
ye
that actually might just work
I could have the player stand in a sphere with a screenspace shader
and call ReadPixels
Yeah that might work. But would also be terrible for the user xD
ladies and gentlemen
maybe only for a split second
we are in unholy territory
like one frame
nah who cares lol, they just have to go into for like a sec
I see screenspace shit all the time in this game
Just make sure the screenspace shader is really high in the render queue and is ZTest Always
otherwise peoples shaders might mess with it
nah fuck the menu lol
overrendering menu is toxic
Just put them in there for a frame
also you have to gimmicks to do it now since it's on the max render queue
no need to do any longer
this is beyond god
indeed. But VRChat doesnt let us handle it otherwise
I really wonder how it will do with VRC single pass stereo rendering
I'll probably have to make sure to get half the X resolution in vr
"Pixels are read from the current render target"
That might
mean you can also read from a RenderTexture
if youre able to know when it is rendered
hey can someone tell me what vr i shall get
I have no control over current render target or any way to infer information about it afaik
@wise isle You have a Camera that has a RenderTexture. Then have a UdonBehaviour on that Camera GO with "OnPostRender" and then do the ReadPixels call
Not sure if OnPostRender is a callback in Udon or not
looks like it
That might work better than the ScreenSpace shader lol
theres one more issue, I can't create textures at runtime and ReadPixels operates in pixel space
I'll probably have to make really large texture and then only use regions of it depending on screen res
wait Screen.width is not exposed are you shitting me
i wonder what the behavior will be if I just set some larger number
GPU go brrrr
Camera.width / Camera.height
can't access player camera
Any camera that doesnt have a RenderTexture is a "VR" camera
and will automatically adjust to the screen
oh really now
Yeah. And for Desktop the Camera already adjusts to the screen
do you know if in VR the camera will handle single pass stereo correctly when checking those
as in will X be [0; 2*width] or not
this just keeps getting more and more unholy man
When it comes to VR rendering, only god may help you lol
Looks like it words, although I do get this error
Doesn't prevent it from actually taking the snapshot though, I'm not sure if this will stop my udonbehaviour
Kind of makes sense why this happens but unfortunately I can't use OnPostRender on the correct camera since that would be the player cam
It works! Pog
Now to write the actual encode/decode logic
What? it definitely shouldnt be. Again I said you should do that on the camera thats rendering the RenderTexture.
Damn this is pretty slow, I think I'll have to amortize it over several frames
amortized it over 60 frames, runs a bit better now
bruhest of moments
it looks like there is a limit of 16k characters when pasting into a text field
Didnt know your data was gonna exceed 16k characters xD
jesus christ
A standard ASCII Character is 1 Byte
Megabyte. I knew I was mistaken lul
So yeah one Meg is actually not too crazy then
Hi, can you guys point me in the direction of some good Udon YouTube tutorials? Beginner looking to get started.
is there a way to make a clickable thing in a world that takes you to a site link ?
i'm working on a shop in my world so i can link to the things i'm selling
Thanks!
am I allowed to scale the player capsule / camera / everything?
do I have a limit?
like scientists watching rats run a maze
I know when I put on a small avatar everything I see appears larger, but I still can't go places I normally wouldn't
Is it possible to make objects activate/deactivate based on distance?
Let's say there's a room with a mirror in it, and the mirror should only be active when someone is in the room itself.
Ideally it'd be local too, so people don't activate mirrors for everyone.
Yeah, that's pretty common. The simplest way is to use a collider marked as a Trigger, and activate/deactivate the mirror using the OnPlayerTriggerEnter and OnPlayerTriggerExit events
I assume you'd make the trigger the size of the room
make it whatever size works best for your needs 🙂 you could activate it just before people enter so that they don't see it pop in and out, or make it exactly the size of the room
Also, I need to do it for a lot of mirrors
How would I stop it from activating every mirror?
The mirror will be a GameObject public variable, and just assign each mirror as the specific value for each collider. You can even use the same Udon program asset for every collider, just have them referencing those different gameobjcts
Got an existing graph I could refer to?
I do, actually 🙂 but I'm eating chicken nuggets so you'd have to hang tight for a minute
That's fine, I'm in no rush
Haha!
You set your bool without using bool const!!
This patch doesn't need that anymore
||no one tell him that I haven't bothered to update my SDK yet 😅||
Also, that bug didn't affect that kind of node. It only affected nodes that set declared variables
#udon-general message
All right, I'm back, I'm sober and I'm still dumb. This is how I have my graph set up right now, but it still turns it off just for me. What have I done wrong?
anyone else that has guidance on how to make an object and its colliders dissapear for the whole instance, feel free to chip in as well
oh lol
Two things. First, you're using SendCustomEvent, which I don't blame you for mixing up with SendCustomNetworkEvent, since they're named very similarly (and do pretty similar things)
Can I just import the new SDK over the previous version?
Second, you need to think of Custom Events as the beginning of a flow, and sending custom events as (usually) the end of a flow
Also even if it is networked, it might desync with late joiners.
that's okay, this is more of a gimmick that a necessary thing to enjoy teh world
I apologize, I'm still very new to this. Would this be more correct, then?
Still, if you want something to be global, it's good to make it reliable. Less disconnect between people's experience the better (my opinion)
Closer. You've got the right node, but you're still missing something basic. The custom network event is the event that executes the SetActive node.
But the event sender isn't what does that. You need to send the event, then receive it, then execute SetActive with that received event
The slightly unintuitive part is that you're gonna end up plugging the Interact node straight into the SendCustomNetworkEvent node, and then your Event.Custom node is gonna be sitting right there next to it, receiving it.
so like this?
exactly
The invisible thing that's happening here is that the space between SendCustomNetworkEvent and Event.Custom Event is networking. For the person who interacts with this thing, this whole graph gets used, starting with Interact. But for other clients, those first two nodes don't happen. Instead, network data is the thing that starts the execution, at the Custom Event node.
That makes sense
Also, like Helper said, nothing in here is making new players that connect actually get the news about the on/off state of this object. To make that part work, I'm a little unsure. I guess you'd need to create a new variable, sync it, and then use a Custom Network Event to tell all players that they should apply the newly-synced value?
And then also when a new player connects, while they're starting to run everything, they should take the soonest opportunity to check the synced variable and apply it
The annoying part there is that Start is too early to have synced variables 😕
Is there really no event that fires at or after the beginning of receiving network data?? That's starting to feel like a really important thing
But I'm fumbling here, this is past the point of knowledge I've actually applied.
Well if anyone has guidance on how to set that up, I'd take it. But in the meantime you've been a great help
Is there a way to have a working shop in vrchat ?
Like click sign and your taken to the gumroad page
they have relationships with partners who have special access to do that
I asked before
we can't send people off the platform
If Audio.GetSpectrumData and Audio.GetOutputData are both deprecated, how can I get a number out of the currently playing audio stream to bounce a light to?
coming back around to this, here is my map so far, but I'm kind of flying blind
great then i just added something to my world thats useless kinda
ill rethink it -.-"
GetSpectrumData isn't actually depreciated, though it isn't used in the same way it was in older versions of Unity.
https://docs.unity3d.com/ScriptReference/AudioSource.GetSpectrumData.html
ok looks like I'm using GetSpectrumData then lol
Is there an way to detect if a player changes avatars?
The SendCustomNetworkEvent and CanvasUpdate isn't necessary, just a GUI to show the updated owner across all players.
Does a game object with Synchronize Position set to true not have its "Is Kinematic" boolean changable during runtime?
How would I go about streaming audio from an external source (URL) rather than embedded audio files? Seems that video streams are well supported but I can't find any info about streaming audio only. The VRChat release notes mention that soundcloud.com has been added as a whitelisted domain in SDK3, but there's no guidance I can find on how to stream from their API. Any help much appreciated
If I wanted to activate 2 mirrors simultaneously, would I just add a second variable?
Or would it be better to make an empty with both mirrors inside?
Others may have better insight, but my reaction would be to go with the latter. It's easier to implement, and I'm pretty sure doing it that way means you have less data to synchronize.
You want to have 16 mirrors enabled at once? 
No, that's why I'm using triggers
So that the only mirrors enabled are the visible ones
OK, but as it happens, you've got two that you happen to be pairing together?
yeah
8 sets of 2
Trust me, I thought my PC could get away with the mirrors being enabled
sub-10 framerates aren't fun
2 mirrors is fine though, since pretty much everything about the map is baked
How would I test that it's working?
I can't really check what I'm not looking at
Never mind I'm dumb
It obviously works because the mirrors are disabled by default
the fact I can see them proves it
hi, im trying to find a post processing panel prefab, does anyone know where i can get one?
Where/How do I add this?
Thanks for the help @void ridge, This'll be useful for a different thing I'm working on too
Instead of making one thing appear once someone enters a trigger, I want to use it to HIDE multiple objects
Anyone know a good way to eliminate Z-fighting between two planes that are close to each other? I've got a semi-transparent plane just above an opaque plane in my world to make a sort of water effect. It looks fine from ground level, but from higher elevations, they start to flicker.
The semi-transparent plane is just a little higher than the opaque plane on the Y axis.
Z-Fighting only happens when 2 things exist EXTREMELY close together
would it be an issue if you moved one of them by .01 or so?
I went around that by randomizing the Z-axis just a tiny bit for local players.
Hmm... I could make an Udon script that slightly moves the lower one down as the player goes higher in elevation.
Would it be possible to make a Udon graph hide everything but a certain object?
I've got a map made up of different rooms, and I don't want people to be able to see the rooms they aren't in
So it'd be ideal if I had a script that could hide everything outside of a room
I thought it would be as easy as slipping a NOT into the trigger thing that @void ridge posted, but I'm not sure
Eh, yeah setting the active state of GameObjects doesn't quite work like that.
I was going to hide everything and then only activate the room you're in, but you spawn in one of the rooms at random so when you first spawn you just fall
because you never technically "entered" the trigger
Also, as I understand, if you're only talking about sparing meshes being rendered, then you ought to be using the occlusion culling system to do that
I'm using it as an alternative
because culling acts up with what I'm doing
This wouldn't be an issue if the rooms were closed, but some of them have open tops or windows
is there some way to get all Game Objects in a scene? If you can do that, then you can just iterate through each object and check if they're not associated with that room and set isActive to false.
Pretty sure there's got to be some way to do it. I've seen Hens' Water Closet world do it with the Shrek button.
Have a heirarchy of game objects grouped on empty objects. Then store those empty objects in a game object array. When a player enters a room, set all the empty game objects to inactive, and pull the index of the room that is active as active.
^ That sounds like a way better way to go about doing it.
How does one go about finding the closest player to a gameobject inside its trigger area?
You have to individually check all positions
You can do some optimization by only checking players inside the trigger by registering and deregistering them from an array.
How does one do an array with the graph?
I have 90% of the script in it, I'm in too deep.
I corrupted Vowgan's roomba into a hunter robot.
I think I found an explanation with the old Udon.https://ask.vrchat.com/t/how-to-loop-over-an-array-and-access-array-elements/192
I have such a dumb question its both embarrassing and difficult to search for. Just working to create a button that will pass a specific numerical value to the float value of something in another program. Been reading up on some old documentation trying to figure this out, but seems like some of the terms have possibly changed a bit since it was written/recorded. Would really like to figure this out myself, but I'd be extremely grateful for any pointing in the right direction for examples/docs.
I am working on a game with a sphere that when it goes through a goal it increments the score. I'm trying to do this in udon graph with a trigger box collider, a sphere collider (with rigid body), and a canvas with text. The udon graph looks like this
Nothing happens when the rigid body passes through the collider. Could someone who knows of a tutorial for this sort of thing mind sharing that?
Figured it out by looking at this collision matrix: https://docs.unity3d.com/Manual/CollidersOverview.html
is there like a minimum size for on player enter trigger boxes?
Edit: There is an edge case where if the triggerBox is rectangular, a player that is not in the triggerBox could be called as being the closest player. The workaround for that is to have a gameObject triggerBox follow each individual player's position, and should this triggerBox enter the other triggerBox, then it accepts that player as a valid candidate for closest player.
Also OnTriggerStay is repetitive since it could potentially fire 10 times for 10 players in the triggerBox. A boolean stop-check would only fire this once per frame, then reset on the next Update() statement.
Thanks.
I think I reached the end of an udongraph. Any time I try to add stuff, the noodles disappear and other stuff happen.
I probably have to update the SDK
For some reason, avatars with chairs have stopped working in my world. Yet they still work in other worlds. It only happened recently. Any diea why?
Quick question, for making Udon triggers is there method like UseAttachedStation() that allows the player to leave the station when immobilized for vehicles? if so what is the reference to that that trigger? 🙂
Hello.
Sorry for the rudimentary question,
Udon Sharp after importing SDK3 + Udon with unity
I imported it
It is not reflected in the Udon Assembly Program of the object's Udon Behavior (Script).
Was the installation method wrong?
I would appreciate it if you could answer.
Thank you for your cooperation.
Yes that looks fine.
Quick rotate cube demo for Udon to get started. If the cube rotates, everything's good to go.
I would like to make nerf guns for a world that shoot nerf darts that stick to the world object
I have the nerf guns and the bullets that are separated
now i have to figure out how to do it
Sounds like you can tell it just to stop and stay where it is when it hits another object, then I guess the other object could parent itself to it?
Couldn't you on collision activate kinematic on the projectile? Then go to a despawn timer?
Vowgan has a video on pickups that goes through a demo of a gun here: https://www.youtube.com/watch?v=xJJG0m0Mwgc
Here I go over how to use Pickups with Udon, using a ball gun to show off picking up, clicking, and drop events for it. I also start using the new Udon Graph system rewrite, so while it's still in open beta testing, this will make the tutorial more understandable later on when this version is the current build, so that not all of my tutorials wi...
Instantiate doesn't sync yet. But You can cannibalize it to make a gun that does sync projectiles.
Nevermind, didn't read that all the way through.
ANYWHO, object pool the projectiles. And on collision, toggle kinematic. You can do it in two scripts: one on the gun that shoots the projectiles, and one on the projectiles themselves that handles despawning (if desired) and collision stuff.
Something like: Event start > isKinematic : false. then on Collisionenter event > isKinematic : true. From there you can do your timer logic to disable after a set time if you want.
This is more a quick and dirty route, but won't stick to players. Of course, I have rarely seen a nerf dart stick to someone.
And do I even have to bother with a nearest player array? Couldn't I just turn the collider off and on again real fast? That should reacquire a rsndom-ish target still in the area, then I just have to make something that slowly increases the collider radius over time of inactivity.
what would be the best way I could sync a changing ui? I have a counter that changes with udon graph on a button push but I would like it to sync to players + late joiners
The property for scale is localScale
Yep! Read a guide at Unity website and solved it almost directly after making the post, Thanks!
Hmm,
Tried updating my SDK to the latest version so I would keep it fresh but I suddenly get this error, Anyone what it can relate to?
'VRCUdonCommonInterfacesIUdonEventReceiver.__GetProgramVariable__SystemString__SystemObject'. Parameter Addresses: 0x00000019, 0x0000004D, 0x000000CC
Do I come here if I have a question about something?
Specifically about Udon world/avatar creation, but yeah
?whatisudon
VRChat Udon is a programming language built by the VRChat Development Team for use in VRChat worlds! It enables complex behaviors and logic in VRChat worlds. Read more about Udon in our documentation: https://docs.vrchat.com/docs/what-is-udon
What’s this Udon thing anyways? VRChat Udon is a programming language built completely in-house by the VRChat Development Team. It is designed to be secure, performant, and easy to use via the VRChat Udon Node Graph, a built-in visual programming interface that uses nodes and wires (we call them “no...
I just realized there's a vrchat support
Just sayin' I called it 😎
#udon-general message
I have a script that controls an object collider which is set to trigger a teleport. This is being used to lock out a certain area, the problem is when new people join they see the object on (the default) while everyone who was there before sees it as off (locked) I need the object to maintain it's (off) status even when new people join the world...How do I do that? I was told by someone there is a way to set this when the player enters the world but I haven't a clue what kind of script I would need to do that.
I'm also having this issue with toggleable objects not appearing when new people join the world and the objects have been turned on by other players. This is kind of critical to make the world work properly
My door lock script
Getting really tempted to write an ask article about this. Or at least, someone should 😛
It's a pretty important 'feature' I would imagine, especially for door locks
I'm guessing something has to be added to the spawn point when people enter the world, but having to do that for every object variable in the world is going to be a bit of a nightmare to program
For a lot of things. Keeping global stuff synced isn't trivial. I won't call it tricky, but you have to do a lot of taking positive action where you might otherwise expect stuff to just be "implied." Networking is hard 😄
Nope, not quite like that. Check this out:
<#udon-general message>
That situation is pretty much identical to what you've got here. Again, disclaimer, this isn't stuff I've directly applied in this way yet. So someone else may have an easier or better solution.
yeah that exactly
But basically what you're doing is adding an intermediate step between each place where you're doing SetActive. Instead of just setting the active state, you're updating a synchronized boolean to what that active state should be, and then the custom network event is just telling players "hey, new boolean value, use it"
And then, for new players that connect you can just add a special line that applies the boolean value once they've finished loading in
That's kind of what I was thinking, my knowledge of how to do that is pretty weak, was hoping there was an example somewhere I could 'see' visually
I was going to suggest, when they do the documentation up for an udon node, it would be really helpful if they could also include a screenshot script, showing it's use as an example, so people have an idea how to implement it
Big caveat here: I did do something like this once where I was syncing a Quaternion and then sending a Custom Network Event to apply that synced variable. Problem was, it backfired. Somehow, the custom network event seemed to be arriving before the variable sync, so clients were always applying the next oldest value 😩
hmmm
My solution was real dumb. I just made the custom network event start a timer that waited for a few network updates before actually executing the rest of the graph 😅
That's the kind of thing that makes me think this approach is the wrong one. I gotta believe it's simpler than that. But, I dunno another way, so 🤷♀️
I would hope
You would think by default, the system would check all world variables and set them for the new player joining to what they currently are for everyone else when they load in...This is kind of a bug IMO.
I think this is just kinda what networking is like 🤷♀️ VRChat may or may not take some steps to make it more newb-friendly
yeah
How do I get allowed to create avatars
Ask this question in #user-support-old, this channel is for questions about Udon
ok thanks
its like an 'onplayer enter' check this variable and set the variable to what it is ACTUALLY set at' I'm not sure how to code that in a graph.
My opinion has reached its final form. #user-support-old oughta be named #user-support-questions and it should be located in the General category, above this category in the list :-P. But that's just, like, my opinion, man. @floral dove
This world may have 30 or 40 global toggles in it by the time I'm done (this is a real headache) I may abandon this whole project :P
Nooo u gotta d e s i g n
Programming is not my forte
Learning's the only tough part.
I guess i don't understand how to make a script to get the new player to check all the variables before spawning and set them correctly. IMHO that should be automatic, but I'm not the developers.
Pls don't ping me or any other mods for non-emergency reasons if we're not in an active convo
oh, heck sorry about that
Does someone know why the video-players are not looping even though I don't have a Udon behaviour on it?
They should according to the documentation when its set to loop
https://i.imgur.com/HOpYQ06.png I did this instead of doing an array to find the closest player. Wouldn't disable and enabling the collider trigger get a new random-ish target?
It's a first come-first serve trigger entry to determine the target.
For gameobjects with Synchronize Position = true, the kinematic boolean isn't changable during runtime. another object will need to be a child of the parent and the child syncs the transform while the parent has the kinematic boolean change.
After some sleep, here is the correct format for the code I wrote earlier. Just call the function GetClosestPlayer() whenever needed.
Thanks, I'll check it out when I get a chance. I'm gonna try cheesing it by toggling the collider. I figure it might be more chaotic that way.
I was working on the nerf gun earlier today and came up with some errors, I will send the graph picture later and the console errors that go with it, or the assembly if that works too
The nerf gun shoots once but not a bunch of times like the gun does in vowgans tutorial
Too much network traffic
I was worried about that
Ohh
no I actually think thats something different
You might be trying to sync a null string
As a matter of fact, that MIGHT be happening
Yeah I was one of the first to discover that thats a big no no 😅
My "PlayerName" variable on each playerData object is by default null.
Yeah never sync null strings
But I no longer check for an empty seat based on a null string, thus, I could just write "Empty"
do String.Empty or just ""
Gotcha. <3
Now the string I was thinking about was set to "", are you sure that's good enough to avoid that error?
Ofcourse Im not sure. But otherwise I have no idea ¯_(ツ)_/¯
We're going with the word empty, to be safe
:D
Didn't fix it.
But the one client that is causing issues in the world presently... is a Steam user who hasn't gotten a VRChat name
Very odd
Errors stopped the moment the Steam User left
fun
So were you using VRCPlayerApi.displayName?
Yes
Can you show the code/graph for that?
I'm not actually sure where the issue is even occuring. ._.
Wherever youre using displayName for now :P
There are more than 30 instances.
ohh boy
Well you should probably sanitize your synced strings OnPreSerialization by null checking them.
How would I go about doing that? :D
Check every string in OnPreSerialization for being null and set it to string.Empty..?
I'm actually confused, where is OnPreSerialization?
Its an event
That occurs before the owner of the object serializes the data to be sent over the network
You also dont need to check every string. Just strings that "might" become null for some reason.
So we've got a whole two strings that can be Synced. I'll go ahead and Pre serialize them and see what turns up.
what is the best way for me to sync an string?
I setup a counter, wondering if I can just turn on sync in udon graph?
A number counter?
pretty much a button that connect to text
and it increases by 1 when pushed
I'm guessing to sync it I would have to do isowner
You would want to do an int not a string
Alright so we aren't getting anything weird as a null string. Is there a maximum limit on how long a string can be?
I'm trying to use this example rn
Theoretically no. Technically yes. Bandwidth is heavily limited in Udon.
This is officially the longest name I've run across thus far.
I'll look more into it. I assume the steam user is getting udon errors that I need to see, so I'm just gonna need to find a reliable steam user
You can also just truncate the name to be safe
Gonna need to try that.
It was then in a stroke of brilliance that Riney realized, using GetOwner on a gameobject, I could just pull the displayName and ignore syncing it.
wait so
would this work?
setup a counter
it works
that is the right side of it
It must. I've been operating under the assumption that each active object with this box checked increases a World's network load. What I don't know is what the upper limit of network load is, or whether the load increases in a linear way or whether multiple of those are compressed in some efficient way.
The world I tried showing off this week proved that point lmao.
I'd really, really like to have a guide on how accurately to assess networking use and constraints. Granted, that's a moving target for Udon since we know it's getting updated frequently. But still, I'm sure there are some really good rules of thumb.
But also I guess you can do a lot with effective logging and debugging, which I just plain don't know how to use effectively yet.
Once we can send events with a payload, that would nullify any existing guide for udon networking. We'll have to see what the next networking update has in store.
Hey, it's my first time with Udon Noodles.. but not my first null hunting... can someone spot the null? Log claims null on position but I'm checking for null.. unless equals doesn't check the pointer... :/ What am I missing? My sanity? At this point yes. but that's besides the point...
This node should be getting the Type of Transform, not GameObject.
lul nice
Does anyone know how to synchronize all the information in the scene (objects... etc.) for the player who enters the game halfway through?
I found that using VRC.Udon.Common.Interfaces.NetworkEventTarget.All is only limited to players in the same scene, but players in the middle of the game cannot synchronize their previous actions.
How to synchronize all the objects and location information after entering like VRchat game (harry's 8ball) scenes?
So it says unusual client behavior when I never download mods or clients and the only one I did was openvr-calibration for my vive trackers so please tell me what is wrong?
Also, Is there anything like a switch statement in udon?
No just normal branches (if-else).
okay, thank you
I'm trying to use the name of the collider to choose the right custom event to send
but there is 7 different collider names to compare
collider get name gets the name of the object that collided with the trigger, in this case that is the object that's thrown
How can I get the name of the static trigger collider instead?
Are you trying to check to see if an object you collide with is Static? If so, static checks only work in editor.
Heyo! Really feel like I'm overcomplicating stuff, anyone got a simple way to play a video based on a button press?
As in having a URL linked to a specific button
Does anyone know how to synchronize all the information in the scene (objects... etc.) for the player who enters the game halfway through?
This simple was test for other thing i make which have code in that event get run three time and cause issue.
You have saved my brain!!!! thank you!!!
What kind of information is being synced? For an int, the owner will upload the variable and all non-owners will download the variable:
[HideInInspector] [UdonSynced(UdonSyncMode.None)] public int registry;
while for the transform, it's checking the Synchronize Position boolean in the UdonScript component.
I found that using VRC.Udon.Common.Interfaces.NetworkEventTarget.All is only limited to players in the same scene, but players in the middle of the game cannot synchronize their previous actions.
How to synchronize all the objects and location information after entering like VRchat game (harry's 8ball) scenes?
This will sync the position of the object for new players. It's best to "dirty" the position of the object every once in a while so the server updates it.
Switch statements exist for C#, for graphs not sure
Thats Merlin being nice. Under the hood switch statements get converted into if conditions.
oh haha
That is synchronizing the position of objects, right?
For example, let's say I have a button and when I press it, the
public Material _mat;
public GameObject _obj;
private void click(){
Getcomponent<Renderer>().material = _mat;
}
But then the player comes in and doesn't press the button, the _obj screen doesn't show the updated material
Ah I see
What I want is that if I interact with some objects in this scene or press the button to change the texture map, the player who joined in the middle of the scene can see the new objects.
Have any ideas? Can you help me?
can I write public override void OnDeserialization(){
changeMaterial();
}
That syntax will always change the material even if the button wasn't pressed, the below should work:
public override void OnDeserialization() {
if (isMatChanged)
{ ChangeMaterial(); }
}
Great, it worked!
Thanks
🙂
👍
Should the Devs make a andord and iOS port
...i am a noob at udon.. i found out how to make a door open and close via animator.. but how i make that global?
sync position
hm.. did not really work.. but i have the feeling cause it works over a Animation?
ive never acc done animations for worlds, but id assume syncing positions wouldve worked
theres a prefab for an automatic door, but im assuming youre using that?
What is the best way to update the SDK in a world project?
Just import the new one into the project?
Remove VRCSDK + UDON and import new one?
Go to the folder where the project is and remove everything from there?
make new project and shove all the assets back in
How would I go on and export the scene and all the assets I currently have to open it have like an exact 1 to 1 copy in the new project?
the scene is also a file in your assets
when updating the SDK for avatars, you simply import the new SDK on top of the old one
it could be the same for worlds too, not sure
If you need to update your SDK, it is important that you follow these steps to ensure the update proceeds properly and you don't have any old/conflicting files. Version Control If you know how to use it, you may find it beneficial to use version control software like Git to manage your project. You ...
follow those instructions
what is the best way to sync a ui text?
I have a button that does addition on press so like a counter but idk the best way to sync it with udon
When I try to update SDK to latest I get this error;
An exception occurred during EXTERN to 'VRCUdonCommonInterfacesIUdonEventReceiver.__GetProgramVariable__SystemString__SystemObject'.
Seems to be a rather strange issue
Anyone have a moment to help me figure out how to setup a toggle for colliders using udon?
Trying to make a switch for seat colliders and its a PAIN lol
Check out the UdonExampleScene, it's got an example of sync on a Text field
I'm super new to world building, so apologizes if this was already asked or an easy answer i missed. I can't find any how-tos to create a "trash bin" and global delete button for pickups that are spawned in.
Also, after I updated the SDK, and it looks like the Unity Destroy node is now missing?
Is it true that you can't see object Sync when you use Local testing with 2 Clients?
Some things about local client testing aren't perfect, though position sync should work fine.
ok then i have no clue anymore xD i am trying now for like 4 hours to get this to work
This one is done by a triggerBox in the trash bin that destroys the game object. Though, spawning and destroying objects from experience are a bit odd, I just pre-compile the objects in advance and hide them.
What's the thing you're trying to do specifically?
A Door that works via Animator to Open and Close for Everyone
I have the door working. But now to get it Global is my problem
Ohh, when you said ObjectSync I thought you were trying to sync something's position.
Is the door opening on interact?
yep. Has a Box at the Handle that has the udon Script in it
Then instead of setting the animation book right there, use SendCustomNetworkEvent to All and call a new event in your script, named like Toggle or something. That way, everyone will get the call to toggle that specific door. There's a chance it might be inversed for late-joiners with this method though.
go slow on me please xD I have the SendCustomNetworkEvent. What you mean with "New Event". I am allready thankful for the answer 😄
Under Special select Event Custom
?
Yep!
if it really was that easy.. i will eat... dunno. I was thinking again 10 times more complicated
If you want to make it the same for people who join in late, you'll have to do a couple more things.
#udon-general message
Described here.
#udon-general message
Networking isn't something that's easy to jump right into...
but when you sync like that.. what is then this synced?
What variable do you have there?
The Door Animator
Syncing the variable itself to other players does not sync any animations. That just tells everyone that this animator variable references a specific animator, there's no need to worry about syncing that.
Ok. Thank you so much and also thanks to @unborn hornet 😄 I should have asked earlyer
No worries. Networking in general can be a difficult thing to grasp. Many factors and quirks to take into consideration. Let alone Udon specific things as well.
The goal for working with udon networking is to eventually get it to be good enough.
The closed beta for the networking patch is big nice, but it's also very slow to develop so can't wait until 2022
Clarify "slow to develop"?
Danly is the only person working on it so progress is slow
Ah! Yes, right.
can someone pls tell me what goes here? I want to change player mods if you're holding the object (and hit use), but only for the player holding the object
so you can blast around with super speed as long as you hold the button down, but when it comes up, you go back to normal
when you hover your mouse over the port, it will tell you the type of Object expected there
something's trying to show an editor for a Double, but there isn't one defined.
in the inspector
anyway all my player mod powerups work now so that's major progress
Except I accidently doubled gravity instead of reducing it by half
now I am looking for a public go-kart/driveable car if someone knows one that works with the current sdk
Does OnPlayerLeft fire for everybody when someone leaves?
how come every sdk import I do, there is no examples folder
I really need syncui example 😦
have you tried importing into a new project? It should be in Assets/VRChat Examples/UdonExampleScene.unity
it's under the 'Udon Variable Sync' prefab. The included Readme explains all the examples. If you're just getting started, I recommend you go through all the examples in the scene to learn what you can do.
Gotcha ty 🙂 tutorial I found must be old
wait there isn't even a variable sync prefab
D:
Does your hierarchy look like this when you open the scene?
@cunning mist It would be great if that closed beta could be open beta so they could get the feedback they need before it goes public/live instead of leaving it until its too late to suggest improvements
Is there a simpler way to do this? If there's a more appropriate node, I couldn't find it ☹️
it will be released to Open Beta after Closed Beta 😉
Purpose of closed betas: building the thing
Purpose of open betas: throw people at it until it breaks
You don't happen to have a pic of a udon graph do you? I can't even find a destroy option in the newest SDK.
there is Networking.Destroy, but I'd recommend you set objects to Active/Inactive rather than destroy.
Ok thank you for the advice!
You could try Udon#, which lets you write C# code that's compiled to Udon. So that graph could look something like if (x == null || y == null || z == null) { // do stuff }
I only fiddled with Udon Graph for about 45 minutes before I moved to Udon#, and I'm so glad I did. Much faster development time if you're at all comfortable coding and want to do any amount of complex logic or error checking, etc.
I'm happy with the graph editor for now, thanks. I'm plenty aware of U#
Cool
My question was more in the nature of: is there a dedicated way of checking to see that a Vector3 is valid. Also, I've answered my own question 🙂 the guide I was reading appeared to be checking a whole Vector3, but I was misunderstanding, and it was only checking one component for NaN
Yeah I suppose if one axis is NaN the entire transform is pretty much useless 🙂
That could make a nice node request. I haven't heard much of node requests in general, but I think having individual nodes that can perform specific tasks like this that you would otherwise have to write out more complexly without changes between implementation, could make for a good specific node we could use. At least, until the fabled Nested Graphs return...
Yeah, for sure if I'm tripping over the same use case for something a couple times, I'll be making a canny request. This one is kinda far out, though, so not worth dev time. (also, like I said it wasn't based on a need, it was based on my mistake)
@void ridge You familiar with submitting requests on https://vrchat.canny.io/bug-reports ?
haha you just answered my question
it was never fully realized, but SubGraphs are one of the near-future features we're currently working on
I feel like subgraphs will be one of those things where there's going to be one big community made pack that it's basically required you import.
Quick question
When a player rejoins the world, assuming nobody else has joined, do they reclaim the old VRCPlayerApi index, or get a new one at the highest number?
You mean the playerID? If so then yes, the latter.
Good to know
Is there an easy way to get the name of the button the player interacted with?
via udon graph?
sure - if the graph is on the button, then GameObject.get name will do it
thank you Momo
Trying to implement a rejoin feature into this world, and thus far it's being a complete pain.
Oh dear, I know what it's failing now.
I don't sync the string that contained the name anymore to avoid that strange af error. ._.
Is there any other way to pull information out of LocalPlayer that contains some sort of VRChat index the player might have globally?
using the Norix Wolfe Video Player does anyone know how I set a custom url with graphs?
No no, scrap that
I need a way to convert a DisplayName into an int, float, double, or something that works conveniently in UdonSync.
Or find a way around syncing strings. Lets try truncating to 15 characters, maybe that'll work
yeah, DisplayName is the only thing that will be the same between rejoins.
Truncation it is!
Provided the user doesnt change his name inbetween sessions lol
That... should... hopefully never be an issue. o_o
Well can happen. But probably wont :P
And even if, then its their problem not yours ;D
you could get the displayName and then call string.GetHashCode on it
But then you cant get back right?
That would only let you identify uniquely
but not act upon it
you can't go from HashCode back to displayname, no, but you can't do that with truncation either. It would let you check if the user is returning
With truncation you could guess lol 😅 Depends on how much you truncate it
GetHashCode would provide what kind of output though?
Ohh wait
Int
and you can get back
you just need to check every player apis hash for equality
I only need to change into it, not the other way around, so that would work wonderfully.
Yeah then changing an int is definitely better than a string
that's why I suggested it! I ran a few tests and it spit back unique 9-10 digit numbers, so it should meet your requirements
Syncing an int takes 4+1 bytes
So I have a go kart track, and coins, and a counter for the coin pickups that sends a custom event to a cube that slides along a rail to indicate your progress to 100% of the defined coins...
My question is...if I don't send any network events or synchronize any of those objects, are they individual for each player in the world? As if each player were playing their own instance of the game and they wouldn't interact?
yes. The only things that automatically sync are Avatars and VRC Prefabs like Pickups and Stations
that's really convenient thanks
I was thinking how I was going to deal with that
just ..don't implement it
What is the correct way to reset objects to their starting location?
There is no correct way. At least not that Im aware of
One way is to reset it manually. The other is dropping it below the respawn height. The latter only works for Position Synced Objects.
manually as in, move it to exact coords
On Start, save the transform.position to a Vector3 variable. On 'Reset' or whatever your custom event is, set the transform's position to your saved Vector3 variable
Some considerations have to be made with that
if it is a synced object
then you need to tell the owner
to reset it
Is there a known listing for the bytes required to sync each primitive?
oof
I orient myself with the PUN documentation. However VRChat may deviate from that.
sure - have the event fired be a CustomNetworkEvent to 'owner'.
I got real deep in this udon game and then realized how network events are the way to do things if I want people to play together
I heard it messes with lerping and other network stuff.
When I refactor for that, it seems like I need to change my SendCustomEvents to SendCustomNetworkEvents
What is the OnDeserialized for?
it will 'lerp' the object back for the non-owners, yes. I don't know about anything else it 'messes with'
OnDeserialized is fired when data is received over the network. It's the event to use when you want to check if your Synced Variables have updated.
thanks again @floral dove and @fiery yoke
On an object I have set the 'transform rotate' node, is there a way to increase or decrease the speed of the rotation?
show graph
The Rotate node doesn't begin a continuing rotation. It peforms an instantaneous rotation relative to the current orientation when executed, and that's it
If you want to continuously rotate, you can execute that node for a small amount of rotation each frame. The angular change per frame is what determines the speed.
This video is getting a little past date, but it explains how that works
https://www.youtube.com/watch?v=_pbf9hakP9E
ok, increased the angle value and that appears to make it do what I want...setting it to 100 is making it go really fast now
Consider multiplying that value by Time.deltaTime. That allows framerates to vary but the rotation speed of your thing will stay constant (Because Update happens every frame, and the time between frames is squishy)
Oh, I see now that you meant you already had it rotating, sorry for misunderstanding 😛
yeah, I should have tried that before asking
oohh it would be cool if there was support for incoming/outgoing webhooks
imagine it could get weird though lol
Yeah, you wanna open the flood gates for malicious people? :P
not particularly, but having an in game survey would be nice
Is or isn’t it named after a type of noodles?
The nodes have some wiggly connectors, chonky noodle time
It really is
I’m happy now
wellp
everything works in test, but in game it doesn't
For events to work in the live game, everything needs to be network events?
is it possible to have an animated mirror
like, a mirror on a plane with blendshapes, so when you toggle the mirror on, the plane opens up
if that makes sense
i tried adding the mirror component and material to the plane but its showing up black
The mesh has to face +Z IIRC
And Im talking about the model data, not the gameObject
anyone knows how i get the name of the player that interacts with a specific object with Udon#?
kinda new to Udon 😅
and how to synchronize it as well if possible xd
well udon is interesting to learn. If I have 1 target gameobject with an an animator how can I set it up to when I interact, the animator turns on and the animation plays (i've figured that out), then it will wait for a few seconds until the animation is done and turn on the game object?
interact plays the animation and sets a boolean
update handles turning on the game object
put a branch between the update and your logic to turn on the game object to check for the boolean being true and the animation being done
very last thing after your gameobject logic executes, reset all your booleans and return it to a ready state
I am very new to Udon so much of that is giberish. Currently I have two variables, one for the animator, one for the gameobject, then I just have the interact set the animator enabled and then go to set the gameobject active.
Get owner of object
thanks, but i figured it out already by getting every player and check if one of them is the local one, then just get the display name of the player
It will not be synced though ?
not sure, havent tested it yet with another player
how exactly does syncing even work with Udon#?
all i can find was normal Udon
Either sync variables for late join or synced methods which are called for everyone in instance
I never opened normal graphs, they are terrible without Merlin udon would be DOA
as someone who learns java at school, the node programming is hell for me
Anyways you need to assign owner to object then call method for everyone which will display the name of owner
hmm, guess this will be a lot more work than expected xd
should be like 4 lines
i also have a reset button for the object, shouldnt this be synced as well?
by default everything will be local 😛 so depends what you want
so yea, i have to sync that as well xd
I guess on player enter trigger is is networked by def
well not really because player enters the trigger for everyone 🙂 unless you put trigger on player local this is what I meant 😛
Udon does not currently support syncing of the type 'TextMeshPro'
thanks, udon...
I'm a new player to VRchat and when I was inside the game it randomly started downloading inside the game I've been waiting for the last 1 hour and the progress bar is still 22.49 I'm not sure if I paused it or something but can someone help
try restarting the game, there is no pause option for downloads.
also wrong channel ^^
Oh
It's really the same process for triggering an event off an interact as trigging an event off of anything. There are many ways to do this, you just need to find the one that works best in your application. For me, I use update and gate the core functionality of the script with a boolean set by the interact, then clear that boolean after the payload is delivered. But that's super simplistic and doesn't account for really any external influences or network events or anything.
any sdk 3 tools similar to pumpkin for world thumbnails ?
I am not exactly sure what booleans are but its like a 1 time animation type thing. Dont really need anything to toggle or reset. Unless I make a master reset for it all later down the line if people wanted to play the anim more than once I guess, but rly not meant for it
Sure you need stuff to toggle and reset.
If you can do it without boolean, show code.
I have animations that don't require triggers and resets, lots of things. Car drives around the block, for example. My bauble that triggers the transporter pulsates a little. Other things move in basic ways and don't need animations at all, just move them around and synchronize the position.
But if you want the user to be able to influence it you need to trigger it somehow and make it interact with the user... Could be any way, could be an interact, could be proximity...
Don't really understand anything right now lol. Way too new. Dont know what detects the anim being done
also how do I know if anything in udon is happening locally or globally?
Stuff you put in your world is always local unless specified explicitly as synced, either by ticking 'sync position' on an udon script in the inspector, by declaring a variable as a sync variable, or by explicitly calling SendCustomNetworkEvent.
The things that are implicitly synced (ie global) is player/avatar data, such as player position, avatar bone/IK information, etc.
yea, i know the theory behind it, but syntax wise im pretty much nowhere. Google doest show anything useful and the Documentation is also pretty lacking
alright and in the case of detecting whether an animation is done should I set the variable and use an animation clip instead of animator as Im using now?
Im not intimately familiar with animators specifically, but I think you can have the animator set a target bool flag that you can check elsewhere for if it has ran or not.
Yea im gonna watch vowgans door animations tutorial, seems to have similar concepts at least? Idk I am totally lost on everything this is foreign to me
Are you asking about udon sharp?
yep
I'd suggest asking for more u# specific help on merlin's discord.
Link is on this page https://github.com/MerlinVR/UdonSharp/wiki
oh thanks! didnt know he had a discord
Yup. Np.
how do you add the public animator? cant seem to find it
I feel like i broke something. I can't find Unary Negation after recently updating my SDK. Has it been renamed?
Is it Boolean.UnaryNegation now? I had to go into the Boolean section to find it, instead of searching "Unary".
I recently purchased "Dinosaur Pack 1.0" asset pack b/c I want to include some dino's in a world i'm working on. they all come with animations and have an Animation component that controls them but seeing as Udon doesn't support the Animation component would anyone be able to point me at some info on how I can change this to something that will play the animations?
Anyone have ideas as to why local only udon scripts work in build & test but not live?
Hello. Just a little curious about Udon, and particularly what you can and cant do in a custom world regarding scripts, physics & so on ... how much freedom do you have to make custom interactive worlds ?
you can read some details here: https://docs.vrchat.com/docs/what-is-udon. Check out the Udon Alpha Spotlight World row for a few examples of worlds that use Udon. It wraps most Unity Classes and Methods so you can access them through Udon.
what do you mean by "local only" udon scripts? What is working in Build & Test but not in a Published World?
so it looks like a proprietary visual scripting system, no c# I guess ? I suppose while you can do quite some stuff with it you must be pretty limited too compared to simply a unity project ?
you can use udonsharp
Udon supports Animators - you can drop the animation clips into an Animator and control its properties to play different animations
the default search is either limited to searching for Classes first, or to searching through a particular class if you have a node selected. You can always bring up full search by pressing Tab but it's slooooow
I have a machine that increments a score as balls go through various holes. It changes public variables linked to a text object. In bulid & test it increments score correctly and everything works great, but in the live game it doesn't keep score
I dont have any particular project, but I have a few questions to get a better idea of what is possible. Can one ...
- Attach objects to player bones, like bracelet or a hat ? ( ignoring the fact that morphology can vary wildly)
- Access players ingame camera pictures ? For instance, allowing a player to display on a screen a picture he took with the ingame camera
- Prevent or force avatar change and apply this rule to specific players ?
- Get data from an external database ? (like an externalised highscore list)
- Detect information about avatars, like is the avatar lipsync capable, what its bounding box size & such ?
- Use physics collisions / joints ? Somewhat heavy scripts ? (what are the server-side performance limits ? is there even a server side or is it just p2p sync ?
Thanks, I've been trying that but haven't had any luck but its nice to know that that is a path I should continue to look at
I suppose what I meant was there are no network events
What in particular is not working? There shouldn't be a difference between Build & Test and Publish other than being able to invite other people. They both use your installed VRChat client.
How could I send a set url to a video player with udon? want to setup set youtube videos to play on a button push
- You can make objects follow player bones, though you can't access a Player's hierarchy directly.
- Direct access to player photos is not supported, but you can create cameras in your world that take pictures visible globally.
- You cannot prevent an avatar change. You can force a player into an Avatar but you need to tread carefully here - it's important to let players be in charge of their appearance and identity and if this is used maliciously the world could be taken down
- You cannot GET data from an external source
- There is currently no lip-sync capability information available. You can use information about bones, etc to get an idea of size but no direct information about Avatar is made available.
- You can use physics collisions and joints. Would need more info about what you want to do with "heavy scripts"
BaseVRCVideoPlayer.PlayURL, pass along a VRCUrl
I can't see the ray that I expect to be drawn with Debug.DrawRay, either using Build & Test or CyanEmu. Build & Test should be enabling the debug gui, right? Or am I missing something?
Debug.DrawRay is only visible in the editor. You'll need to add a LineRenderer and set its points if you want it visible in the client.
Oh, is it only visible in Scene view? That might be what I'm missing
Only visible in Scene View unless you turn on gizmo drawing for game view.
It was the entire system. But i got on to make a few gifs showing the difference between local/live and now it works as expected.... 🤷♂️
Quick question, if collision detection doesn't work with players and we have to use onplayercollision instead of oncollision, does regular raycast still work with players or it doesn't work either?
https://i.imgur.com/OfARBn7.png This is the correct way to send an event to another Udonscript in a graph, right?
@hardy crown which part are you having problems with?
I posted it in the forums because it takes a minute to explain what I've tried and where I'm at https://ask.vrchat.com/t/multi-camera-effects-in-vrchat/2964
I’m asking this here since it might be useful to other people… I’ve seen a couple of worlds in VRChat that make use of multiple cameras to create effects where the geometry of the world is simultaneously rendered from two or more different perspectives. I’ve been looking at this for days now and it’s left me scratching my head because I can get ...
Player camera depth seems to default to 0
No matter what I set the reference camera depth to
But even with that, I don't know the exact reason it works in Unity but not VRC
I'm not even sure this is an UDON problem
vrchat clamps the reference cameras near plane to .01 - .05