#udon-general
59 messages · Page 20 of 1
And it's happening to every, single, pickup item. No matter where it's located
Sometimes works, sometimes doesn't
You can pick it up, let it fall on the ground, and suddenly, can't pick it up
Doesn't necessarily happen on the ground. And the ground is the same as before. Seems to only have happened after the new updates
Seems to be ok now that I deleted and re-added the script and UdonBehavior
Strange
is there any way I can get contactpoints on enter trigger? or does no collision form?
latter. Thats not how triggers work
hmm. Any way to find the point at which you enter a trigger?
Not really afaik
It's a makeshift solution. Ended up using ClosestPoint but it was based on the receiver's closestpoint to the item
Is there a way I can get the camera instance that the player uses? I want to make a slider for the 'Near' setting of the camera's clipping plane so small avatars don't get cut in half, and I can change the world's reference camera, but in game, nothing happens when I make changes to the reference camera after the player spawned, so I need to actually get their Unity camera instance...
From what I'm seeing, there's no way to get a reference to the actual player's camera - that's unfortunate, it means I can't do what I wanted to
@arctic trail You reference a camera on the scene descriptor with the settings you want to use. There you can adjust the far and near clipping planes
Quick question
Does "Get Player Rotation" get the player's body rotation or head rotation? Or to be more accurate, doe it get the player model rotation or player camera rotation?
Just wanting to know as VR could break my udon code if its via model rotation
Or put it this way
Would there be a way to get camera.main so I can create a doom style sprite system in Udon
Player rotation is the root rotation of the player.
And we can’t get the players camera, but you can get the player head position, TrackingData, or you could use ui in screen space
I'll look into those then, trying to avoid shaders because I don't want to have Z rotation on the sprites which kinda ruins them
If none of them work, I might go to a fallback method of rotating the sprites towards the player instead of matching the player's rotation
If you're trying to slap a UI over the player's viewpoint, you'll want to get their head bone and work from there.
Its more like, making the sprites 3D but doom style, so they are 2D but they rotate to stay visible to the player
I could use particles but that would cause some issues so I'm just trying it in udon since normal unity worlds don't accept scripts either
I don't have Unity open to check right this second, but see if LookAt is exposed in the Udon nodes and set it to the Player's position.
I do plan to expand this, so when the basic rotation is done, I plan to also create the 8 angle system too, though its a little too early for me to go that far, I kinda just started with udon
Pretty sure a LookAt constraint is where you want to start.
ok I'm having the same problem I didn't want with the LookAt constraint, it works but its also rotating on the Z axis which is what I'm trying to avoid
however, would bone rotation work?
actually wait
huh, my code is actually set to just look at the player's position, only by the Y axis
@flint urchin I found out about that and can do that already - it even works in Unity, but in-game, nothing happens when I move the slider, leading me to believe that the actual player camera only copies the reference camera's settings when you join, rather than continously
If you want to interact with canvas in game, you need to add UI Shape to the top canvas
Only way you can interact with the UI
I have added this already - there is no problem with the slider itself, it works both in Unity and in-game; the actual settings however appear to only apply to the reference camera, which, I believe, only is used once at the time you join to set the clipping plane, rather than on update
@hoary ocean oncollisionenter you get a collider other that "other" should have all data about the collision
How fast it was and where it was

Yeah, they only copy it on load.
So I cannot modify the value throughout gameplay in any way
Nope, but it's done, to my guess, to not make VR users sick
It's a protected object that they don't want you to change or access in any way
That too
But having a middle man script to change the values can be done on their end if they wanted it
Is there a legitimate use of having the 'Near' setting of the clipping plane be anything other than the smallest possible value? A larger value doesn't really give you any benefit, and many users of very small avatars experience phantom pain when being cut in half by it.
How would I go about creating such a script?
We can't. VRChat needs to do it
I can, but I can't apply this to all worlds ever
Yes you can?
Including worlds I don't own? I'm trying to find a solution that will allow my friends to play on worlds that have a 'Near' setting >0.01 without experiencing pain
With udon you can also just do it to your own world's ever
No, we can't do it for worlds we don't own. So got to contact the one that made it
I can't really do this for every world. I don't want to veer too far off topic here - thank you for your time
If anything, comment and vote here; https://feedback.vrchat.com/feature-requests/p/allow-the-camera-near-clip-plane-to-be-configured-by-the-player

Done - thanks!
Anybody encountering issues with pickups randomly not being able to be picked up?
Does anyone know how I can make global events occur on onPickup ?
If I make onPickup fire a custom event, will that make it happen for everyone?
SendCustomNetworkEvent. However be aware that that wont work for late joiners then
Networking is hard.
Anyone got an udon tutorial on how to add video players to a world
You currently cant.
Wait video players are not supported for Udon yet?
nope
They're working on it
Thank you for the info, ppreciate it
Is there a way to get the avatar descriptors view position?
Nope. But there is a canny for that
Man, looks like I'll have to stick with an eyebone position workaround then
Would be helpful if you showed the lines :P
the lines?
Line numbers
Show your AddStep() method
I tested the AddStep() on its own and it worked perfectly with the debugger
Also I would avoid calling it "GameManager" that might be internally used
alright I'll change that and see if it works
But I dont get that error message then
no luck
one of the noodlebowl's scripts is also getting that error as well out of nowhere
I actually used OnTriggerEnter yesterday, and I'm not getting that error
I updated my SDK and U# right before starting this project
However, I'm not using the collider other parameter either
weird thing is the noodlebowl script wasn't giving that error until I made my script with the Trigger
did that already
it worked once
then gave that error right after
switching the parameter to this lets me play the scene
but it ignores it either way
I'll reimport the whole project and hope that works
Show the using directives
I'm figuring it may be that
re-importing U# let me play the scene once, I removed "UnityEngine." then it gave me the error again
Nothing abnormal there, hmm
Do you have imported anything weird? xD
Because its apperantly confusing Collider with Collider
which is...weird
I don't think I have, I may've messed up the project though somehow because I had a really old version of U# before
There's got to be another type >somewhere< it's confusing it with
I deleted the U# folder then imported the new one
Extensions, scripts?
¯_(ツ)_/¯
I'll make a new project
project was fine all the way till I made my own trigger script somehow
When it doubt, import it one at a time until it breaks again xD
Then you know what caused it
yeah lmao
@fiery yoke Do you think I could re-send the CustomNetworkEvent on the player join event and use that as a rudimentary way to synchronize it?
Sort of. You have to broadcast it, meaning that all players receive the event. For a lot of objects that would be a huge amount of stuff to sent in one frame for every player.
new project worked perfectly, rip older project :c
Yeah you probably got something confused there
You have to broadcast it. For a lot of objects…
@fiery yoke
Just for reference, what is “a lot of objects” in your opinion? 10? 50?
more in the 50+ range
What is udon?
@here anyone know why my synchronize position checkbox is getting unchecked automatically when i build & test? owo
There is someone with the same problem in another Discord. I have heard about it happening before, but I dont remember what the problem was
damn :/
OHH
it keeps unchecking the box so it doesnt sync up when i test it
I do
and idk why
I do remember
O:
they dont dirty the scene
when changing them change something else in the scene
like renaming an object or moving it
then ctrl+z
and save
Could anyone put clothes on my avi please
@carmine patio wrong channel #avatars-2-general
Thanks
what do you mean when you said they dont dirty the scene
You know that star after the SceneName? That means that its dirty and that you have unsaved changes. Dirty just means that there is something that is different from your last save
When I plug in my headphones I can't hear people
can you open up the udon graph with a udon sharp script
What the.... Unity just wiped out all my Udon connections
anyone know how to adjust the voice distance now with udon?
i know you used to be able to do it in the playermods thing but idk how to do it with udon
¯_(ツ)_/¯
cause i can barely hear my friend talking in my world and hes standing like 5 feet away from me
Hello? I am developing a gamemode for my first attempt at a vrchat world. I am struggling to figure out how to sync animations across clients. Where can I find information on how to do so?
Its officially not implemented yet.
You can try to work around it, but I dont recommend to do so.
So how would I go about syncing transforms? I am trying to get a openable door visible to all players, and rn i have it done with animations
@scarlet lake check out the examples that come with Udon in the VRChat Examples folder, and the Readme. There's an example showing how to sync a Transform, as well as many other helpful tidbits!
Thank you! I will do that
There is a way to use GetBoneTransform in udon for player instance ?
i was told you can connect an oculus quest to pc so you wouldnt have to limit performance or something like that and to see all the avatars and im just wondeering how you do that? also i have sidequest if i need to use that for anything
There is a way to use GetBoneTransform in udon for player instance ?
You can get the position, is that good enough?
and rotation*
Yes, and rotation as well
Just not scale. Which would be pretty useless anyway.
i was told you can connect an oculus quest to pc so you wouldnt have to limit performance or something like that and to see all the avatars and im just wondeering how you do that? also i have sidequest if i need to use that for anything
@timber knoll #user-support-old
is there a way to modify the player's rotation using udon scripting?
VRCPlayerAPI.TeleportTo()
can someone please help me with controller input?
i'm trying to add custom bindings to my map, using this chart
VR controller summary
This page is a combination of the other pages. These
inputs are verified to work on every known controller, and
in cases where they don't an alternative is provided.,Use this world to test:
https://vrchat.com/home/world/wrld_f8d5f7e4-185c-4b82-8ecb-8a...
but no matter what i do, it always returns a false value
Are you using Udon to do it? If not, you're looking for #user-support-old
yes
How are you adding it to your map?
I thought this would be client specific rather than map specific
So you're trying to figure out which controller inputs are pressed? Is that it?
yeah
this is the current graph im using
just for testing
i tried both the "get button" and "get button down" nodes
I haven't done this personally, but the first thing you'd want to ask is, does vrchat natively support controller input?
well im not using a 3rd party controller
im trying to get the input from my vr controller for a custom binding
If not, they may be using an emulator driver to convert the inputs
If that's being done, the game isn't seeing controller input
hmm
In which case your game will never know what button is being pressrd, only seeing the emulated button press
kk
https://docs.unity3d.com/Manual/class-InputManager.html
Unity let's you access the axis like this
Why not use input.getaxis
As far as whether it's actually exposed in Udon though
Can i clone some one witha particle and music avater
As far as regular buttons, I think you just use getkey("x") for example
So, getaxis and getkey
yea
I have 2 questions.
In Udon, can I retrieve current time and date?
Do I use VRC.SDKBase.VRCPlayerApi.TrackingData to get a vector3 of each player in my world?
If that doesn't work, likely the controller is being emulated
Very nice that get axis works for wasd out of the box, so no need to do separate controls for desktop
You fool
Yes
not getbutton
Getaxis
I have 2 questions.
In Udon, can I retrieve current time and date?
Do I use VRC.SDKBase.VRCPlayerApi.TrackingData to get a vector3 of each player in my world?
@scarlet lake
Time.time
And you can probably check the API to find one for date
Actually is get axis normalized on all controllers? 🤔
Yes
yess it works
i just swapped out the getbutton method for this
this gets the axis value
and if it's over .5
then it counts the button as pressed
i need the value as a bool for the grip buttons
Oh its the grip, all right
this is a little demo scene i made
grip corresponds to "open hand" on wmr controller
Have fun with index support
lmao
index users can just squeeze their controllers to trigger it lmao
instead of using a grip button
is there a way to have a button that resets game objects in the world with udon?
like if i have a pile of cards and i want them to go back to where they originally were
i know how to do it with regular triggers but not with udon
@here
sure @cunning sigil - on Start, save the current position and rotation of the object, and then make a custom event that does Transform.SetPositionAndRotation back to those parameters.
I just got vr chat and I can't hear other people
@cunning sigil if those objects use rigidbodies/physics be sure to also reset velocity and angular velocity. Also if those objects are synced then you have to take extra precautions.
i made em kinematic so they float so i think ill be good
This is partly a broader object-building question, but if you put a pickup on another pickup object is it likely to physics out? I'm just wondering if it's possible to get away with, say, holding a tool and putting something with a fixed root position that turns like a joystick or dial on it.
What node do I use to update a variable every 30 seconds.
@scarlet lake there's an example of a timer in the VRChat Examples that come with the SDK. Take a look at the included Readme for details.
any ideas why a sphere that is being thrown is getting warped like crazy lol
You most likely have the objects parent as something with weird scaling
I am looking for a way to properly make a 2handed weapon. I have all the ability to detect if another hand is being held, but rotating the object seems to be challenging. I heard something about joints.. if anyone has any info, please @hoary ocean , thanks!
Can be done without joints. Just some maths. However remember that you dont have haptic feedback making it hard to really simulate 2 hand weapons
Stick your controllers together with a hair elastic
I have a question
Thanks for letting us know
Heya – in a larger graph i just had this error message popping up when connecting a new node – anyone experiences that one yet?
Is there a way for a receiving Udon graph to get the sending udon graph/object? Something like how the OnCollision Event has a node for the object that collided with the graph's collider.
What I'm specifically wanting to do is see if it's possible for a graph to send another graph a custom trigger, and have the recipient graph use Udon Graph Get Program Variable to pull a value to run against its custom trigger event.
@torpid lily You're in the wrong thread, this is for udon development.
Heya – in a larger graph i just had this error message popping up when connecting a new node – anyone experiences that one yet?
^ I just updated to the latest SDK3 version, error still persists though
Define "Larger graph". How large is large?
I'd say maybe 80 nodes or so
Try making a copy of it and hack out a bunch of nodes. See if that compiles properly.
I already tracked it down to the connection between these two branches
When i remove that connection, the graph compiles
Two branch nodes in isolation isn't gonna tell us squat.
What I'm specifically wanting to do is see if it's possible for a graph to send another graph a custom trigger, and have the recipient graph use Udon Graph Get Program Variable to pull a value to run against its custom trigger event.
@hushed gazelle Just have variable of type UdonBehaviour and set it, before sending any events. Unless youre talking about networked events
@hushed gazelle is there a good way to screenshot the entire graph?
@fiery yoke Not quite what I'm looking for. I want to see if one recipient script can deal with many senders and know who sent something to it.
@sinful slate just use the snipping tool to give us a bigger piece of it to look at the surrounding nodes.
@hushed gazelle Since Udon is running on the mainthread it shouldnt be a problem
@flint urchin ah, thanks
Okay, that explains the cause… I wonder how to fix it in my graph though… sadly there's no switch-statement
@fiery yoke I'm not quite sure what you mean here, as I can send a custom event just fine, but I want a single receiving script to know which sending object/graph sent the custom event so it can pull a value from that specific sender.
@flint urchin Hah, that actually lead me to find a node which was incorrectly following another chain, which lead to causing this error – fixing that solved the error for me, yay 🙂
@sinful slate how about you append the string "cardDraw" with your int and call the customevent on it ;)
tho that would make it somewhat less secure since you can maybe fuck with the string but if you're doing that, you can just call SendCustomEvent yourself anyway
😎
Any idea where do I find demi human avatar?
Ask in #avatars-2-general @dreamy sonnet
@sinful slate how about you append the string "cardDraw" with your int and call the customevent on it ;)
@tropic canyon After adding more nodes to the logic, I actually ran into the problem again, and now did exactly that 😄
Possible for Udon to get access to a material's shaders properties and variables, like in the animator?
Well well well, look at that. Material and functions like SetFloat are supported. Looks like it's possible. Impressive
@digital orbit Just be aware that you cant Get any of the properties if you havent set them yourself. If you modify a property in the shader itself the CPU will have no idea of that agaik
Is there any way to get an object's Tag in udon / U#? Apparently, it's one of the many things that aren't exposed to Udon;
I could attach a component to the object to identify it via Type, but GetComponent is expensive~
tags aren't supported in any way
one way could be to see if the gameobject name starts with an identifier
Hmm I wonder why things like that aren't exposed~ Just as I wonder why you can't use an array indexer for Vectors
Thanks for the answer 🙂
@coral perch a lot of things have just been forgotten to be exposed or havent yet been fully implemented. Some ofcourse are not implemented for security reasons.
I see; I do hope a future update will bring a few more functions to the table 🙂 coming from C#, using U# (/Udon) feels a bit weird compared to my usual programming approach~
Thanks for the answer btw 🙂
Wrong channel, try #avatars-2-general
Ok, sorry
Jw, does anyone know it the combat system could bork the camera for quest users if you make it quest compatible?
found the issues, had to reupload the sdk to get working materials
I'm making a world and I've never had this issue before but when I test it I spawn very far under the map and sort of "spin". I've made 3 worlds and have never had this issue before so I really need help. I am making it on udon so idk if the spawning is different from the old way of making worlds with triggers but vrc world is placed above and their is a floor collider.
So.. obvious question. Have a UDON synced Variable (int), it seems the Instance "starts" before the network has synced (settled). So the value is Zero is my newly joined player instance. Even though for everyone else it is "synced". Anyone got an example of how to get a variable on player join and after the network / variable has synced.
Was it a late joiner?
If so, as far as I know, synced vars and network events are unbuffered (late joiners will not see the change)
Ahhh .. interesting.. So this would be someone joining the world after a variable has been initialised and changed by another player.
ok.. so there is no easy way to query this variable.
ok.. thanks, saves me banging my head..... ( I can get it to sync on change, so the player picks it up when I touch it) but I want to get the current status. grrrrr.
There's an OnPlayerJoined event
There's also a Start() event for whoever joins
You could probably make use of those to tell the new player to sync up
Yeah I tried these, and these events run before the network is "synced" as in my log. The highligted last line is the event I probably need to hook into ..
OnDeserialization is used when the client gets new network data
Whatever new vars, etc got sent via the network, will be updated when this runs
Custom network events are not synced to OnDeserialization
Which means that if you need a sync update from a custom network event, you need to wait for it in OnDeserialization, otherwise you'll run the risk of it sometimes being there and sometimes not (race condition)
Ooooh perfect..
thats what I needed... OnDeserialisation...
genius !! thanks man
This method runs a lot, so... Make sure you're using a bool so you only run your network check when needed and no more
What I do if I need a sync variable is, I send a custom network event to a method which sets a check bool, then once OnDeserialization sees my check bool is true, THEN I run the local event to do whatever, with a guarantee that I received my data already
anyone know how to have a udon project with a lot of assets in the project build faster? I remember someone saying something about setting something to ignore prefabs?
You mean Udon compilation?
can we get midi velocity information in vrc?
is it even possible to change the fog mode on the Render Settings in VRC or no?because as i was testing it with a UI dropdown to change it, it would work in unity but when i went to test it in VRC's Local testing it wouldnt change the fog mode but rather "Turn it off", and it would only turn back to the Mode it started with but not any of the others
switch (fogModei)
{
case 0:
RenderSettings.fogMode = FogMode.Linear;
break;
case 1:
default:
RenderSettings.fogMode = FogMode.Exponential;
break;
case 2:
RenderSettings.fogMode = FogMode.ExponentialSquared;
break;
}```
@ripe frost Midi velocity?
Do you have your fog shader included?
Fog shaders aren't included when you change it in runtime
Unity doesn't know if you change it in runtime or not
You need to tell it to include it
im not using a fog shader
Go to your project settings
And switch the fog from automatic to custom, then select the fog mode shaders you'll use
Automatic means it won't include your shaders in the build
Select the ones you'll use
ok i have it set, ill go test it ty
Just a warning
Turning that on will dramatically increase the build time and shader variants
And size of your build
ah ty for the warning
I made a custom cs preprocessor to exclude unneeded fog shaders at build time
Saves space and build time
Pm me if you want it
@fiery yoke midi velocity refers to midi instruments or controllers such as a musical keyboard connected via midi. Velocity is basically a way to tell how hard or soft you strike the keyboard. Might have to read the documentation on that though
Midi is currently not implemented at all afaik
Are you sure they are using SDK3
i was wondering if it was implemented into SDK3 but i seem not to see any information about it
As far as Im aware its something that is definitely planned, but not exactly highest priority
hopefully, would be really cool to see more music/performance worlds
Indeed
how do i import animations to a model
Wrong channel, ask in #animation
What is udon
chicken
@chrome solar #udon-info
It's VRChat's new graph/scripting language. Gives more possibilities than SDK2's trigger system
Oh ok
Is there a way to do coroutines? With IEnumerator not really being supported, I'm not sure if it's actually possible
No, It’s not possible
Mm, I thought so
Is there an easier way to assign public variables to canvas objects? I have the following in my Udon Behaviour, and it may need to scale into the hundreds of elements.
TLDR: No, not if you want them ordered properly (unless Unity changed something from 2014)
Ah okay, I'll just set it manually then.
I also have another question. This one deals with data compression. Suppose I have four integer variables with the following values and max possible digits listed respectively.
int integerA = 15; // 2 Digits.
int integerB = 2; // 2 Digits.
int integerC = 8; // 2 Digits.
int integerD = 623; // 3 Digits.
These four integers will need to be combined into one integer value. An overload won't occur, as the maximum number of digits will equal 2 + 2 + 2 + 3 = 9, below the max integer value of 2147483647 (10 digits). After being combined into one integer value, they will be stored into a variable called syncIntegerRegistry defined below.
[UdonSynced(UdonSyncMode.None)] public int syncIntegerRegistry;
Later, syncIntegerRegistry will be called by another player, and will need to extract those four integer values from itself. What would be a computationally efficient method to approach this?
can anyone fix this pleasee-
@chilly aspen bit shifting
probably not
someone already ported a gameboy emulator a few months ago
so we doing c# -> udon -> gameboy?
I want to see that
does the udon sdk update automatically or do i need to install the newest update?
It does not update
You need to update it by yourself
Recommended method:
Close Unity.
Open Unity and make a NEW project
Import SDK into new project
Delete all SDK folders in old project
Move new SDK folder into old project
Finall, re-open old project
Has there been any news about UDON getting a video player?
is there any work around for swapping Skyboxes in runtime?
Workaround?
as udon does not support Skyboxes yet,i was hoping there might be a similar work around like Post processing profiles on separate objects and toggling them on and off to for some basic control, is there or do i have to wait for it to be supported?
You can switch skybox in Udon
No need for a workaround
Use RenderSettings.skybox
Works like you would expect. Find another skybox Material to use, switch it, whatever
public Material skybox1;
RenderSettings.skybox = skybox1;
oh i was using Skybox blankskybox instead of Material blankSkybox
thank you i was just minorly confused when i got an Error saying "Skyboxes are not supported in Udon", im using U# btw
I see haha. No worries, you can do it. I'm using it right now
Now, what ISN'T supported is new Material()
I got around that by making it public and dropping in a blank material file instead
ah ill keep that in mind
anyone got a tutorial on how to make global options? like lets say toggle an object on/off but for everyone?
Can an Udon script react to its own event?
Ofcourse? Wdym
Can anyone give me a place to start looking into how to make repeaters for lights to turn on and off repeatedly?
@fiery yoke
I mean, if I trigger a CustomNetworkEvent called "test" in one part of the script, and have an event reactor somewhere else in the same script tuned to "test", will it trigger?
"Event reactor"? "Tuned"? Your terminology is...weird. but I guess the answer is yes
Yeah, I accept that the terminology I use is kinda weird, I guess
I don't really know what else to call them
Hmm yeah I dont really know either. You would probably call them listeners.
Basic question but how do I make an object I can pick up and carry around? Is there a script for it? Component? Combination of the two?
Oh rad, thank you!
Currently trying to test a world and my windzone doesn't make it through the build process (aka works in unity, doesn't in vrc)
and i wanted to know if windzones are not supported with sdk3 or if there is a known issue in with the sdk?
(trying to rule out possible causes)
@thorn pilot - WindZones are whitelisted, they should make it through
that is what i was thinking aswell, but for some reason it doesn't, welp back to digging
Is there a way to tell when an avatar's particles exist and their location for use in Udon? I know awhile back there was a DOOM world that you could use particles on certain layers to damage enemies but I'm not sure if something similar could be done with Udon
also thanks for the quick awnser
I'm having a small amount of trouble understanding what exactly the problem is here. It's a NullReferenceException, but I don't exactly know what is null. The quaternion?
Similar one here... I'm confused as to what the problem is. Maybe the VRCPlayerAPI is sometimes null when fed into it?
Looks like the player from which you are trying to access the bone is null. From my experience, it can happen when a player leaves.
Hmm, this would make sense, but this code is meant to be triggered immediately on onPickupUseDown, so the player would have to be there
Is there any other instance where it would turn out to be null?
This is how I'm loading the VRCPlayerAPI
Are you sure its only triggered only on onPickupUseDown?
It's technically on a network event, but the only way to trigger it is through a PickupUseDown
Oh its a network sent event, Im not sure if CurrentPlayer is supposed to be set only for the one holding it or for everyone else. I usualy use the GetOwner instead
Who ever is holding the object is the owner of it
What's the functional difference between VRCPickup.GetCurrentPlayer vs GetOwner?
Sadly I dont know, wish there was some documentation somewhere about that.
In any case, Id try to use GetOwner instead to see if it works
The worst part is that I could not figure out how to reproduce the bug
It happened to a few people and then the UdonBehavior would just halt and become non-functional.
I couldn't find a common cause, but maybe there is a technicality where this would work better
It's unfortunate that I can't test it since I don't know why it happens, but I shall try
Is there any way to manually restart an UdonBehavior?
What do you mean by restart? reset all the variables?
No, as in restart the code in case it hits an exception and totally halts.
I'd like it if I could just press a button in my world and have the UdonBehavior restart on that object, otherwise the only way to reset it is to reload the world
I dont think theres as way to "reboot" an halted behavior due to an exception. Best you can do is make sure your code/nodes manage the potential exceptions
Like in your case, have a null check on the player object before accessing it
Yeah. Perhaps I'll add a rudimentary null check on that VRCPlayerAPI and have it scream at me in the debug console that something is wrong
yeah, unfortunately Udon can't try/catch so we just turn off an UdonBehaviour if it misbehaves rather than spamming the console continuously
I have a question. Suppose there are two players, Player A and Player B. Suppose Player B has a variable defined as"public int randomInteger;". This variable is set to a random integer between 1 to 1000 every Update() call. Player A cannot see this variable, as it is local and specific to only Player B.
The question I have is, should Player B leave, Player A needs to know what the integer that variable was the moment Player B left. For example, if the last Update() call set randomInteger to 762, and Player B disconnected, Player A needs to know that randomInteger equaled 762. Is there a method for retrieving this information?
@floral dove is there no way you could branch off with an "exception" node/path?
If you can catch and kill the behaviour, there should be a way to build on that shouldn't there? (Admittedly armchair coding here, just curious)
if i want to learn udon and i have some programming experience shoujld i just use udon#
or are there disadvantages to it compared to graphs
As it is right now udon# is faster to code in and has a few more features (such as being able to show private variables in the inspector so you can set it without accessing it through another script) however udon# does not make it obvious while coding if a piece of code will work. Such as generics will only have problems when running it in game. However you can tell based on the wiki and in unity exposure tree to read on what works and what doesn't. When using udon graph you know full well what tools you can use. However there have been errors where I've had to duplicate my udon graph script and place it back into the behaviour to make it work. While udon# doesn't have that issue. Although I'm not completely familiar with either theres are the first things I picked up on.
@scarlet lake
Just wondering does this line still work with udon?
SendCustomNetworkEvent(NetworkEventTarget.All, "");
Does anyone know how to get rid of these errors in the console log or will I just have to deal with it
Maybe I'll just do graphs but it seems like a lot to get into without the free time to use it
Howdy! I'm trying to remove player jumping for a game mechanic I'm putting together with Udon Graph.
I see the VRCWorld prefab and the jumpImpulse value, set the float to 0 but doesn't seem to impact on my player when running Build & Test, am I missing something?
@thick monolith The jump impulse is set at the start of world load. The other way I could see changing it would be VRCPlayer API Set Jump Impulse
I'll give that a try, thanks Arty!
hi everyone! newbie here. When I build-test my scene unity keeps loading an old version of it. Does anyone have any tips on how to fix this issue?
im running 2018.4.23.f1 btw, and was able to test my scene just fine several times. But I started messing with terrain and the grass brush, tested it and did not like the terrain so I erased it. But now everytime I try to test it it goes back to the version with the terrain
Sooo using UdonSharp..
Is there a way to get the name of the person who interacted with the object?
@gleaming sage Interact is always local thereby use Networking.LocalPlayer
ah, thanks.
one other question, when you enable/disable an object, is that local only? and if so is there a way to make it global?
@gleaming sage - everything is local unless you explicitly sync it using:
- 'Synchronize Position' checked on the UdonBehaviour, which will sync the transform of that object
- An RPC like SendCustomNetworkEvent, which you can send to Everyone or just the Owner of an object
- A Synced Variable. These are updated on the Owner of the object and automatically synced to everyone else, updated in the OnDeserialization method.
Thanks, momo. Think I found an example of how to do it with nodes. https://aws1.discourse-cdn.com/business5/uploads/vrchat/original/1X/3f2bd839e626a3bb60fa0e8168e35812b20254ef.png Gonna see if I can figure out SendCustomNetworkEvent and how to write that with just code. (Rather get comfortable with the code approach, as I know a bit of C#)
Unless Synchronize Position also works with enable/disable (hide/showing) of an object
doesn't seem to
yep. For recreating in UdonSharp, just make public methods called turnOn and turnOff.
However remember that it wont automatically sync for late joiners if its in the opposite state than it started
@gleaming sage Heres the full graph for synchronizing a boolean state with events
Synced Var is much simpler, but requires dirty-checking OnDeserialization
@fiery yoke you can combine SyncedVar with this for a much simpler route. Just checked the SyncVar on start, and then everything after that can be custom events.
I dont see how that would simplify anything
Well I guess you could just have the synced var for initialization, but then that is kind of a waste
Since then youre sending events and the synced var
Plus the synced var needs to "arrive" first when you load in meaning that you have to wait for the OnDeserialization, but if the bool is false then it wont change, meaning that you have no idea if you didnt receive the bool at all or if it is just false. @floral dove If you have a better solution, then I want to see it :P
it's all wrapped up in a bigger graph right now, I'll separate it out a bit later
That'd be awesome. I appreciate the answers.
That feel when you can't figure out why your udon graph isn't working
and it turns out duplicating it, deleting the original, recompiling it, and dropping it back on the same object fixes it
Are you using the new graph?
Hmm, I'm using the most recent version of the VRChat SDK, and unity 2018.4.20f1, is there something else?
There is an experimental new graph
Use at your own risk. However I think it is better than the old one in almost all aspects.
Would there be a way to set a shaders global variable ? 
global variable?
Shader.SetGlobalFloat isn't available, so I'm guessing not
Global means that every shader can access them or what?
Yes
So you can set a variable that some certain shaders have access to
Useful when you're doing an addpass shader.... Because it's impossible to expose addpass shader properties in a material.. And the only other way, requires access to the Terrain object, which is also not exposed >.>

wew i just looked at that video.. they actually fixed literally all the issues i would have with using udon
udonsharp is much nicer imo so i'll stick to that but as a graph system it looks very nice now
For people who find it easier, the new graph is a godsend
For everyone else its a nice-to-have ;D
Should I wait for the new graph update to release or get it now?
Does look pretty sharp.
@fiery yoke for the graph you posted above, the toggle group, how would I set this up for an animation? I have a Door with two animations(open, close) also a buffer system for late joiners?
You dont need to buffer
the whole purpose of that graph is so that when someone joins they request the current state from the master, and the master broadcasts it to all
Did they fix networking being unbuffered for late joiners?
That was never "broken"
Buffering is just not something that exists in SDK3
atleast not yet, who knows
I know, but I heard that there were plans to buffer it at some point
I have not heard of those plans
What's the best way to handle the syncing for late joiners?
If a late joiner joins, is it not desynced for them?
They join, and then after network has settled they get the data
so it takes a few hundred milliseconds at best until they get the data
Really, ah, so they get it even without the sync state manually being "resent" then?
I think you misunderstand how synced variables work
You dont "send" an update when you change a variable
Well you do
In a way
The photon view constantly checks if you have new data available. If something has changed it will send the data to everyone. If you join, then the photon server will retrieve the last synced data and send it to you.
At least thats how I understand it
might be wrong as well
Is there a proper way to apply force to a relative X/Y/Z angle instead of the world X/Y/Z angle? I thought I had it, but it seems to be applying to the global Z direction instead of the object's.
What I want is to have it apply directional force based on its relative Z axis.
@fiery yoke @gleaming sage - here's my cleaned-up graph to toggle a target GameObject between active and inactive, with support for late joiners.
And here's the asset.
It uses a public GameObject variable that you can set in the inspector to choose the target to turn on and off, and a single 'shouldBeActive' synced boolean to keep everyone synchronized on the current status of the object. It could be simplified further if we skipped the check for whether the variable was different in the OnDeserialization block (Boolean !=) but I do like to check for changes before firing off methods.
@hushed gazelle it sounds like you want Inverse Transform Direction in order to change a Vector3 direction from World Space to Local Space:
https://docs.unity3d.com/ScriptReference/Transform.InverseTransformDirection.html
Ahh, cheers Momo!
sure thing - make sure to do that operation on the Transform whose space you want to convert into, by feeding it into the 'instance' input.
Hey y'all. I have an Udon graph that sets the value of a property in certain module of a particle system. I'm adding a reference to the particle system using a public variable. The effect is triggered through a custom event.
This seems to work fine in the editor, but when I upload the world and test it in VRChat, I get a "Object reference not set to an instance of an object" exception.
I tried using the Interact event as well. I created a cube, attached Udon behaviour, added the Udon graph and the particle system reference.
What's interesting is when I plug Interact into Image Set Color and test the world, the cube is interactive, and interacting with it changes the color, as Image Set Color is supposed to. But when I plug Interact into Main Module Sert Start Lifetime and test the world, the cube isn't interactive anymore. Doesn't even have the blue glow that interactive objects have.
Anyone know what could be causing this, and why I'm not getting the exception in the editor, but getting it in game?
@floral dove You went with the synced variable route. That was option 3 you stated here https://discordapp.com/channels/189511567539306508/657394772603830360/727657135135260692. However @gleaming sage was then talking about SendCustomNetworkEvent in this post https://discordapp.com/channels/189511567539306508/657394772603830360/727657659804680232. That was option number 2 of the ones you stated. The graph you just posted is a solution for option 3, but as Rand was talking about option 2, it is besides the matter. It is nevertheless perfectly valid, however synced vars vs CNE's have both pros and contras
I have also explicitly stated exactly what you were saying in my statement immediately before your reply here:
https://discordapp.com/channels/189511567539306508/657394772603830360/727669385086369873
yep, my original solution used a couple of SendCustomNetworkEvent calls and a synced variable, but I think this one is simpler and more straightforward so it's what I'm posting 🙂
Still not exactly sure on the logistics of synced vars
Hmm, I think I broke the lighting in my scene.. realtime lights don't seem to update
as events are just RPCs, but synced vars seem to collected via some other photon stuff
also yes - you're right, you need more than checking the synced var on start for late joiners, since that could happen before they have the synced variable. Another reason I updated the graph.
Since VRChat heavily limits how much Network data you can send, bandwidth is a scarce thing
@gleaming sage - you may need to press 'Generate Lighting' in your lighting tab.
If a mesh has multiple materials, how do I change a specific material?
If you access the Renderer, you can grab the materials property, which is type Material[]
This should also work for SkinnedMeshRenderer
Alter the array
Re-assign it back to the Renderer I think
Renderer.materials = the modified Material[] array
Something like that should work
@hushed gazelle
This is what I thought would work, but it doesn't seem to be. What SHOULD happen is when the event triggers it advances to the next material in the material array, but it isn't assigning it. (I've already debugged and confirmed the trigger's being received)
Does anyone know how to edit textmeshpro text from udon? If i try to reference a TextMeshPro component i get a not supported in udon error, but it should be possible right?
Not supported yet.
Well I dont know what youre trying to do
I'm trying to put a hud on a vehicle
So the text elements shouldn't stick to the player
The problem is if i remove the UICanvas the text just becomes invisible
And it has to be TextMeshPro because?
Well it doesn't need to be
It just needs to move in world space, not with the player
If you dont want to go the extra mile, then just use normal Unity UI
World Space Canvas is a thing in normal UI as well...
Ok simple thing.
Trying to get a GameObject / Rigidbody to stop moving completely with an event.
the event triggers cause I got a simple debug log to see it.
But i cant seem to get the rigidbody to stop
Anyone an idea how its doable?
Like i thought its like just setting the velocity of the rigidbody to 0,0,0
You need to make the rigidbody kinematic and disable gravity
i have no idea how you'd do something like that with event triggers but i'm sure its possible
ahhh really?...thought that could be a way but had a feeling that it would be dirty way of solving it xD
Anyone got a video or walkthrough how to use the vrcpickup option Exact Grip/Gun?
Think its for holding the object in a fixed style right ?
instead of being able to hold it anyway you want it'll put the grip thing where your hand is
you mean I need to create an empty object, parent it to the pickup object where the hand should be holding it ?
I think
On Drop is the correct event for letting go of a held pickup, correct?
yes it gets called when you let it go
I assumed so, just wanted to make sure before I bang my head against something to debug it.
Also how do I test in VR? There's an option to force testing in desktop, but I've never figured out how to come up in VR.
well, it should launch in vr by default if you have the headset plugged in 
even if you haven't plugged it in it'll start steamvr
having to close steamvr every time
Never done that for me when testing, always opens a desktop client
Oh I don't have the force desktop button
it'll just force desktop as I got wireless
well.. vr desktop
Hey! Does anyone know how i would use a box collider interaction in udon?? Coming from sdk2 there appears to be no triggers for it :o
trying to activate my door animation!
You could have an Udon behaviour attached to the door gameobject, and in the Udon graph create an Interact event node and plug it into whatever logic you've created to start the animation.
SDK3 comes with a VRChat Examples folder that has scenes containing various Udon examples. The MultiExample scene has an InteractCube that shows how to handle interact events.
So I have continued work on my game mode, and have been stuck on how to assign players randomly between two teams. I have been experimenting with The Helpful Helper's Player Manager if that is of any value for this sort of thing.
I am looking for help on how to randomly pick some players and move them from one team to another at round start, any ideas? Thanks
My Player Manager is well...a bit misnamed. I dont know what I should call it so thats just what it is. It basically gives each player an object they own. Thats the whole purpose of it, it doesnt do much more.
If you want to have teams then it really depends on what each player needs to know
ideally they need to know who is in their team, and who is in the opposing team
So I am modifying the ToggleTargetActive asset posted by momo. I am trying to change it from a toggle to simply turning the target off (but it needs to be sycned for everyone, hence why Im using that asset). Do I just remove the OpUnaryNegation so that it cannot go both ways (on/off) and that it just shuts off?
that and connect the set var straight to the game object set active
@sharp basin you could make it much simpler if you just want it one-time off for everyone. But are you sure you NEVER want it to turn back on? What are you trying to do?
To make it one-way only, you could just have Interact Set ShouldBeActive to False and turn off the local gameobject. On Deserialization, just check if shouldBeActive is false and set the gameobject inactive in that case.
clicking the use buttonm should "drink" the tea to make it go away (disable game object) then, once i figure out how, the particles from the teapot will collide with the cup collider ands re-enable the tea gameobject
@sharp basin here's a super-simple synced one-time-off graph:
ah, ok - so you do want something more like the original, since you want to be able to turn it back on for everyone from a separate event.
I think this will do the trick, then:
note, it's untested. But what I've done is made it so Interact only turns it off, never back on. Then I've added a 'Refill' event you can trigger from another UdonBehaviour using 'SendCustomEvent' which will turn it back on. Does that make sense?
yes I think so, wil have to try to implement it first
grouped a little better in this screenshot
Really appreciate all of your help. Read through a lot of the documentation but I learn by doing and having a start and then being able to change it is rhelping for sure
Im making "The Jasmine Drgaon" teashop from ATLA
You're welcome. I'm a hands-on learner, too. I learned graph programming by modifying other people's graphs many years ago.
Oh, fun! I'm on my first watch-through, just saw the episode where they stopped Azula's giant drill so I think I'm just before that tea shop.
yeah the last episode/2 of season 2 has most of the scenes
Does Udon support arrays of complex types like GameObject or VRCPlayerApi?
How do I get the 2 variable boxes (targetObject and shouldBeActive)? I have them defined but do not know how to place their boxes into the graph
drag and drop!
Its as intuitive as it gets, and yet its not so obvious xD
@sharp basin check out this video for some more shortcuts if you're just starting out: https://youtu.be/IVjEx_H5BZc
VRChat Client Engineer MomoTheMonster walks us through all the brand new stuff in the latest Udon Node Graph!
As of 26 June 2020, this Preview version of the Node Graph is available on our Discord! Join us with the link below and check out our latest Announcements for the lin...
Anyone knows how can I access UdonBehaviour component with a Unity editor script?
Do I need add anything in the include part of c#?
using VRC.Udon or something like that
I did try VRC.Udon
This is what I'm tring to do
Actually nvm I copied VRC.Udon.Common
There is a bunch of stuff you have to include
maybe try VRC.*
I think thats Java syntax, I dont remember too well xD
@willow dove you can press alt-enter when you have red squiggles like that and VS can often figure out what you need to add.
I dont know what I am doing wrong but it wont let me drag and drop either gamer objects or components into the graph 😛 just the circle with a line through it symbol as my cursor
Do you know how can I use a C# script to add an program source and assign public variable?
They are using their own classes, seems pretty complicated
I also dont have a settings menu within my udon graph]
@fiery yoke any help on this one?
settings menu?
theres no settings dropdown in the udon graph, nor can I drag and drop into the graph
I watched the video and read the documentation and Im doing exactly what they show
No idea. I dont use the graph
oooh its na updatred version of the SDK
Oh yeah- you need the preview to do that @sharp basin
@willow dove you can set program variables using udonBehaviour.publicvariables or TrySetPublicVariable.
can someone friend one of my friends on vrchat
@scarlet lake this room is for asking questions about making things with Udon.
@willow dove you can set program variables using udonBehaviour.publicvariables or TrySetPublicVariable.
@floral dove Thx I will give it a try
ok so I got the exact node graph down. didnt work first time around- what were your settings on the vars? were public or synced selected on either the target object or the boolean var?
@floral dove Not sure why but I can't get it to work, is my syntax correct?
@sharp basin the Boolean needs to be synced!
ok so was messing with it- straight up doesnt work. The Toggle on & off graph from earlier works, but I cant seam to get it (the only off) to work.
oH fUck yeah I fixed it i dunno what I did but it works
@willow dove could you explain the problem you're trying to solve? I see you doing a lot of brittle work with no null checks, maybe there's a better way.
ok so the last step- filling the cup back up. New udon behavior on the cup, within that behavior I start with "On Particle Collision" and hook that to "Udon Send Custom Event". Set the event name as Refill, the same as in the other udon behavior. What am I missing to get this working? Reading from unity documentation would suggest that I need to connect the particle system that the cup will be colliding with to the "On Particle Collision" node., but I see no way to do this.
@willow dove could you explain the problem you're trying to solve? I see you doing a lot of brittle work with no null checks, maybe there's a better way.
@floral dove I'm tring to assign a list of game object to the public variable
Hmm is there a way for something to not collide with the player (In UdonSharp)? And can you do
public override void OnPickUp(){
public override void Interact(){
}
}
Because for how it is on UdonSharp, I can only Interact on something if I'm not holding it. But how to hold it and press the trigger at the same time to activate something.
@willow dove I'd recommend you first get it to work in the editor just assigning the variable, without also trying to add components and set the program source all in one go. I've done something similar before to generate a grid of items at runtime and found that it helped to make a prefab and pre-assign as much as possible so I didn't have to add components and find gameobjects by name while generating things.
@fathom oak You want OnPickupUseDown
@fathom oak for UdonSharp-specific help, I'd recommend the UdonSharp discord
Its not really specific, just a misconception
It's not for real time, just a editor script. My team need to consently rebuild the same thing so it will be easier to have it assigned
There's like 30+ items that need to be assigned so have that could be really helpful
do I need a custom event to cause the fluid in the cup to re-enable or can I just stick on particle colission directly into the same udon behaviour?
@willow dove yep, I get that, it's a pretty good way to go. I did something like that for my turn-based game, Everything Is Mushrooms. It was like this:
private void MakeBoard()
{
Clear();
pool.spaces = new GameObject[pool.cols * pool.rows];
int index = 0;
// generate tiles
for (int row = 0; row < pool.rows; row++)
{
for (int col = 0; col < pool.cols; col++)
{
var position = GetPositionForSpace(row, col);
var g = Instantiate(prefab, pool.container.position + position, Quaternion.identity, pool.container);
g.name = $"space_{GetIndexForRowCol(row, col)}";
pool.spaces[index] = g;
index++;
}
}
pool.gameBoard.publicVariables.TrySetVariableValue("Spaces", pool.spaces);
}
Making it a spoiler doesnt make it take up less space unfortunately
in this case, I'm generating the spaces into an array, and then setting that array on the target UdonBehaviour (in this case, pool.gameBoard).
@sharp basin you could use the Particle Collision directly in the same UdonBehaviour, I just put in the Custom Event as an example.
with particle collisions, it has a hookup for game object. do you know where that hooks into?
@sharp basin - click on the ? on the node to read the documentation about that method
you can find that on most nodes to learn more about what they do under the hood
I did but hold on
the nodes in Udon are generally just wrappers for either Unity or VRC methods
the documentation just says that the gameobject parameter within the "on particle collision" represents the particle system, but that doesnt help me understand where to hook that parameter up to. Do I need to somehow hook up the particle system I want it colliding with to the on particle collision?
@sharp basin have you turned on collision in your particle system?
yep, it collides with the mesh already on the cup
and 'send collision messages' is checked?
@willow dove yep, I get that, it's a pretty good way to go. I did something like that for my turn-based game, Everything Is Mushrooms. It was like this:
private void MakeBoard() { Clear(); pool.spaces = new GameObject[pool.cols * pool.rows]; int index = 0; // generate tiles for (int row = 0; row < pool.rows; row++) { for (int col = 0; col < pool.cols; col++) { var position = GetPositionForSpace(row, col); var g = Instantiate(prefab, pool.container.position + position, Quaternion.identity, pool.container); g.name = $"space_{GetIndexForRowCol(row, col)}"; pool.spaces[index] = g; index++; } } pool.gameBoard.publicVariables.TrySetVariableValue("Spaces", pool.spaces); }
@floral dove So in the udon script the public variable is called "Space" right
yes
"Spaces", yes.
hum
Thank you
Do I put "Children with LOD Group" or variable name "childrenWithLODGroup"
and yet the 'OnParticleCollision' event doesn't fire? I just put together a simple scene with that particle system and a cube and this works as expected, logging the name of the particle system's gameobject:
You'll need to use the actual variable name - childrenWithLODGroup.
ok
i dont have game object hooked to anything
But I don;t think that works for me for some reason
if you're going to be writing Editor scripts, I highly recommend you learn about using your debugger to step through your code so you can check these things yourself.
using Visual Studio?
@sharp basin - you only need the gameobject if you want to do something with it. In this case, I'm logging the name of the system whose particles collided with my object. You may want to check the name of the object to make sure it's your teapot before you fire the event or something like that, but the event should fire without that hooked up to anything. It's an output port, not an input.
@willow dove yes
Alright thank you. I never properly learned VS so I used VSCode
Visual Studio Code can do it just as well.
Hum I will look into it, thank you
Also I'm using U#, could that be why it's not working?
Yea that's what I thought but I still can't get TrySetVariableValue working for some reason
I used U# in the project with my editor scripts. It's likely that something else is going on in your script before you get to assignment, or that variable is not available. What you're doing is beyond what I can offer support for at the moment, I recommend you simplify your code and just do one thing at a time and make sure it works. Debug.Log is your friend. I also recommend you step through your code in a debugger to see what's going on.
Alright
@sharp basin You see that "other" node hanging off the OnParticleCollision Event? That is for referencing what is triggering it (in this case; the particle emitter)
Wow, the channel did NOT update in a while for me and it seems and I missed a bit. I figured out how to set materials on a mesh with several, I'm sharing an example here for anyone else curious; You need to set the Material[] value, then reassign the Material[] to the mesh renderer like so.
Better image of it, missed the Material[] call
oh my goooododddddd. the cup fills up when you hit play. but when i build and test, I can no longer empty/drink the cup when I could before.
its like once it changes state from full to empty or from empty to full, it wont let you changer it back
Can I get an example of what an extern call is?
Should I be looking to cull anything specific in my graph nodes ? Custom events, specific nodes/actions etc.
can't you declare structures in udonsharp?
Nope.
Should have checked first :P
U# is kinda limited by what Udon itself offers
You cant have custom objects or classes or anything like that
I see oh well
you can only have UdonBehaviours and press everything that you need inside those
still better than node graphs
Okay, here's a weird one; Anyone got any clue why when I test in Unity the force of an explosion applied to a rigidbody behaves normally, but in VRChat it's far more excessive?
Physics. Maybe they do some weird physics settings
Relying on physics is always a bit janky
It's downright weird, because I've changed literally nothing on my pinball's plunger and now it's just belting pinballs at bullet velocities even on a gentle pull.
The only thing I've changed is rebuilding the flipper controllers to make them more optimized.
So- this DOES re-enable the target object if it is off, but If the target object is on I cant turn it off when interacting with it. ????
Your deserialization is never going to fire because you're saying it shouldn't be equal to shouldBeActive, and it's set active.
I don't know why but all my udon behaviors look like this now and I can't fix them. I have been using UdonSharp if that might be the cause. Nothing works now
@scarlet lake try reimporting all assets, restarting Unity
okay, will do
crisis averted, thank you momo!
is thre any way of gathering metrics from instances of a map? Obviously data ethics so im thinking number of visitors and interactions with core pieces of content, no head tracking or movement tracking jazz. Does UDON allow analytics triggers?
There is currently no way for us to do analytics in worlds (Udon)
NP thank you for getting back to me man.
is it possible to instantiate a prefab using udon?
k
how can i make a teleport door on udon when im searching for Vrc_trigger nothing apears
In SDK3 Triggers have been replaced with Udon. You have to "make your own triggers" in the Udon Graph.
does someone have an example of the graph cuz im kinda new for these kind of stuff
Will there be support for TextMeshPro?
But Unitys UI is pretty okay once you figure out how it works xD
Also Merlin has a nice UI Shader on his GitHub that removes some of the UI artifacts that you sometimes see (Boxes around characters)
Hmm. I'll look into that. Thanks again.
@fiery yoke thanks
how to make pushy button that interacts with players hand? plez
anyone have that issue where unity video player URL works in unity but not ingame?
@haughty nimbus the unity video player gets removed in udon worlds due to security reasons.
Do OnBecameVisible ,OnWillRenderObject, and related methods work?
When I put callbacks on, they don't seem to be getting called
So either they're not working right, or I'm doing it wrong. Considering it compiles fine, it must be the latter I'm guessing
I only tested in the editor, but, anyone have any experience with that?
So SDK3/Udon, still no video player right? Also does anyone know of a Pen /drawing prefab that works in SDK3?
@digital orbit you need to add a mesh renderer to the object to get those calls
@chilly aspen can you share your method for compression?
@chilly aspen Wait, how and why?
I'm pretty sure if something isn't in the kilobytes or even megabytes, there's no point in compression because the overhead will just make it bigger for the nearly nonexistent improvement.
The reason is that you want to minimalize network load
@digital orbit you need to add a mesh renderer to the object to get those calls
The thing is, there is a mesh renderer on it
Either it aint working, or you did something wrong then
OnBecameVisible is an event that is called by a renderer to all scripts attached to the renderer.
Probably the latter. There's no reason it shouldn't work I feel. Or, maybe the editor
Did you actually move the camera? 😛
Yeah, I moved the camera out of visible area of it. I made sure occlusion culling was set up, and I made sure the object was culled even
I heard once that the scene tab actually messed with it too. So I closed the tab to hopefully make sure it wasn't conflicting
I should test this in game to see if it's the editor or something strange on my design then
So, OnWillRenderObject runs, but OnBecameInvisible and OnBecameVisible won't
It was said that the scene camera in the editor influences those as well, so I made sure the scene tab is closed
Hmm thats odd
Same thing happening on a monoscript, appears to be something about Unity
The strange thing is, their code example seems to hint that that's not the case
But yet, as you said, someone said it only fires the first time
Yeah I dunno seems weird
But how tho? Are you truncating floats?
I dont see how you could possibly fit a Quat into an int, without losing precision
Quaternions pack into 32 bits pretty nicely with "least 3" encoding. 10 bits of precision. https://gafferongames.com/post/snapshot_compression/ is a good resource
Introduction Hi, I’m Glenn Fiedler and welcome to Networked Physics.
In the previous article we sent snapshots of the entire simulation 10 times per-second over the network and interpolated between them to reconstruct a view of the simulation on the other side.
The problem wit...
https://github.com/hiinaspace/just-mahjong/blob/master/Assets/Riichi/RiichiGame.cs#L1008 my implementation in udon sharp
Conclusion: It works in monoscript, doesn't work in Udon (or, UdonSharp? But I don't see why UdonSharp would be the problem)
Weird. Dont know how or where that would fail
since the other Renderer events work
maybe it has to do with the Camera
I tested using a default cube, no special shader or anything
Like Udon is doing something weird and strips away too much
I'll test in game next
But I don't expect it to work though
since the other Renderer events work
Yeah
maybe it has to do with the Camera
That might very well be, hmm
In-game, same result as editor
At least, a good enough workaround can be done with OnWillRenderObject() and Update()
does anyone know how to make a simple UI slider to control the volume of an audio source? I'm trying to make a chill world with music that has an option to change volume. I've tried so many videos but I'm just getting errors or random stuff in the console 😫 😩 (SDK3)
@worldly quest check out Vowgan's video.
https://youtu.be/FWU7ckfkUrw
Interacting with modeled buttons is fine, but when you have a lot of buttons and such all in one place, you may want to integrate them with Unity's UI system. Here's how you go about doing a basic UI setup with custom events!
00:35 - UI Canvas Setup
05:40 - U# Slider Script
...
If i get Collision[].length on a collider acting as a trigger, will that return a consistent value of everything inside it?
it might be that in the collision there's a protected object
umm quick question how do i change the name of a button
so make sure to null check
like it normaly says use i want it to say mirror
it should be in the udon sharp behaviour
and when i enter the world the miiror is default on how can i make it default off
just turn it off per default like off when it's uploaded
or turn it off during the start()
make sure to not turn off the button itself
@proper bluff
yea thanks
My UdonCoasterCreator also has some pretty good compression, I'm fitting 8 Integers, a bool, a Vector3 and rotation into 10 bytes
I do then encode it as a 7bit ASCII string, which means they get sent as 12 bytes
@chilly aspen - thanks for posting some details! Neat method, though it's a bit misleading to say you're including a Quaternion when you're only storing one of its axes.
@floral dove Btw I just had a thought. Instead of manually updating synced variables for the owner, you could instead SendCustomEvent("_onDeserialization") whenever you modify a synced var. Essentially youre locally "pretending" that you have new network data, while the data was never sent over the network, but modified locally. That way you dont have to handle some special cases for more complex stuff.
(However you have to handle other special cases 🙃 depending on design)
fascinating!
Am I missing something with this? I'm trying to make a button that only appears if the User is in Desktop Mode, and it SHOULD be enabling the mesh and collider on the same object as the UdonScript -
Why are you using OnPlayerJoined?!
Well it'd check for that player and enable/disable appropriately, wouldn't it?
AHHH if I would get a penny everytime someone confuses that. Use Start.
OnPlayerJoined fires everytime someone joins the world youre in.
Right
It doesn't seem to be working. I slapped some UItext in to debug from in VRChat, and it's not getting past the check for if the player's in VR or not.
I'm just as confused.
Make sure udon didn't disconnect the noodles while you weren't looking
...And now it's working perfectly on a retry. The magic of recompiling. And copious swearing.
The (old) graph has really bad compilation problems
I observed that its when you ctrl+z something
Always go into playmode>exit>recompile>playmode
Ohh, I bet it doesn't dirty it..
Is there a specific way to spawn an object for all players?
Short answer: You cant
Damn. Is it just a flat no, or a "not yet" kinda thing with Udon?
All good.
Does anyone know anything about save data for maps? Would it come? Would it not come?
Most probably not any time soon
I figured so ;P
I think the best you could probably achieve in terms of savegames is a password system, realistically.
Indeed
You could also theoretically make your own program that has to run everytime you play the "game" that scans the output log for some custom stuff and loads the game that way :P
That would be interesting, but also no one wants to install some random software from someone on VRChat :P
Besides maybe people who use modified clients, because apparently they trust people very quickly Kappa
How do you syncronize text on all clients? (with U#)
synced string?
yeah
So like it says "Game In Progress" on all clients
instead of "Start Game"
and only Game In Progress on one client
Ok I figured it out
probably a dumb question, how do you exactly get controller inputs using U#? (for example trigger press)
for some reason I don't know how to stick Oculus_CrossPlatform_PrimaryIndexTrigger into Input.GetAxisRaw
hello ppl,
i wanted to ask if it is possible to get the information over udon how many polygons, particles and soundoutputs a avatar has.
OK, I got the input to work (at least works on Index x))
@mortal star there is a full list of inputs and a list for common inputs across the different controllers
VR controller summary
This page is a combination of the other pages. These
inputs are verified to work on every known controller, and
in cases where they don't an alternative is provided.,Use this world to test:
https://vrchat.com/home/world/wrld_f8d5f7e4-185c-4b82-8ecb-8a...
thanks
Method for player join in U#?
Edit: Found it, it's public override void OnPlayerJoined(VRCPlayerApi player)
Another question, am I able to set the variable of an udon behavior through another udon behavior, and if possible, how? U#
@boreal flower In U# you have multiple ways. You can do it the C# way or the Udon way. The Udon way is udonBehaviour.SetProgramVariable(string name, object value)
I would've done that but the object i'm setting the variable for is instanced and getComponent<UdonBehavior>() is not exposed
For UdonBehaviour you have to use the non-generic method
i.e. (UdonBehaviour)GetComponent(typeof(UdonBehaviour)), but for U# specific questions like that I would recommend that you join Merlins Discord and ask there.
Alright thank you very much
If I remember correctly CustomEvents are just Photon RPCs, but they are not sent ViaServer right? Meaning that sending a custom network event to all will be immediate locally right?
hey guys! So I havent used vrchat since SDK2... Anyways on import of SDK3 Im getting these weird notifications. Is this normal?
@unborn sphinx that's expected at the moment, no worries.
ah ookies, I was wondering if it was causing the problem I have been having with this SDK...
Tried doing a test build earlier and well it loaded the scene for a moment then took me to my home world that I built last year.... Thinking that was strange I started a blank project I imported sdk3 and same thing happened in the blank world.. So I am obviously being oblivious to something.
If my words are a bit confusing maybe this video might help.
@unborn sphinx does it do that every time? If so, try doing a Build & Test of one of the example scenes
it's also worth taking a look at your VRChat logs to see what happened
you can find them in C:\Users\yourUserName\AppData\LocalLow\VRChat\VRChat
yeah it has been doing that every time. I can go check that now
yeah, then it's likely that there's an issue with your world and/or a script in it, the logs should tell you more.
I was thinking that too, thats why I started a completely bare bones world and only imported the sdk.
just to check myself
but same issue. So maybe I might need to reinstall the sdk?
you're welcome to do that, sure. But your logs should shine some light on just what is happening in that world.
if the example worlds fail to build & test, then there's an issue with the SDK install. Otherwise, the problem is in your world setup, simple as it may be.
hm...
020.07.06 17:31:03 Warning - The referenced script on this Behaviour (Game Object '<null>') is missing!
2020.07.06 17:31:03 Warning - The referenced script on this Behaviour is missing!
2020.07.06 17:31:03 Warning - The referenced script on this Behaviour is missing!
2020.07.06 17:31:03 Warning - The referenced script on this Behaviour (Game Object 'VRCWorld') is missing!
2020.07.06 17:31:03 Warning - The referenced script on this Behaviour (Game Object 'VRCWorld') is missing!
2020.07.06 17:31:03 Error - [Always] Error Downloading or Instantiating Custom Scene - file:///C%3a%2fUsers%2fAuzurial%2fAppData%2fLocal%2fTemp%2fDefaultCompany%2fTest%2fcustomscene2.vrcw - ErrorProcessingScene
2020.07.06 17:31:03 Error - [VRCFlowManagerVRC] Instantiating the scene failed.
2020.07.06 17:31:03 Log - [VRCFlowManagerVRC] Resetting game flow because "Instantiating the scene failed": [SkipLogin, ClearDestinationWorld]
looks like you've got some issues with the world, so it aborts loading it and defaults to your home.
yeah I am obviously doing something wrong. I just dont know what. I mean I have published a world before. I import the package through asset / custom package.
try to Build & Test an example world. If that works, then make a copy of the world and work from there.
ah, sorry. If im being dumb. Im honestly only really good at uv mapping and stuff.
Okay
Ill give that a shot Momo : 3
loading up the multiExample world now and seeing what happens
same thing.
Ill try redownloading and then creating a new project
yeah, sounds like something got b0rked on import then.
XD I am going to steal that just so you know.
Oh no I b0rked that up. Its perfect
So redownloading yielded the same results. Sigh.. Sorry I feel like im just wasting peoples time with this now haha.
It felt so easy to upload with sdk2 so I dont know how im messing this up.
almost wanting to redownload my unity client at this point.
okay
I need you not to laugh at me Momo
I checked steam, and I hadn't updated vr chat since 6 months ago or so since I was last online. It works now....
lul
can you sync Quaternion atm?
I dont think so
im trying to find a way to sync the rotation of an object locally but getting player's model data, but i found the bone data between models isnt consistent, and the tracking data of models you see (ie not of you) seems to be based on the bone data. So im trying to create a calibration step that tracks a common rotation to then apply that "default rotation" to the object
ah...starting to think this might not be worth it
basicly in the dbz world, i wanted to make the tracking a lot better, cuz if you use the ki blade, it becomes extreamly apparent the synced tracking is slow
but basing it on the local bone data, it rotates and moves with the model instead of with the sync, so its a lot faster....but its proving to be difficult
Has anyone had success with syncing bytes?
you could maybe sync a single one but that won't be useful until we have array sync for byte[]
does Vector4 not sync? Haven't looked at that yet but I know Vector3s sync ok. I think I got 10 Vector3 properties syncing on a single object before serialization started to error out.
I am trying to sync a single byte
however its complaining about "Cant retrieve heap variable int32 as byte"
And I dont know where I messed it up
ah ok, maybe that's just not supported yet. I've only tried the types in the SyncTest scene
I feel like I just did something wrong. But I dont know where or what xD
Does the sdk3 generally take longer to upload compared to sdk2?
depends on how complex I'm sure.
mine is not complex yet. i've only added player walk, run, and jump so far. I have animated objects running though by default. idk if that would cause it. My light map isn't generated and the file size is only 122 mbs.
so far it's taken 1hr. rip
That is definitely not normal. Either you do have a really big scene, or something has gone wrong.
or super slow upload speed
or that
it's in the building phase. it uploaded quicker before, but the only thing i added was a floating robot.
I've also ran into some of my projects before UDON where it would be in a state of ever ending uploading. I usually restart and do it again. With the new updates, never had such issues.
do animated objects need to be scripted with Udon, or can i just animate them normally like with sdk2?
Animators still work like before
only the legacy Animation component was removed (blacklisted)
ah ok, thanks. i thought maybe it was the animations. i guess i'll just disable stuff before uploading to see what is causing this.
So when making my world, when I set the jump impulse to a low variable it will make the gravity less affective?
correct?
No. You just wont jump as high
i.e. you get less upwards velocity when you jump
If you want to reduce Gravity you have to use SetGravityStrength
so if I se the jump impulse to lets say 5 I will jump higher when it was at 3
Yes
alright thanks
Higher and faster
alright thank :3
@arctic kite - make sure your lights are not set to auto-generate, too.
is it possible to get the avatar performance stats over udon? so when someone clicks a scan button it scannes how much polys; particle and so on it has
No(t yet)
ok becouse i wanted to make a udon script that puts PPl with potential crasher avatars automatical in a quarantine zone
Just out of curiosity on that note, is there a trigger for the player's avatar changing?
There is a canny
there is also workaround ways to detect it
but nothing official (yet)
so there is a workaround to get the avatar stats?
No
ok so only avatar changing
what is this ? like what does it do? allow people to grab the item from anywere?
It's what lets you re-grip a held item with the other hand.
Not sure but I think that is for Xbox360 Controllers so you can rotate them while holding them.
