#udon-general
59 messages · Page 93 of 1
Could you click on it and show layer number?
I'd guess the blank one is on layer 22
so how would i get it lol
Add Layer
The layer name is arbitrary so it can be anything.
But name it PostProcessing
For layer 22
See if it show up in the sleep mode object
Working!
Thank You!
Also one more question
@coarse parrot do you know if there is a way to easily transfer the sdk2 pedestals to sdk3 bc there are missing scripts or do I have to manually make them sdk3 peds
I haven't work is pedestals yet. I couldn't answer that question.
do you think this is why it doesnt show up in scene?
A collider is need for interaction for a game object though.
anyone know why the world disappears while flying ?
things just become very hard to find because it gets unrendered or something
occlusion culling
occlusion window
How far away is it? Could be getting z-clipped by the camera.
its basically a veryyy big platform to show where the ground is of the world
how can i stop z clipping?
You can't. In normal game dev, you can adjust the camera's clip settings, but I don't think those are exposed in VRChat. You'd just need to scale down and move closer.
the problem is, its a flying world so scaling it down isnt really an option assuming you are talking about the world
you can change far distencs in main cam in vrcsdk
You can set camera clipping for vrchat though
There you go. do that then ☝️
set near distance low as possible so peipke dont complain later
Yeah, but then you get ugly z-tearing.
when far away for 000
in a perfect scenerio. the space around would move to local space rather than world
how can i do that?
this camera?
That
i just set it to reference camera in vr wold prefab
And set reference camera in world desciptor to that camera
What camera placement?
no
So you meant location. Doesn't matter
If you're too far from world origin, graphic will get messed up though.
wym
There isn't. But further you go, more mess it will be.
so when i am flying, i will randomly get kicked out of the plane once i reach a certain area
some directions are closer
some are further
they seem to be borders
Nah, z-tearing can still happen from the origin. Floating-point imprecision farther from the world's origin just exacerbates it.
i notice in some flying worlds they have borders too
also the camera clipping is fixed
thank you guys for that
this isnt blender but ok
Basically, Unity/VRChat uses 4-byte floats for locations. The further you get from the origin, the bigger the numbers get, the lower their precision. That causes all kinds of weird issues. Borders are just one way to solve that.
32bit
hmm alright what would you recommend is a good way to set up borders?
4byte=32bit
ihni heard someone call it 4 bytes before lol
depends how much land is being covered
flying world so a lot
far away borders then
im trying to think of how I will make the borders
Better think how you'd like it to be
maybe just giant walls with a glass like matieral
fog
Just put the whole map under a big simpsons-esque dome.
xd
proximity shader
Hope you don't mind the ping. But thanks a lot for sharing your footstep Udon! I've been trying to make one since around January myself but I couldn't (I'm just not experienced enough).
I've made a small addition to it by adding isplayergrounded so it doesn't play midair and to find if a gameobject is active to only play in a specific area.
I do have a question about this tho if anyone can answer. Is there any way I could possibly make it based on a player is walking on a mesh collider? Currently its based by a gameobj that is enabled through a box collider, very wacky.
iv never done that before xd
You'd probably need to write your own IsPlayerGrounded routine so that you could capture the collider that they're grounded on.
I guess that isn't exactly happening then lol
You could also raycast downwards and just see what you get. May not always be properly accurate though.
I don't even know what that means, F
Seems like hellalotta more work
Thanks a lot for the suggestions nonetheless. I think this is a quite decent start for having footsteps, albeit a little cumbersome but works as intended
Anyone know how I can make particles emit in each players hands?
Get the VRCPlayerApi, then in Update, get the hand's bone position and orientation and apply those to the particle system's transform.
Hmm... how do I specify which particles go to which players?
Depends on how you want the activation to trigger.
What do you mean?
As in, what causes the particles to be applied to their hands?
Umm... lets say for testing purposes there are different colored particles and the player can choose which one they want by pressing a button?
Then when they interact with the button, you know which player to initialize the script for.
Well... the thing is I'm very new to Udon. How do I say the person who pressed this button is the person who gets this color?
Depends on how the button is implemented.
But generally, when something is interacted with, the player who interacted with it is passed as an argument.
Interacting can only happen in local client with local player though
Determining which remote player pressing the button is quiet tricky
how i sync toggle in udonsharp
public override void Interact() {
GameObject test = GameObject.Find("Deck1");
if(test.transform.childCount != 0f){
Transform selection = test.transform.GetChild(Random.Range(0, test.transform.childCount));
selection.parent = GameObject.Find("Deck1 active").transform;
selection.gameObject.SetActive(true);
}
}```
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class deck1 : UdonSharpBehaviour
{
void Start()
{
Debug.Log("start");
}
public override void Interact() {
GameObject test = GameObject.Find("Deck1");
if(test.transform.childCount != 0f){
Transform selection = test.transform.GetChild(Random.Range(0, test.transform.childCount));
SendCustomNetworkEvent(NetworkEventTarget.All, "Sync");
}
}
public void Sync(){
selection.parent = GameObject.Find("Deck1 active").transform;
selection.gameObject.SetActive(true);
}
}
will that work
You can learn the basics of networking here: https://docs.vrchat.com/docs/udon-networking#overview-how-networking-works-in-udon
And you can learn about some UdonSharp-specifics regarding networking here: https://github.com/vrchat-community/UdonSharp/wiki/udonsharp
okay i just hold everything 10 million meters away
hi. I'm trying to make a boss fight arena. All what I need to do is to make the player respawn when colliding with enemy projectiles. For some reason (mostly I don't understand how the respawn function works) the player doesn't respawn when colliding. Doesn't matter if I do it with udon graph or udon#. The collider is working fine and it's pushing the player backwards on contact.
these are the projectiles (blackholes looking balls)
Are these projectiles using a box collider? If so try enabling "is trigger"
then changing it from onPlayerCollisionEnter to OnPlayerTriggerEnter?
yeah
I can show you an alternative if you wish
not as wholesome and straightfoward but this works
oh, then you can definitely use that
thank you
you simply create an empty game object and place it where you want the player to respawn
will try it now
not working🤣
the projectiles pushes the player backwards, but the collision even it not being called
eh?
yeah mean. I have seen wonders with udon
the projectiles pushes the player backwards,
because of the collider
Is the projectile itself supposed to teleport the player, or do you have some collider behind the level that will teleport the player?
the projectile isn't set to be destroyed on collision
I just made a ball that's moving in a specific path. Set a teleport location under the map. While I move the player in front of the ball, the ball just pushes me back and the collision event doesn't trigger
so yes the projectile itself is supposed to teleport the player, as a way for the player to die while being hit/damaged
hmm... for a normal box collider w/ is trigger enabled, this should had worked perfectly fine, I built and tested.
I wonder if rigidbody makes things different, but shouldn't
I will try it without a rigidbody
also it's a sphere collider but I think it should work almost the same as a box collider
ok
lol everything works now
even the scripts that I coded but were not functional
I think they were not being updated
but once I imported your asset
I think all scripts got reimported
nice
winner moment
you are my savior
Does anyone know if there's a way to access the local player's camera object in a script?
Pretty sure that's not exposed in udon. That being said, you can basically get it's position by using playerApi, get TrackingData, and set it to head
Oh, in that case, do you know if it's possible to get the distance between the eye cameras in VR?
I'm trying to create a fake window that shows a camera's view but also have it show up properly in VR
honestly, I would like to know that too... I think it might be more along the lines of shaders with dual pass, but I haven't really found anything
I saw a world (I think it was called Udon Portal World) that had functioning portals that worked in VR, no idea how they did it though
probably possible through shaders
A snippet that I once saw and stashed. Never actually used it though, so not sure how well it works
var cameraScale = (headTracker.position - lastHeadTrackerPos).magnitude / (camera.localPosition - lastCameraLocalPos).magnitude; // Merlin's trick to get camera scale
oh cool
Though tbh not sure what the camera variable represents beyond it being a Transform of some kind.
i'm really not sure what that's doing or what headTracker or that camera are pointing to
headTracker = Networking.LocalPlayer.GetTrackingData(VRCPlayerApi.TrackingDataType.Head) basically.
camera is what I don't get. I need to poke the guy who I swiped this from to see if this is actually still valid code or not.
if i run a function on Update() it gets called every frame and eats up performance? What if the object the script runs on is active at some time, does it still eat performance when inactive?
at least you can make a bool, and if it false do return; from update before doing any work it shouldn't eat much performance. don't know if udonbehaviour will still work on disabled object after enabling it
if it's Graph then just a Branch from bool and do everything if true
ok but does it still ask for the bool when disabled every frame?
yes but by itself it should not do any great impact on the performance
functions can be called on a disabled script (as long as they've been enabled once before) but they will not receive any unity events like update
thanks
is there a way to lock the players movement when pressing Usedown on an Object?
immobelize on vrcplayerapi
Here are the nodes relating to forces that act on Players. For nodes that deal with Player positions, see Player Positions GetWalkSpeed / SetWalkSpeed float, working range around 0-5The speed at which a Player can walk around your world. Set this below your Run Speed. GetRunSpeed / SetRunSpeed float...
wow that was fast thank you so much ^^
So I'm trying to make a world where players can have these particle orbs in their hands, but when I try to line it up with them and make the particles follow them there are some issues. The emitter doesn't actually rotate from where the bone is but rather from it's own center, so how can I make the particles sit in the players palm?
How exactly do you wanna do this?
As there are different ways to make a particle follow something (Example: locking to object with Parent Constraint, or pull it towards you with a Particle Forcefield)
It all depends on the style of particle you wanna use
I actually figured it out. I just put it on a parent object and off set it a bit. Now when the parent object rotates so will the particle system, just on a different axis. But now I have a new issue... I'm trying to get the particles to be toggleable, but not traditionally. I'm trying to say if you interact with this object then the particles will start/stop looping (If I just turn them off they blink out of existence)
So you do not want them to just disappear instantly after the interacted with it?
Maybe make a script that stops the looping and then a timer to end the emission?
I already have the way to stop the looping... and I guess a way to start the looping... just no way to do either depending on if it's currently looping or not
have a bool run with it to tell it if its looping or not?
I don't know how to do that. I'm very new to Udon
your using graph or sharp?
graph
@full jetty this is with a toggle bool with stopping a particle looping
I'll try this now, thanks!
Where do I find whatever the Set LoopToggle is?
Nevermind, found it
Anyone know how to fix this?
for clientsim
and a smaller issue my vrchat examples udon script is deleted and even when I reimport the sdk it doesnt fix it know what i could do?
Sounds like you need to import a missing post processing package in your package settings possibly
where could I find that?
I have 999 errors about postprocessing???\
just checking, did you try and install the sdk along side the 3 different github urls from client sim?
yes
one of those links is a vrchat sdk. It will give errors if you have your own installed as well. would start there
I only have the official one installed?
I do see this
delete the one you manually installed. It will cause errors (I got 600 or so)
idk which one that would be lol
the one you got from the vrchat website
folders. but yea
yes
I couldn't get client sim to work with udon#
nevermind, doesn't seem like you have it
it just says I need to fix compiler errors
postprocessing gives me 999
and spams my unity logs lol
UnityEngine.Rendering.PostProcessing.AmbientOcclusion.IsEnabledAndSupported (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Library/PackageCache/com.unity.postprocessing@3.1.1/PostProcessing/Runtime/Effects/AmbientOcclusion.cs:183)```
Found the solution, remove and readd the post process layer
new issue
pretty sure all of the errors are spanning from the two sdks trying to both work, with one not working because of the other. you will want to delete the folders udon, vrchat examples, VRCSDK.
Do a backup first though!
yea, that's the second sdk making noise
will it run at all?
looks like its missing a directory
im going to try to reinstall it real quick
Assets\com.vrchat.ClientSim\Runtime\Helpers\ClientSimSpatialAudioHelper.cs(8,48): error CS0246: The type or namespace name 'ONSPAudioSource' could not be found (are you missing a using directive or an assembly reference?)
Anyone know what this is?
just reinstalled twice dunno why its doing this
how do i stop hating udon so much
lol
I just need this fixed
lol
What do these errors mean?
what is script limits for setting positions
selection.position = new Vector3(0, 999999999, 0);
x and z being assigned but not y
So I have an idea and I want to know if it's possible
Right now I have some effects that can be toggled on and off globally for everyone to see at my dj booth.
For optimization purposes I want to know if it is possible to make it so people can toggle off those effects locally and make it so the global trigger no longer effects them until they turn it back on
Is that possible?
By themselves
Sometimes it says (5 of 20)
I'm currently working on a home map for someone should I avoid using sdk3? I've heard that if your home world is udon other worlds won't work properly
This was a bug present around when Udon was first released and has been fixed as far as I know
The last time I saw someone run into this issue was last month I believe. I hope it's been fixed by now
Anyone know if there is a plan for bringing back old object sync? The current one does not support animation syncing and is something i need to convert my other projects over that have already made animations.
currently was looking at this trigger system that was made to work with udon but i don't think it will work with syncing animations up to late joiners and the stuff i had help trying to figure out with just got more confusing and seems to be either alot more steps that should be needed or to abandon my animations and start over. thank you
So vrchat keeps giving the message “make sure your device has working internet connection’ message pls help
try to join with VPN enabled, if even with that it will not work, ask in #user-support-old
sadly you need to make that yourself in udon
the old sync wasn't great either for animations
i see the sync seems to be working great for me in my 2.0? had this world for over 3 years
is there a way to do player teleport without interact by using something like on avatar hit? Or do I have to use on enter trigger ?
use this methods
after that you need to check if returned from method player.IsLocal (or player equals to Networking.LocalPlayer, both are doing the same)
ya just needs to be local its a player reset area to reset the map when you respawn
How would one go about using udon (graph if possible) to play an animation, or attach an animation to a slider? (eg. controlling brightness in a world)
Show I’m looking to Optimize my world even more than it is already to get give more fps any tips
Question does anybody here take udon coding comissions ?
I want to make a small game in a world i got. I cant code it myself ive tried XD
I have a weird issue where players can run around and do stuff while they are stuck at the spawn for everyone else. No idea when it happens, and why, and I personally have never seen it except other people showing it to me.
They seem to be moving a little bit, and you can hear their voices.
do you have stations/chairs in your world? there was a time period where stations would get people stuck and if you reloaded the world the player was stuck in. theyd get stuck in spawn for others
how would i hook up a teleport spot to this? not using interact so no field to drop my empty to
using on enter triggers
figured it out had to drag the transform part in the object and not the object itself from my list
how would i make this local only and not global ?
I think you need to install those packages in a new unity project, not in one that already has the sdk in there
Unfortunately, there are no chairs. Could avatars having chairs cause such an issue?
Does anyone know how to toggle particle looping on and off with udon?
Do you know how to make a ParticleSystem reference? You can access that and change main > loop.
I'm able to turn it off, and theoretically turn it on, but not toggle them
Create a variable of type ParticleSystem. Drag a node out of it and search for "main". Then drag a node out of that and search "loop".
This is how it will look like
How do I get it to toggle the looping though?
uhm is anyone here and can halp me? i have stil a problem with Videoplayer to use a Reverbzone qwq
Do you want to just toggle on and off a particle?
Or is the looping important?
If the looping is important you can do this:
The looping is important yeah
It's the only way I can think of that won't just blink the particles out of existence when they turn off
Alright, I'll try this out. Thanks!
Np, looping might work with that. If not, you might want to look into stopping the particle system manually.
Toggle the particles by their emission tab not the emitter itself that keeps the ones it emitted going till their dead
But stops new ones from.emitting
So... it turns them off but not back on again... how do I fix that?
how i turn local function to function that syncs for everyone
So I have an idea and I want to know if it's possible
Right now I have some effects that can be toggled on and off globally for everyone to see at my dj booth.
For optimization purposes I want to know if it is possible to make it so people can toggle off those effects locally and make it so the global trigger no longer effects them until they turn it back on
Is that possible?
(resent)
You could try the methods "Play" and "Stop then. Alternatively, you can access the rate over time and set it to 0 (what the person before suggested).
i got my teleport to be local . is there a way to make my set active go local? the on player enter trigger is making it global still
Check if the player is local before you teleport.
how?
The reason it's "global" is that you see every player move on your client. So other players can move into the trigger on your screen basically.
player > islocal
the player is local at teleporting but the rooms are still global
and then plug that result into a branch.
i need the node between the teleport to and my block to convert the global back to local if possible
my teleport is working fine
Take the player you get from OnPlayerTriggerEnter and the search for "isLocal". Plug that result into a branch before or after the TeleportTo, it doesn't matter in this case. I'd recommend putting the branch before the teleport because it can be called on a local player anyway and will otherwise be ignored.
Uhh... yeah I have no idea what to do about the particles... I'm very new to Udon
do i plug in the player api to the branch ?
will this work to make everything local ?
Yes, only if they local player enters the area will the rest of the code get triggered.
so only the 1 that enters will tp and set objects active ?
ty going to test with alt
teleport broke can't trigger the set up when i run inside the colider
I figured out the particle stuff!
Your TeleportTo needs the player instance plugged in.
from my get is local ?
Probably can just use the player from OnPlayerTriggerEnter.
TeleportTo will crash if it's missing the player in general. Same with all other nodes that require all the inputs.
should the branch be true or false? trying to make the object active also local and active with the tp
i have to use false which only makes the tp local and not the set actives
could i use exit trigger for after player teleports it does the object actives?
Do you want the objects to be set active for everyone or only locally? Your use of "local" confuses me here.
im trying to have everything local this is my manual cull. when a player leaves a room they load into another room. the teleport is them moving to next room while the objects active true and objects active false controls what that player loads into during the teleport
with the interact it would work fine but because i need it to be a walk in for what ever reason it wants to be global by default.
i think i figured it out
i think this solves it
tbh the 1st branch on the tp might not be needed at all
I already solved it and published thank you
advanced udon graph user LOL
thas a lot of udon graph
lol no i suck at udon and wish they didnt ditch 2.0
ong same
2.0 was best
too much extra steps less user friendly and easier to break
udon does allow for some custom scripting tho something never possible before on vrchat worlds
which is nice
quality of worlds has increased with udon
ya i just wish 2.0 had udon applied on top of it not seperated my world im converting slowly has like 16 rooms in it and the new object sync doesnt work with my animations
cyan made a trigger system but i decided to just do it the hard way
same
I had to relearn everything for my world
they will keep nodes, udonsharp is just a compiler made by someone, not the vrchat team
although they did hire the person that made it recently
kinda wish udon had a pre made node system for multiple things like how they did player mods in the world asset that gives you your jump etc in udon
yeah they hired them
idk im more comfortable with nodes lol
my friend says he only knows how to use udon# and not the graph LOLLLL
same here lol
wrote thousands of lines of u# code but never used graph
nodes is easier on my eyes scripting is giving my html5 flash back in my game design classes lol..
graph is easier imo
graph seems easier but slower than scripting
for small things it is yeah but if you wanna make something complex graph only slows things down and makes things more confusing
it's harder to keep order for very big scripts
yeah even with avatar peds i use graph i can not use the U# shit idk how that works lol
it's faster than dragging nodes
code ew 😂
i reccomand using the block nodes to keep things clean like how i did on my game set actives true and false collumes
its code i have to learn and im not willing lol
and in graph you don't have function arguments and function returns which makes everything aside from simple things like a million times more tedious to do
my collumes will get pretty long im using a is trigger at spawn to reset the world to its defaults
i mean thats not that hard
I also use legacylocomotion bc Nostalgic old locomotion Sdk2 style chad moment
im keeping udon close to how my 2.0 logic was so if vrchat ever just poofs my unity will have easy to redo with any trigger system
ye
doubt vrchat would poof but other unity based social vr games live on lol
for complicated games i would say scripting might be best if can use but i would still node
if anything would succeed vrchat it'd probably run on a custom engine
hope vrchat keeps lasting even tho i hate the udon and spending hours to figure out 1 thing that was fast in 2.0 wasnt fun but they did make something interesting just wish they stopped adding extra steps to ever update. dont fix it if it isnt broken
just use cyantrigger if you don't like udon
I never used sdk2 but from what I've seen it looks a lot more annoying to use
but then again I've been programming for a few years so learning udon wasn't that hard for me
i need to figure out how in udon you can make animation sync that the old object sync had. really need the old object sync bk xD
yeah syncing is really annoying in udon
the stuff the triggers did was fast but the over all syncs needed is still a pain even if i went with cyans
https://docs.unity3d.com/ScriptReference/AnimationState-normalizedTime.html you could maybe sync a float variable in a continues sync and then make it set the normalized time on the clip, or if you want it to be less stutter you can make it check how big the difference is between the local animation's time and the master's animation's time and sync if it's above a certain threshold for less frequent stutters but larger individual stutters
maybe but i have to see to kinda understand
spent all day figuring out my manual culling to be local
haven't tried is yet but this should work if you use continues sync
to replace object sync?
o ok so this is the part that 3.0 removed
I cant find the scripts for these new contacts and receivers
That would be an #avatar-help question wouldn't it?
why isnt my dynamic bones working at all for me on vrchat quest?
The new physbones have to be added manually for quest avatars because the already uploaded quest avatars don't have dynamic bones on the quest versions, so they can't be converted to physbones either. It'll only work on newly uploaded avatars which right now (a few hours after launch) is pretty rare but you'll probably come across more soon
working on a game world with two rooms, a spectator area and a play area—i want players inside the spectator area to be able to hear everyone, but players inside the play area should only hear other players inside the play area.
is there known good practice for doing this so i don't have to go crazy in local testing? searching for anything involving "mute" makes the results a giant mess, LOL
That should be pretty simple. Are the rooms near eachother or far apart? If they are far apart you could just set the voice far value of everyone in the other game room to far for thenprople inside the spectator room
If it's nearby and you might need to turn down the people inside the spectator room for thrbpayers so they can't hear them
it’s around a 3-second walk, LMAO
are OnPlayerTriggerEnter / OnPlayerTriggerExit reliable for players besides your own?
How do I set ownership of an object to a player?
It is in my experience so far. I have written a script that makes everyone inside a collider not be able to hear everyone outside and vice versa. And sync that for late joiners
nod
aaight, thank you for the information
if you've got that script uploaded anywhere, would be cool, but as long as trigger regions are reliable this doesn't seem too bad
I don't believe I do. It could definitely be written better too, I only needed it for one room but if you wanted multiple it would be better to move the playlist management to a separate behavior as I had it all in one script.
I can find it after work if you need but it wasn't too complicated to do.
i'd appreciate it if it's not too much trouble, just because testing networked stuff from a single PC is a huge drag—I only need a single zone as well
if nothing else, it'd be a nice reference to have for late-joiner stuff
Is it possible to have udon (or unity in general) read data from a spreadsheet?
yes, you can reference .txt files as a TextAsset
dump your spreadsheet in there, use string operations to split and parse it
I always just use the launch multiple clients for that in the sdk menu. Gets the job done.
I'll put it on my GitHub after work tho.
I may need your help with this further in the future, is that okay? I'm making a VR Pokedex
My camera kinda died? How do I make it re-appear and show the lines of what it sees?
did you disable gizmos? (clicked this button)
I'm trying to make a video player emit light that casts shadows from dynamic objects. All the solutions out there which I've found so far for having a video player emit light can only handle baked shadows. I think a color changing shadow casting spotlight combined with a real time reflection probe would give me an effect which is good enough, but I need a way to sample the average color of the video that's playing. I'm guessing the fastest way to do that would be to sample the lowest level mipmap of the video player's rendertexture. Has anyone tried this? I'm pretty sure I've seen lighting effects in worlds which change color with the video that's playing, so I'm thinking someone has already made this work.
https://github.com/PiMaker/ltcgi
Ltcgi is probably what you've seen before
But that still only has static shadows
I'm pretty sure you can sample pixel colour from a render texture though and use that to set a spotlight colour
tysm! really appreciate it
No worries
Im pulling my hair out. When i teleport the room does not get enabled and i just fall. It was working a minute ago then i change something unrelated and it breaks?!? What is wrong
if you change something and it breaks it might of broke the chain. from experience i found if in your var list in the inspector area has any empty areas ( self game object) that can break your set up. i dont know much about udon and i been using a differnt system to interact with the manual culling and tp
I thought so too so i went and disabled the one other script that messes with it and it remains broken. This has happened before but randomly started working again until now.
if you didnt save after the break you can restart unity and reload it to fix usually sounds like something i had happen to me when i stuck the wrong nodes together and my ok green switch became a red ! even after completly redoing the nodes in script. or if you cant fix the script try a new 1 with the bare min to test making sure you complie it and have a green ok.
too late already saved over it unfortunately
can try and save that script put to the side and make a new 1 to try again?
just make sure you compile and its green
the script wasn complicated so i already deleted its contents and started over
o ok
yeah no other script is using anythin related and the gameobject doesnt get turned on
ok well i fixed it
i changed nothing just kept recompiling and testing
ya udon does that. spent a whole day doing my tp on enter and manual culling. things kept breaking or reverting to global instead of local lol
does the block do the nodes in order from top to bottom? i need to reorder my teleport so the next room loads b4 you get there or at same time to remove flickering of things being activated
well fixed my issue i removed the exit trigger for culling and only used enter trigger for both and have the tp and culling attached to a block. flickering is gone
is the get local really needed or could i just use direct with the branch switched to false? trying to simplify a little more since i have to repeat this for my other 16+ rooms and i don't think i can copy nodes over to new scripts lol. will be at least 30+ doors left to plug bk together from my 2.0
why would you copy this over?
there is an idiom known in computer science (and many other aspects of life...) DRY: don't repeat yourself
it's a bit hard to follow your graph, as most is not shown
just note, you cannot teleport anyone but yourself
its manual culling for local
everything after the block is either teleport or the 2 set game object actives
that does not really explain why you need multiple graphs when you can just use the behaviour again
why do i see other ppl fall avatars and hwo to turn it off
does anyone know how to have 2 different sounds play when interacted with?
Store them as separate references and just call Play() on one after the other.
ok how would i do that
Yeah, that function is available in Udon Graph. Udon just mirrors Unity's C# library.
(most of it, anyway)
ok
So, I heard a rumor that Avatar Pedestals can be used for persistent world data... does anyone know anything about this that can expand on the subject?
there's the avatar image reader project "Decodes UTF16 strings from image data stored in avatar pedestals. Allows you to update text inside a world without updating the entire world."
Bingo. That's probably what I heard about. I'll look into it.
I have a UdonSharpBehavior question:
How can I set from script 1
Namespace.Class.Void();
so it runs in script 2?
Both are UdonSharpBehavior c# script but on 2 different GameObjects.
Because
using namespace; //Namespace from script on different GameObject
public class blabla :UdonSharpBehavior
{
public class MyClass
{
public static void Main()
{
var anInstanceofMyClass = new MyClass2();
anInstanceofMyClass.TestCall();
}
}
}
is not working in Udon.
Or when I do:
using namespace; //Namespace from script on different GameObject
public class blabla :UdonSharpBehavior
{
public class MyClass
{
public static void Main()
{
MyClass2.TestCall();
}
}
}
Then I get an CS0120 (An object reference is required for the nonstatic field, method, or property 'member') error.
Thank you in advanced.
(A) you really shouldn't be nesting classes in UdonSharp.
(B) You shouldn't be using statics either, generally
(C) You need to store a reference to the object on which you want to invoke the method as a class member. Then you can assign that reference in Unity's inspector window.
Trying to make a button that disables all world audio (audio caused by a toggle on/off button with the audio attached to it). All I want the button to do is turn off the audio, that's it. And then I can go back to pressing the audio toggle buttons and they continue to work. I tried one way but it caused the original button (the toggle audio) to not work at all,
The image shows the code being used to mute all audio. The intended effect being as if a player pressed the toggle button, but it happens to all toggle buttons at once. This current code as I said stops the original button from working however.
So literally just a stop button, that's what i'm tryna make, but it no work
Did you assign the audio source in question to the "newVariable" slot in the inspector?
Do you mean something like this?:
public class blabla :UdonSharpBehavior
{
[SerializeField] private UdonBehaviour OtherGameObjectScript;
public class MyClass
{
public static void Main()
{
OtherGameObjectScript.Invoke()
}
}
}```
That's better, but you still need to stop nesting classes. And there is no Main function in Unity. You probably want to use Start or Update (and not static).
Ok, I can see If I can make a work around without nesting. The Main was only for this example.
yep, it stops the audio as intended
then the original button stops working completely
What's the code for the original button?
Looks to me like you just may need to press it twice after using the mute button (because the mute button won't ever effect the "Toggle" boolean).
Also, you could refactor that toggle boolean completely out and just branch on the AudioSource's isPlaying property.
i'm going to try something drastic, i'll update you (i tried that way btw and still no)
How would I make a interact that would reset multiple moveable objects to original positions?
your interact would preferably send a custom event that is used on all object-scipts that you want to reset
Provided they all have an object sync component on them, you could create an object sync [ ], and cycle through it with a for loop, playing the node objectSync, respawn.
Here's a video on that: https://youtu.be/nSIFN9rRcQs
respawn object tutorial: https://youtu.be/p6vtL_BRMEo
cycle through array tutorial: https://youtu.be/s3mZ7SLfmzI
This has been asked a few times now in my comments on my original video covering how to respawn only one object, so I thought I better address it in a little more detail. Didn't think it warranted a full video though, so here is a ro...
Ty, the video will really help
Do check the comments though, as I forgot to do something in this followup video
This will just respawn all objects with an object sync attached correct?
Not if you store them as a class member array and assign the ones you want in the object's inspector
This will create an array, which is essentially a list, to which you can fill in the slots in the inspector, of all the objects that you want it to respawn when you click the button. You will have to fill out the list in the inspector
Dude, he's a beginner... Simplify your language...
I would recommend watching the first video covering how to respawn 1 object, to get some context
Thanks 🙏🏼 and ok I’ll do that after work and yes beginner is a overstatement
We all start from somewhere. Feel free to ask around if you get stuck ^^
Got it to work thanks for the help
glad it helped ^^
very much so, so do your other videos
actual just one thing, when i interact with the button the first time, it resets everything, but if i move the obejcts again, it wont reset them a second time?
Wrong chat but probably because of your Max download size in safety settings
huh.. that sounds like the script is crashing after it respawns the objects. Mind sharing a screenshot of your scene/ code (windows key + shift + s hotkey to screenshot only part of your screen)
and can I see the inspector?
Sorry, I meant that i wanted to see the whole udon behaviour in the inspector. Including this bit
it goes down more theres 92 in total
ah, there's the problem. you can't have any empty slots in the array. they were at the end, so the code crashed after it respawned everything above it. As unity is a bit of a pain for changing values causing it to reset values, I would (if your pc can handle it), change the array's size to 10092, and then delete the 100 from it
ah ok that makes sense, yeah pc definitley lagged when putting in 10092 but ive lost an array with a prefab i had before.... learned that the hard way
I could add some bit to the code to check if there is a value there, and therefore allowing for empty slots, but I kinda like having simpler code for tutorials
totally fair, it works now so thank you
How do I reference the player's view camera?
You can use GetBonePosition/GetBoneRotation or GetTrackingData methods of the VRCPlayerApi instance:
https://docs.vrchat.com/docs/player-positions
Here are the nodes relating to Players' positions. For nodes that deal with forces relating to Players, see Player Forces GetPosition returns Vector3 in World SpaceGets the position of the Player. GetRotation returns Vector3 in World SpaceGets the rotation of the Player. GetBonePosition returns Vect...
I don't know if you can get a reference of the camera itself.
Oh ok, thanks!
More or less an avatar question but um
Is it possible to add a custom script to an avatar?
I'd like a script that could change the value of the value inside the FX (Float Value) in increments when a Contact Receiver is set to true.
For example: The longer you press the nose, the farther the ears will slowly go down.
This is 100% an avatar question. Udon scripts can't be run on avatars, only worlds. That being said, there are a lot of hacks used with avatars, and with the new avatar dynamics, many more options are now available. I would ask in #avatar-help
hi, i have a question, everytime i change my avatar in vr chat, my arms are down and i can't control it, is there a fix?
like i just cant control my avatar
this is a question for either #avatar-help, or #user-support-old
ok ty
Hello there, im just new here. I just tried to build fresh and new UdonExampleScene, and those error appears. any ideas?
(also i want to know how to test in-editor, like player interactions)
I got another question, I have two buttons that do the same action and are in sync with late joiners. But how do I get the other button to perform the same sequence by pressing button 1? and cause button 2 to also trigger? Reason for it cause When you press button 1 to open it and then press button 2. It will open too but 2nd time will close it. I want both button to be in sync with each other according to the interact.
You need to have opening state in the door object. When a button is pressed, read state from the door it controls, then unary negate and set back to the door object.
I cant test/build as this shows up -and im confused on why? the scene is downloaded is it as the scene needs to go onto evberything dropped into the world if you drop assessts/furnitre or?
Look for previous errors too
^^' I fixed it, i was trying to set up some pens and deleting that worked for some reason? might of eben a coding error releating to the pens
Hi have a question if someone might know the issue. So I did buy vr today and was on PC before, and now I can’t use 90% of all my avatars and also can’t see others avatars, anyone know how to fix that?
do you use a quest?
I have multiple toggle objects for udon graph, but how do I make it so activating one toggle will reset the others?
if that makes sense
because it's text and I don't want them to overlay on each other
?
More of a technical question than a true udon question, but should we expect any performance improvements with Udon considering the recent upgrades to the avatar SDK with this new unity compiler ? Currently udon can be hundreds of times slower than C# and figured there could potentially be more than meets the eye with this
no, burst compiler is not being used in udon
Sorry, let me ask this in a different way, are there plans of having the udon vm run through burst in the future ? I know udon code itself won't ever run through burst
I'm not entirely familiar with burst, but it sounds like it's supposed to just work with the jobs system better. Udon is not multithreaded and even if it was, it would need massive changes to existing world scripts to take advantage of that
it seems like it would be quite the feat to get udon to interact with the jobs system though. I think there are better ways to get performance before introducing multithreading and jobs
Hi I don't know if we ask questions here or not but I'm looking for avatars with the dynamic bones trait since it just recently came out on Oculus I'm trying to find some people that know where good ones are for females
Hey!
does Udon work with 2d arrays or jagged arrays?
ive seen that it doesnt work with 2d arrays but using a jagged array just results in this and im not sure why
I'm using jagged arrays in my project and it works fine. normal 2D arrays are sadly not supported.
Check for IndexOutOfBounds errors, put some logs of your index and the length()s in your code.
make sure that you initialize all layers of the jagged array
it's just putting an array inside an array, so if the children arrays are still empty then trying to access them will not work, same as any other array
btw, did something weird change with canvases and buttons in the last six months?
My old canvases still work perfectly well, but if I make a new one and add buttons within a panel, they don't work.
Image: blue marked button works, red marked button doesn't work. They have the same setup, the canvas has the UdonUIShape on it.
the not-working ones don't even turn darker when clicked, so it's not a script error.
All of them work in unity play mode, but not when built, so it has to be something with the canvas I guess...?
are you sure it's not being hidden behind that text?
I don't think so, looks fine to me
the "i" is slightly obstructed but works perfectly well
there's some other element there, is that the text that says minimum local buffer? Or the 40ms?
try going through the common problems here https://docs.vrchat.com/docs/vrc_uishape
Script used to make Unity UI interactable in VRChat. Requires a Unity UICanvas element on the same GameObject. Steps to making an Interact-able UI with VRC_UiShape Add a Canvas using the right-click menu in your hierarchy.Add a VRC_UIShape component to the Canvas.Set the Canvas Render Mode to World ...
accidentally rotated the canvas in the last screenshot, text got hidden behind the mesh.
these things also seem fine, I'll read through the link you sent now ^^
that doesn't look fine though, that looks like it's pretty clearly sitting directly on top of the buttons
thick white outline is a panel that contains the 40ms and the buttons.
things in the link are all things I already checked.
Might just have to make some mesh buttons instead, adds the benefit of showing the interaction text when pointed at
could you show me the button's events?
sure thing.
But again, not even getting the darker tone, so it's probably not reaching that part.
ah, if it works in play mode but not vrc then it's usually something wrong with the vrc uishape
can I see the whole gameobject of the canvas, including the collider if it has one?
the inspector?
1 sec
oh god damn it.
apparently it was because it was parented to a gameobject and rotated 180°.
unparented it, now it works...
So I tried to convert a C# script to an udon script and it seems to have broken every script in my Project
Can you make an API get request in udon?
Does anyone know how one would go about making an engine sound that is variable to speed?
I am trying to convert the standard assets script but its much more complicated than expected
Converting scripts would be a hassle to walk someone through, but here is my two cents for this question. I did this for a hoverbike world I made (and later abandoned), and at first I used a bunch of animations, and put them all into a blend node in an animator. Then I could change the float parameter on the animator, via udon.
Later on though, I just went for a basic pitch change, and this was the code for that:
something I did notice however, is that it would stutter like crazy if I had a vrc audio Source on it, but it was fine with just the standard unity one. thinking back to it now, it may be because I did it on update, and not late update or something, but I'm sure someone else would know more
I've come to a realization that the script I been working on for a week, Is overcomplicated but unable to create a simple Graph of a certain thing.
Udon Behavior 1 is suppose to spawn food onto the plate which looks like this
Udon Behavior 2 is suppose to be on the food that when you interact with the food, It becomes unparent which looks like this
and mouse interaction which causes the food to be eaten and disappear looks like this.
Problem is this whole thing isn't properly graphed properly, Which Behavior 1 is activated and works fine but Behavior 2 is obsolete because the first one is using the animation that causes it to constantly play and never change with the 2nd one being triggered as well the the 3rd. I am not exactly too sure how to even graph this whole thing properly. Despite the tips I been given, It hasn't been working too well.
Okay, so I’m trying to make a toggle in which I press a button, it sets an entire area inactive. (I have the transport script)
I have something sort of working, but its under the premonition that something is already inactive. I feel like this should just be an easy script to make but yet I can’t figure it out
Hey, dumb question but how do you get Comments in Udon?
It's not showing up in search, and it's not under Special ->
Update: I am not a smart man
How do you make something work globally in U#?
how i make function synced for everyone
hmm i see i have to sync entire class
please specify what you mean with "something". Otherwise, the answer is just "synchronization"
SendCustomNetworkEvent(VRC.Udon.Common.Interfaces.NetworkEventTarget.All, "EventNameAsString") for U#
or a node also called SendCustomNetworkEvent in the node graph
note that this does not execute it afterwards for late joiners, so if you're changing the state of something, like opening/closing a door, used synced variables instead
Does anyone know how to get the pens to work when editing in android? I got them to finally load into my quest world but nothing happens when you try to draw with them, the tail length is .5 also
can you tell bit more
Are you using nodes or U#?
u#
and since i dont know csharp at all
main difficulty is that function has rng in it so i cant put it whole into sync as everyone will have different results
public override void Interact() {
GameObject test = GameObject.Find("Deck1");
if(test.transform.childCount != 0f){
Transform selection = test.transform.GetChild(Random.Range(0, test.transform.childCount));
selection.parent = GameObject.Find("Deck1 active").transform;
selection.gameObject.SetActive(true);
selection.position = new Vector3(6, 1, -1);
}
}```
Alright.
If you want a function to be executed by everyone that's currently in the world, use the line I posted earlier.
Keep in mind that this is fire-and-forget. doing e.g.
SendCustomNetworkEvent(VRC.Udon.Common.Interfaces.NetworkEventTarget.All, "CloseEntranceDoor")
will, provided you have a function called "CloseEntranceDoor()", fire that function for everyone. Players that join after this line has been executed will not receive this call.
If you want something to be synchronised for everyone, even when they join late, you use synced variables.
Put a "[UdonSynced]" above a variable to sync it. Since SemdCustomNetworkEvent does not directly allow you to transfer variables, you can use this in your case too.
Now, there's two methods of synchronisation, only one can be selected per behaviour:
continuous and manual.
synced variables in a continuously synced script will always stay synchronised on all clients, while manual synced script sync all variables only when you call "RequestSerialization".
i would use synced variables but these seem to have much more work with them
They do make things a little more complicated. Keep in mind that you can always use both (any)synced variables and SendCustomNetworkEvent together., this can sometimes make things simpler.
as soon i paste in udonsynced im having lots of errors
a bit difficult in your case since transform can't be synced yet. I gotta test something really quick, back in 5 minutes or something
i mean if i only can sync values like ints and bools then i would need another function that assigns them to correct places
ok so i want to make a basic udon ai. just an avatar that look at the player for now but not sure what to program or where to start with this anyone have any advice. i can already do basic codeing in udon so no basic tuttorials plz
guess what i would like to know is how to get a players viewball location?
I don't know exactly what your goal is with these functions but one way to do this would be to put a UdonBehaviour onto your child objects that contains a synced bool (manual if you don't need to keep changes for new joiners, continuous if you do).
Then, on OnDeserialization, use the bool to see whether the child should be to its new parent and do all the other operations there if the bool doesn't match its status.
I don't know about the camera, but you can get a players head transform using
Transform _playerHeadTransform = Networking.LocalPlayer.GetBoneTransform(HumanBodyBones.Head);.
or just its position using
Vector3 _playerHeadPosition = Networking.LocalPlayer.GetBonePosition(HumanBodyBones.Head);
can i just make one more script that will auto sync whenever player joins or value changes
thats a start for sure thanks.
...apparently you can replace the Networking.LocalPlayer. and just use VRCPlayerAPI. instead
cant i make synced variable have sync like object sync component?
you can definitely do that. Do not be afraid to have a small script on 100 objects though, especially if it's just used as a container for manual syncing.
Keep in mind that, if you have one script dedicated to syncing, it will sync all variables of all child objects you want to keep track of, you can't sync a single one.
Using a script to keep track of syncs while the syncs themselves happen in these container scripts on the individual object keeps network traffic low.
I don't know what you mean by this, sorry ^^
like vrchat automatically manages grabbables
and dont have to do anything more with them as they are always synced properly
hoever when i want to change position or toggle objects then all changes are just for one player
i would like each position or state change be shared across clients
that's basically any UdonSynced variable in a continuously synced script
but problem is i probably have to all time run loop that syncs it
and index everything
that's why I'd just put the sync script on the individual objects and see how well that works. Saves a lot of hassle
if you join, send an event to the world owner/master that tells all objects with the script to RequestSerialization
can you get a list of the child_objects from the script of the parent? How can i send a custom event to the child?
@spark walrus well you can send a custom networking event and then recieve that event on the child object.
@spark walrus you can also use an animators perameters as well.
How do make things with udon?
Did the avatar dynamics update do something to framerate-based calculations? like are update and fixed update no longer framerate dependent or something?
your max fps in desktop now matches your monitor's refresh rate
pinned message #udon-general message
Hi there, I'm currently using UdonSharp, and I just tried to test TriggerCollision
private void OnTriggerEnter(Collider other) {
if(other.TryGetComponent<OdenBehavior>(out OdenBehavior oden)) {
oden.SendCustomNetworkEvent(VRC.Udon.Common.Interfaces.NetworkEventTarget.All, "Fry");
}
}
and Error appears like this
Assets\Scripts\UdonBehaviors\OdenSoupBehavior.cs(15,51): System.NotSupportedException: UdonSharp does not currently support node type DeclarationExpression
any ideas?
use GetComponent instead of TryGetComponent
then if you need to check for success, you use utilities.isvalid
it works PERFECTLY!! thank you sooo much
I would also recommend doing utilities.isvalid on the original collider other just in case. There are some cases where it is possible to receive ontriggerenter from a protected object like vrchat's UI or player colliders
Wait... what? then I should use Utilities.isVaild(<somthing Collider>) for just in case...
another short question, how can I detect runtime exception during test?
you can watch your log for exceptions
which you can access ingame with rshift + tilde + 3
or you can set up the udonsharp log watcher in edit > project settings > udonsharp. This tool will watch your logs for errors and create the error in the unity editor, and clicking on the error will bring you to the exact line of code in C# where it happened
what's udon?
?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...
can i get object origin position
is it possible that an udon behaviour script could overide your proximity settings in the pickup script? It doesn't seem to matter what I set the pickup proximity to, it does not change (you are able to grab the object from too far away) looking for possible causes. Object is in the root of the hierarchy. Collider is the same size as the object. Also does the order the scripts go within the inspector matter?
are you testing this on desktop or vr? I believe it only effects vr
VR
Basically you can see here how far away the object is interacting with the player, even though it's set to almost nothing. Is the proximity setting only for non pickup-able objects? and if so, how would I adjust the proximity for grabbable objects? This is being used on a lighting control system so there are many of these objects, so when the proximity is this high, you often end up getting the wrong object, or it interferes with other non grabbable objects.
what if you actually set it to nothing. can you pick it up?
yes
makes no difference
It looks like the proximity for movable objects is preset. The proximity setting only effects static objects like a button or toggle. This also seems to be the case for canvas UI objects, the proximity setting has no effect on that either. I put in a feature request for pickup object proximity (unless anyone else has some ideas) I see others are asking for this for the canvas UI as well.
How would one go about disabling player collisions when in a seat?
Set their layer to walkthrough using a gameObject.set layer node, with the event onStationEntered. Either that, or use collider.set enabled node
is the phizbones in unity already or is it a file I need to find and download
alright, I have my world and I have areas load and deload on teleport, mainly for optimization. However, I need to add a script that like, sets the main area active on respawn, as I have several people who do this to get to the spawn point to see their friends quickly. Is this even possible?
Depends on how your choosing what parts to load and deload in. Usually I would have it setup with an int that says what part to have loaded in, and then just change that int when I enter a different area.
Then all I would have to do is have a event OnPlayerRespawn node, and get it to set the int to the starting zone (usually 0 for me)
I managed to make a work around.
I have a platform under the respawn point that you fall on. From there I have two buttons that need to be clicked that gives the reverse. You have to respawn twice, but it works for now.
I can't seem to find a node that allows me to connect playerApi output from OnStationEntered to the gameobject. set layer or to the get collider node to use collider.set enabled
the playerApi is saying what player entered the station. it doesn't contain any information about the object you want to change the layer of.
From the playerapi, put that into a playerapi. is local node. that will give us a bool to say whether or not it was us, the local player, that entered the station. Then put that into a branch node with the arrow from our onStationEntered plug into it's arrow slot. Now we only want to toggle our object if we were the one to enter the station, so coming out from the true arrow, we want to plug that into a gameobject, set layer node.
this node requires both a object to change it's layer (the instance slot), as well as the layer we want to change it to (walkthrough layer = 17). Go up to your variables tab, hit the little plus button, and create a gameobject variable. Give it a name, and hit the little dropdown and make it public. Then plug it into the instance slot.
When using the code, you will need to plug the target gameobject into this slot, in the inspector.
Oh wait! I had wanted to set it so it disabled player collisions so it would still interact with other players. It now occurs to me that the state of the colliders is local so any change made would be local to the player in the seat, so changing the layer would not impact other Udon code and collisions running on other players, correct?
yup, it's local
Now to find a layer that doesn't collide with player or walkthrough lol
Or would it be playerlocal?
How would I make an area that sends an event or trigger if an object is placed on it? (or a certain amount of specific objects)
preferably using Cyantrigger
Help someone make one a while ago, that was if enough mugs where placed on a table, the table would break. This was the script that went on the object being placed on the table:
and then this was placed on the table itself
@red gazelle thank you for the nice words!
To answer your question, yes, as you probably noticed it recognizes note-on events at note-off when velocity is zero. This is common practice for modern midi devices, it's just that a lot of people don't read the midi spec when making maps, since note-on and off seem so intuitive :D
For the networking, I'll have to answer that laer because my break is over rn, sorry :P
Hey guys!
I'm in a bit of a pickle.
I have base64 strings of images in a json file that I want to load in vrc.
Is there any way I can convert these strings to images/textures?
I have tried creating a new Texture but Udon doesn't support the constructor of this.
If you have any idea's, thank you in advance!
Hey so me and my friend are in development of a Bendy Themed Horror World,wanting to add monsters that chase the players,any one know how to make a monster AI for Undon?
Or if any pre existing thing that we could use and edit
you can check this https://youtu.be/xVXXS7HX7Og
In this TLX Spring 2021 session, Centauri focuses on how to create simple local and synced AI, and different ways to sync it between multiple players.
Check out other talks from the TLX Spring 2021 event at https://www.youtube.com/playlist?list=PLTgqlzYxsEMxiUvVaqBcD5OL9MpdmkiSH
Learn more about Prefabs TLX at https://tlx.dev
Follow TLX on Tw...
hi there, so uhm, udon just screwed up my complete project, and now i cannot even use it in a new project anymore, cuz im already getting 36 errors, is anyone mabey able to help me?
what is the latest udon version rn?
UdonSharp_V0.20.3
Is there a way to make a point system using buttons to add certain points on a scoreboard of text?
I want it to add a number to text with one button, but if a second button is pressed a different amount from the first button is added ontop like a counter. Ive tried using ints but it just replaces the existing number instead of adding with the amount there.
You'd usually have something like a "counter" int which you display on the UI. Let's say a button press is a + 1. That means you increase "counter" by one and then update the UI with the new value.
Not sure if that's what you meant though.
You could try posting what you tried.
This is what I had so far
Are you trying to use a for loop to increase the number? Try creating a variable and display that as I suggested before.
All I want is that when this custom event happens, I want it to add numbers from the addition Int to the text and if there is already a number on the text to add ontop not replace it
There is no counter Int
Is there a way force a user into a defined avatar or scale to specific dimensions for the duration of the map visit or in order to participate?
You have to create that int yourself in the variable creating window.
You use that to store your counter, then add to it, and then to display it as text.
I don't think you can force them for the whole duration, but I'm pretty sure you can force them into avatars, there is a method for that.
How do I connect the variable to the addition int?
When you drag in a variable, it shows you that you can get or set it (and their hotkeys). Use get to drag it into the addition node, then drag the output of that into the set node.
Like this?
Know the function by chance? I am just needing to enforce consistent dimensions for fairness and to expose hitboxes as needed for workable combat mechanics.
I have a feeling I already know the answer to this, but
I have an idea for a game and would like to automatically post and store user scores via a webserver.
I know that using the video player I can do GET requests, but is there anyway to parse responses coming in from that?
Also, are you able to change the header and body of that request?
No, you are using using the wrong get. Notice how it says Int32[], you need the one without the brackets. Just drag counter in and it shows you the hotkeys for it.
Also, you don't really need the for loop, I'm really confused why you are using it.
It looks like you are missing some coding basics, so I might make a graph myself in a bit when I have time.
It's the VRC_AvatarPedestal, which has SetAvatarUse. Not sure if it's the right one since I never used it, but that's the only one I found so far.
Im having trouble finding it, Do you mean get value? There is no other get node besides the one you said is wrong
Drag and drop the variable, it shows you the hotkeys
Something like this:
CTRL is for making a set node
So the Set Counter is what I need?
I just tested this and it works by itself but with all my shit i did I need to fix it
i have soo much errors with udonsharp, is there anyone able to help me for a sec? i already recreated my world 3 times.
Do you have the errors in the fresh world?
Right after importing the vrc world sdk and udon#?
i do yeah, right after importing both of them.
i just got it working, but the errors are still there, and when i click play, it even gives me more errors.
What are your steps for importing things? You must have a wrong version of something or doing it in the wrong order
What versions of you have of:
Vrchat word sdk
Udon#
Unity
all of them the newest ones, i just downloaded everything fresh
and unity is 2019.4.31f1
is there any prefab that let you add picture as a slide?
like a powerpoint presentation
Hi, random question, can anyone tell me how to go about restricting arm and such movement in vrc world stations? The custom animation I have always plays for a second before giving tracking back. I haven't been able to find information on how, so I'm asking around.
If I wanted to make the players speed
4.317 m/s walking, 5.612 meters/second running, and jump 1 1⁄4 m, what would I need the values to be in VRCWorldSettings?
dunno, but set the walk speed to 1, measure how far you walk in 1 seconds (or 1 minute and divide by 60), and set that as the value
Hi!
so in Udon script graph does anybody know. for every object interaction the animator integer increases by 1?
TimesInteracted = TimesInteracted+1
Just do that on the interaction event
And then the logic to to pass the int to the animator
You need an interfer variable, and each time the interact event happens add one to it's value
And then provide that int to the value field on the setInterger
Is there a way to play youtube playlists with udon media players?
No you have to play them with each individual youtube url
Hey!
im trying to attach a script to a button's onclick event but im having issues with it.
What is the best way to accomplish this goal?
I have tried RunProgram but that doesnt seem to work.
Add a custom event to the script and then do this:
how i make toggle for on/off certain object
ill try this but ive had some issues subscribing the required function to the event and i thought it was just another udon limitation
but ill look into it
It seems udon/udonsharp dont support delegates nor UnityEvents. how else could i add a custom event to my scripts?
Ok so this works on a singular button for points on a scoreboard, but when i hit another button to add more points it erases the original points and replaces with the new amount of points. So instead of having 37 points before the second button, after the second button is pressed it says 17 instead of 54.
Hey, i downloaded the VRC Billiard from Github, and when i put it in the scene, i get 138 script compile errors, has anyone else had this problem?
Make sure you follow the install instructions on the GitHub and get all the required stuff installed first
ohhhh okayy
i dont read
I just download it expecting to know what to do with it, like everything else thats successful in my life, lol
I don't think you can, directly. In theory, you could store an array of UdonBehaviour references and an array of strings of Custom Event names, then loop through and call custom event on each one. But for non-Udon applications, or to call U# functions with parameters, you'd need to hard-code it afaik.
is there a way that i can make people not able to respawn
Not really no.
You could move the position of the respawn point to the users location so that when they do respawn they don't get anywhere tho?
But they're always gonna be able to click the respawn button
How do ya do this
I've not tried it to be sure, but You could probably just move the vrc world object to the local player in an update event
Or just have a recursive event that does it every few seconds
Would ya know how to set this up or where I can find info on this
I would but I'm on my phone so I honesty don't want to type out a full explanation. 🤣 It would be a pretty simple script.
- Move object to the players position
- Have the event call itself again with the custom event delayed by seconds event
Hopefully a quick question. Is the Udon Start Event run on all clients by default upon entering the world? Or do you need to pull each one from a VRCPlayerAPI array using a For loop?
Yes, when an object is initialized it runs. For every client
- if its GameObject is active. If not, then it'll run on the first active frame
True true. Gotta keep an eye on that for some things.
TY both
can anyone please tell me how to easily create a toggle button in my world that will change the skybox (rotate 3 even?) do i need to use udon to do this or a c# script?
This may be more of a general VRchat question, but it also relates to Udon. Can a pickup that is held by a player still collide with a trigger in the world while being held, and generate an OnTriggerEnter event? (EDIT: It can, just answered my own question. I had something misconfigured).
You can do it in udon or udon sharp.
can you point me in the direction of a way to learn how to do this?
https://youtu.be/yC9h-51jvBg
Google does wonders 😝
Here's a tutorial on how to make a cool little button that switches the skybox of your scene when clicked. It cycles through a list of skyboxes each time, and I've included how to do this both locally and globally.
This works really well as a day - night toggle, or combine it with some effects to create something truly awesome!
Hope this help...
How would I go about making a shield that starts off small then grows into a larger one when you toggle it
I'd also like it to shrink when you toggle it again
Ideally it's something you would run around with in its small form then trigger it to grow into a large one
You could just make an animation for that that either scales it bigger / smaller, or have a blendshape to change the size / shape and make the animation blend between the two.
hey does anyone know why turning the fog on in cyantriggers doesn't work? i can turn on and off the gravity and most other things, but SetFog only works in CyanEmu, not once in vr, not even in a very basic scene. hopefully it's just something extra i have to do with my trigger i haven't thought of yet, and not something deeper that the sdk is preventing.
hmm, in a simple test it looks like if i start with fog on, and have it turned off once we enter the world, then i can turn it back on. i knew some udon stuff had to be on at runtime but didn't realize this was one of them.
My animation is needing to send a custom event.
I have my custom event specified in animations but my Udon behaviour doesn't appear to be receiving the event.
This explains everything
do you use SendCustomEvent? you cannot call the methods directly
it does not matter whether the udon behaviour is enabled, so that's not the issue here
Yeah, I have start up firing the event.
Then each of my animations sends the event again that this behaviour catches now.
Seems to work now that I have the script I was using enabled
what does the animation event look like?
And also my amazing udon graph wow
Augh, UdonSharp support for Interfaces when. grumble-grumble
alright thank you
Does anyone know how to sync a single counter to multiple buttons?
hello guys
I seem to be getting
200+ errors upon
literally having udon in the unity project
does anybody know why that could be the case
I seem to have the latest files so
can't see why such thing would occur
some other assets might be calling for udon sharp not the regular udon check if thats the case
I also have UdonSharp master
I wouldnt use master, I think all of that is uncompiled
Use the latest release
I was just looking for a way to add a button to execute a sound that's all
could there be any recommendations towards this type of thing
You can use udon by itself for that
basically
oh that fixed it
lmao
thank you
I have another question if you don't mind
when I play a sound, is there a way to let others also hear that sound
Use SendCustomNetworkEvent
got it, thanks !
Hey i try to make a world camera. What material should i use for the render texture? Right now it dont look hq
how do I make an object move towards the player with udon graph
I like to use unlit/texture, as monitors and tvs irl, absorb a who lot of ambient light
probably need to increase the resolution of the texture
@high mural i did that also :/. could it be because i use stage lightning?
i have those strange artifacts
second is without world cam
yeah a camera render texture is never going to have the same fidelity as your actual view. could be something with shaders,, not sure. but that's probably about as good as you're going to get it to look, imo
my guess would be something to do with shaders then, but idk for sure
how can i turn up my voice? i cant hear the others and they cant hear me well in my world
Looks like one is anti-aliased and the other is not. Pretty sure in this version of Unity, that's performed as a postprocess effect.
Not sure what you'd need to do to get it to work with the RT camera though.
Hmmm okey
You might try importing the PostProcess package from the Unity Package manager standard assets and apply a postprocess volume with an anti-alias effect.
Hey there, so I just created a FNaF style door toggle and uploaded it to vrchat, however, there seems to be an issue that when I toggle it closed, it doesn't show that for other players meaning they can just walk straight through it as they see it open. I'm assuming it's something I forgot to tick on a box somewhere but if anyone knows how to help, it would be much obliged
It's not as simple as a box. You need to atnc the door state to other users
There are plenty of good videos on YouTube explaining exactly how to do that
Ah thank u!
hi! i put too many things on my unity scene and i think something is lagging out the loading is there a way to pause udon so i can laod only the geometry?
Hello there! So about the syncing toggle, could someone explain how to do it to an animation? I tried looking up a video on how to do so but I only get syncing object toggles and not animations. Any help would mean so much to me!
Hey my friend has a question and I am also having a question about what my friend's friend is experiencing but he's wanting to know what it means and I don't think he knows if it's a problem or not but I'll get to the point what does unverified player mean?
You need to pass that synced variable into the animator for the door
Instead of toggling the door shown / hidden
This should hopefully help:
https://youtu.be/hCK3oAH7WJg
Here's a tutorial covering the example script 'Set All Players Max Audio Distance', that allows us to change how far we can hear a player's audio. Using this, we can also make it travel less, as well as mute them.
This script seems to have gone through some changes over time though, so do be aware that I change a few things about it in the tut...
is there a way that I can set ramp steepness for players to still be able to climb? What's the angle across which collisions are interpreted as hitting a wall vs. hitting a ramp?
Would anyone be able to help me write a U# script to cycle through game objects using two UI buttons?
I have an idea of how the logic could work but no experience in coding
My idea is that it's controlled by an integer. Said integer increases by one with the press of a button, or decreases by one with the press of another button. Depending on the current integer value, a specific game object is displayed. I am willing to pay somebody to write this kind of script out.
Does it have to be udon#? You can have both udon# and udon graph codes running in the same scene, as they both get translated into udon assembler when uploaded to vrchat.
If udon graph is okay, there is actually an example script that sounds like it does everything you want. It does also have a ui text object on it, that displays the name of the gameobject that is being shown, but if you delete everything i've shown in red, it will get rid of that feature.
I'm not entirely sure how to set that up but I'll give it a go
Thank you
Doesn't seem to work but I probably did it wrong
I don't believe you can change the angle to which players can climb. I think it might even be 89 degrees. Here's a simple model for you do test with
How exactly does it not work? might be something simple
mind showing the modified graph?
I didn't change anything aside from removing the one variable you said to delete
also it's just the nodes, not the lines going though it
Still seemingly nothing happening
graph pics please
btw, if you don't already know, windows key + shift + s allows you to screenshot only part of screen
That's what I'm using lol
^^
I still have friends that pin snipping tool to their taskbar and I just ask why every time
I feel like the program does most likely work though
yea, it do be like that...
mind hitting compile and reload button on the top right of the udongraph window? you block node is a little messed up
I just set up the button wrong I'm assuming
This is my first time working with UI canvases
I compiled, what do you mean by block node?
you've got a missing arrow in you block node. a reload/ recompile should be all it needs
Oh I see
There actually appears to be two arrows that aren't connected
One just disappeared when I dragged out and let go
Looks like this now
the bottom one doesn't matter. its having a gap that's the problem
Gotcha
yup, that's how it should be
Should I run a test now?
Still not functioning properly...
The buttons are definitely registering inputs as the color change occurs when clicked
so, this code works by having the only the starting object active on launch. Then whenever it's clicked, it disables the old object, and enables the new one.
that being said, are you just after changing the colour of an object?
Yep, that's how my scene is set up
No
I'm making a VR Pokedex and cycling through various Pokemon using navigation buttons
The buttons have color changing set up in their components by default
hmm...
Okay, so I've just set it up on my end, and I didn't run into any issues. Just to be sure, here's the modified code that I used:
Alright, thank you so much
np ^^
Anyone had their project not generate a visual studio solution for some reason? normally i just open that to edit all my udon# but it isnt generating for some reason
Hmm, I always generate them manually anyway.
I know there is this: https://docs.unity3d.com/Manual/VisualStudioprojectgenerationWindows.html
But I've never done that before, maybe that's what you are looking for.
Typically, in Unity, it only does so once there are C# scripts. Create a script and double-click it in the Project window and it should generate everything on demand then.
thanks you
Anyone seen this before? Not really sure where to start with it because there's no context provided at all...
all my video players keep breaking and this is a constant error for them, plez help
Are you trying to use the unity Play mode?
Is it possible to prevent other players from picking up a pickup once its been picked up?
this perhaps?
alright so can someone help me figure out how to get a particle collision from a player so i can code with it? i know there is the event on player particle collision but i cant seem to do anything with that on its own even if the particle is sending collision messages
more specificly i can get a particle if its from the same game object but i want to get a particle emitted by a players avatar
or send information to the player itself to teleport it
What are you doing that specifically requires particles? As opposed to just normal object collision detection. Just curious what your trying to do.
i am making a game where i need the player particles form an avatar to do damage to an object
i know i can make an object that does this like a gun or something but i want to use the avatars similar to the doom map for pc
Sorry left out the part where I mean after said person lets go. Like basically only that person can pick the item up after that point until they disconnect. I've changed methods now tho
Here's a script for a button to do this with udon graph: https://youtu.be/szetLivbmdc
It will work fine with your player, as it calls the video player component directly, and shouldn't interact with the udon# coding at all. You can also have both udon graph and udon# codes in your scene at the same time, as they both translate to udon assembler anyways
Here's a tutorial covering how to change the url on a vrchat videoplayer with just a button. This is super handy if you want to have a quick instructional video, creating a karaoke world with a bunch of song videos for people to select, or even just a selection of some different background music without having a massive world size
So hopefully ...
no worries. It's a little confusing, but the only thing that makes it an udon# video player, is all the inputs and ui for the video player, not the video player itself ^^
Hi!
Apparently I'm too stupid to set player tags. I've tried to do these things:
public Text tx
string t, tv = "hi";
public override void OnPlayerJoined(VRCPlayerApi player){
//player.SetPlayerTag(tv);
//player.SetPlayerTag(t, tv);
//player.SetPlayerTag("hello");
//tx.text = player.GetPlayerTag(t);
}
But I can't seem to get it to work. What I want, is to assign every player with some tag, and when they enter a teleport trigger, they will be teleported according to what tag they have.
If someone can help me to get to the point, where I can get the player's tag in the Text output field, I'd be grateful 😅
Wait, people actually use player tags? 
I just found out about that apparent use today, so I have no idea what ppl normally do 😂
Player Tags are actually pretty nice, but they are a bit of a black box and nobody knows if they really are supported or not lol
They are not really mentioned often...
Well accoding to this, which was updated 6 months ago, it should work, except
GetPlayersWithTag() 🤔
can someone explain what "Auto Fix" button in this case exactly do?
Wasn't there an issue which could clear the all of the tags of a user when trying to remove a specific one or something?
It should check the "automatic resync" box on the video player component. Should.
Not sure if there is a reason to keep it unchecked.
but there's no "Automatic resync" checkbox or i'm blind
not sure why you don't have it, I can see, that if I use the component, I have that tick
It was added in some SDK version. Maybe something went wrong while you updated or something like that? Not really sure either
i'm using the latest SDK3 version on clean unity project
weird
does udon allow unity buttons for resetting objects to a set location still?
i made this for 2.0 that allows you to move a light back to a given location
You need to use the Udon Interact(), and override that
Something like:
public override void Interact() {
SendCustomNetworkEvent(VRC.Udon.Common.Interfaces.NetworkEventTarget.All, "MyFunction");
}
public void MyFunction(){}
What does udon stand for
?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...
Unity Doesn't Offer Nanites :(
ty i got it to work in cyan triggers since the buttons just dont work like b4
heya
question for anyone who might know
is it possible to make a 2D array of game objects in the udon graph?
was looking for anything that may work like that... even the option of a sort of array within array system but i cannot seem to find a function that would let me do that
basically was trying to set up a grid system for a game and a 2D array would be much preferred to alternative methods >_>
2D arrays are not supported, but jagged arrays are.
Which are basically more loose, but less optimized 2D arrays.
instead of
int[,] myArray
you do
int[][] myArray.
here, every entry of the "top layer" array holds an array of unfixed size, meaning that entry 0 can carry an array of size 6, while entry 1 carries an array of size 2 or whatever you need.
yeah that was basically one of the options i was looking for :3
while its good to know that it IS supported im still not certain where to find a node for a any[][] in the Udon graph
the available options seem to only contain single [] options
you wouldn't happen to know what i might need to search for to find a GameObject[][]?
if not i will just keep looking :3
Oh I might have to disappoint you, My brain was still in Udon Sharp mode.
I don't think there's any 2D arrays in regular udon yet.
but you can always use a 1d array as a 2d array.
no worries :3
a fine fella in another server suggested using an object[] to store GameObject[]s
in hindsight its kind of obvious i just kind of forgot that you could put anything in an Object field
thanks for the help anyway! :3
That definitely looks like an easy solution! Otherwise, for fancy maths coding magic, you can map the grid onto a single dimension:
e.g. if you want a 8x8 grid, make an array of length 64 (so 8 times 8).
Let's say you have a Width(sizeX)5 and a Depth(sizeY)4:
Make an array of length 20 (aka 4*5 or sizeX*sizeY)
To access the fake 2d array's index (indexX=3, indexY=2), simply go to the "real" array's index of
indexX * sizeY + indexY
funny enough you are kind of describing what i had though up as a sort of workaround solution x3
would be what i had gone with if i had not found a better solution
think the jagged array option will be easier on my brain to work with
especially given that i am self taught and there are precious few guides for this stuff
I'm having a problem where interacting with buttons used to turn on objects are turning off the buttons. This is usually because the program is referencing itself but it doesn't appear to be
I'm sure there has to be a better way to do this but it should work.
Extremely simple script, trying to make a script where I set a target object, and then the object with the script, follows the target at all times, plus an offset.
Currently, this script does nothing, the Sphere does not change its position no matter what target I choose. What am I doing wrong?
terribly sorry, simply just forgot to put on an update event that activates set position. (I am very much a noob at this)
If you havent actually passed in a object to your NewsOverlay 1234 slots they will reference the object the script is on instead. (I believe?)
so check on the actual button that you've passed those values in
Isn't that what the second image is? All of the right objects have been referenced in the public variables
Oh sorry i missed that XD
Everything looks right here. it is probably something to do with the hierarchy (perhaps you deactivating a parent object or something).
That being said, this would be the 'better' way of doing it. it's notably more complicated to script though, but it gives more flexibility. You would have a script on the button itself, that tells the slide manager object, what slide to change it to.
Nothing is parented to them and some of the buttons seem to to not disappaear even though the only difference is which boxes are ticked but thanks for making a better version, I'll give it a shot! I tried using a material swap prefab but it wasn't working out.
doing it by swapping out the material will be more optimal, and actually a lot easier to code and manage. Here's an update to the slide manager script that would instead just swap materials. This script will change the 1st material slot on the slider manager's meshRenderer
🙏
Question... in Udon (using UdonSharp) how would one measure how many players are in the bounds of a trigger? I want to enable or disable an object when ALL players, not just the local one, are outside of a trigger. The idea is to change a thing behind the scenes when no one is there to witness it.
And ONLY when no one is there to witness it.
Specifically I have a system of small things changing randomly when the map loads, with a list of objects to be enabled via a random chance (and all its siblings disabled)
So I want to make it so this can run again, not on a timer, but when no one's in a specific area. (Teleported away to another part of the world)
I'm sure something like that would be possible, I assume by storing the number of people that have entered the instance and then incrementing another variable when a player leaves the trigger zone, if those numbers are equal, then everyone has left the trigger zone. Of course, you'd also need to reduce that number if anyone went back into the trigger zone. I guess what I'm not sure about is how is checking that everyone is outside of a trigger functionally any different than checking if anyone is in the trigger? Because that seems like it would be easier to work with.