#udon-general
59 messages · Page 49 of 1
Unless it's named badly...
I noticed in the web docs that the description was confusing and sounded like the opposite of what it should be.
But before I get into that...
I have another question...
OnDeserialzation...
Should I use that? Or Update?
I'm wondering if OnDeserialiation will be called once at the start, or if it will only get called the first time VRChat updates... well... I assume that must be called when any udon data is deserialized but I don't know when that will happen.
I could test it in the game but then I have to build and upload the whole thing.
But I guess I can try that later and see what happens. For now I'lljust try Update.
OnDeserialization is for network syncing variables (eg; keeping all local video players at the same timestamp as the Master). Update is for local per-tick repetition.
Well I'm trying to sync a variable here. I want all players to see when a player opens or closes a magazine.
https://docs.vrchat.com/docs/event-nodes
"OnPickupUseDown
Fired when this object is held and the Use button is pressed. Fires on button down."
So that sounds like I expect, but I read a different description elsewhere which sounded like the complete opposite. Anyway, it should not be firing at all if that description there is right.
This is a list of Udon Nodes that are considered "Events". Events are used to detect actions and set off chains of action or logic. All below nodes have flow nodes where logic requires it. Interact Fired when a VRChat player interacts with this object. OnDrop Fired when a VRChat player drops this ob...
Still getting that weird behavior. I changed Start to Update and tested it again without the OnPickupDown node connected, and it behaved as expected. Then I connected that node and once again all the closed magazines (those with MagazineOpen set to false by default) were set inactive while the open magazine, which had MagazineOpen set to true by default had the closed mesh made active. The open mesh's state for either of the two seems unaffected.
But I'm gonna try hiding the open magazine's open mesh and see if it shows up...
Huh... It did. I didn't expect that. So what happens if I make one of the closed ones have their open mesh visible...
Um... hmmm. The open mesh for a magazine with MeshOpen set to false by default was also hidden?
So if MagazineOpen defaults to True, for both Open and Closed meshes are made active. If MagazineOpen defaults to False both Open and Closed meshes are made inactive.
But WHY?
They are set correctly if I don't have the OnPickup node connected.
And Open and Closed are quite clearly being set to MagazineOpen and NOT MagazineOpen, so them being in the same state at any time should be impossible.
Unless... The Udon graph is being processed not by running the Update branch first, and then the OnPickupUseDown branch second, or vice versa, but rather, it is executing them in parallel, one node at a time, and after setting Open, the SetMagazineOpen node is triggered, inverting the value before or after the inversion phase above, the result of which is then being fed into SetActive for the Closed mesh?
If thats the case though, how the hell do I stop that from happening? OnPickupUseDown is an event. Which first of all should not even be firing, and second, doesn't have a flow input, so it's not like I can use the flow control node whatever that's called to pick the order it goes in...
Okay wtf...
I change it to OnPickupUseUp and it... Well I don't want to say works, because I haven't tested it in game yet to see if I can open and close them, but they show up in the correct states at least in the editor.
I should be able to use either OnPickupUseDown, or OnPickupUseUp.... ASSUMING they only fire once, and not repeatedly while the use trigger is in that state... But I chose down because it would provide more immediate feedback to the player. Nonetheless, it should not be firing when testing in the editor, so it shouldn't affect anything. But it is. While OnPickupUseUp seems to be functioning as expected.
I don't think there's any way around the fact that you're setting that variable from two conditions at the same time
and you need to separate your script
However, because OnPickupUseDown broke in that way I'm now suspicious that Udon is executing this stuff in parallel.... And that even if OnPickupUseUp works that it will still be the case that when it triggers it will flip the state before the second object is set.
@paper plinth I hadn't even considered that I could use two Udon scripts on a single object... I suppose that would be a way to control the order in which these exeucte.
I mean don't set a variable from two different events like that
We couldn't do it in the 90s and we can't do it here
I'm trying to say that the entire section of what you want the behavior of the object to be needs to be an independent function
OnPickupUseDown happens either before or after Update, HOWEVER it can happen in the same frame as Update. Which is probably why youre thinking its running "In Parallel"
@paper plinth I don't understand.
This is the "entire behavior of the object" in a function.
no
first you have the object
then you have what you want the object to do
the object is still a scripted object even when nobody is touching it
I'm still completely lost at what you're triyng to convey here.
Okay but... I need to have the magazine open when the user interacts with it, so how do I do that if I can't do what I've done there?
interact
latch the interact
I don't know what that means.
There are also some bugs regarding the graph incorrectly processing reused node paths
Not sure if those apply here
I had no idea that was a bug because rslogix does that and it's why you have to keep your ladders separate
Theoretically you dont have to seperate those
yes I argued this
Are you saying that what you've been trying to tell me all this time was just to not re-use those variable nodes and make a copy of them for the OnPickup node?
I think thats what they were trying to express yes.
sure you can do that
But again:
OnPickupUseDown happens either before or after Update, HOWEVER it can happen in the same frame as Update. Which is probably why youre thinking its running "In Parallel"
The order of what happens in which order is important
because both things can happen in the same frame
In the same frame isn't a problem... IF the whole flow path for Update executed first, and then the node path for OnPickup second.
if you don't mind if that takes a couple of scans to complete just control it with booleans
But if they are executed in parallel as uh... shit I forget the word... Then the variable could get set in the middle of the flow by the other code.
What?
ensure that your steps are executed in order by setting a boolean when each step completes
Also I just looked at your graph actually...what the fuck is that supposed to do?
and then clearing those booleans
Youre "opening the magazine" and "closing" it every single frame
No?
I know it's confusing. It would be better as a single game object but I bought the assets and well...
can you show me the assembly thats producing?
This is with OnPickupUseUp:
put it in ``` pls thx
.export MagazineOpen
.export Open
.export Closed
.sync MagazineOpen, none
instance_0: %UnityEngineGameObject, this
value_0: %SystemBoolean, null
instance_1: %UnityEngineGameObject, this
value_1: %SystemBoolean, null
Boolean_0: %SystemBoolean, null
MagazineOpen: %SystemBoolean, null
Open: %UnityEngineGameObject, this
Closed: %UnityEngineGameObject, this
.data_end
.code_start
.export _update
_update:
PUSH, Open
PUSH, instance_0
COPY
PUSH, instance_0
PUSH, MagazineOpen
EXTERN, "UnityEngineGameObject.__SetActive__SystemBoolean__SystemVoid"
PUSH, Closed
PUSH, instance_1
COPY
PUSH, MagazineOpen
PUSH, value_1
EXTERN, "SystemBoolean.__op_UnaryNegation__SystemBoolean__SystemBoolean"
PUSH, instance_1
PUSH, value_1
EXTERN, "UnityEngineGameObject.__SetActive__SystemBoolean__SystemVoid"
JUMP, 0xFFFFFFFC
.export _onPickupUseUp
_onPickupUseUp:
PUSH, value_1
PUSH, MagazineOpen
COPY
PUSH, value_1
PUSH, MagazineOpen
COPY
JUMP, 0xFFFFFFFC
.code_end
And this is with pickup use down:
.export MagazineOpen
.export Open
.export Closed
.sync MagazineOpen, none
instance_0: %UnityEngineGameObject, this
value_0: %SystemBoolean, null
instance_1: %UnityEngineGameObject, this
value_1: %SystemBoolean, null
Boolean_0: %SystemBoolean, null
MagazineOpen: %SystemBoolean, null
Open: %UnityEngineGameObject, this
Closed: %UnityEngineGameObject, this
.data_end
.code_start
.export _update
_update:
PUSH, Open
PUSH, instance_0
COPY
PUSH, instance_0
PUSH, MagazineOpen
EXTERN, "UnityEngineGameObject.__SetActive__SystemBoolean__SystemVoid"
PUSH, Closed
PUSH, instance_1
COPY
PUSH, MagazineOpen
PUSH, value_1
EXTERN, "SystemBoolean.__op_UnaryNegation__SystemBoolean__SystemBoolean"
PUSH, instance_1
PUSH, value_1
EXTERN, "UnityEngineGameObject.__SetActive__SystemBoolean__SystemVoid"
JUMP, 0xFFFFFFFC
.export _onPickupUseDown
_onPickupUseDown:
PUSH, value_1
PUSH, MagazineOpen
COPY
PUSH, value_1
PUSH, MagazineOpen
COPY
JUMP, 0xFFFFFFFC
.code_end
Yeah its not doing the unary negation in that block
Completely ignores it
Pretty sure this has to do with the graph compiler trying to "optimize" it
optimized the whole unary negation away lol
Where?
EXTERN, "SystemBoolean.__op_UnaryNegation__SystemBoolean__SystemBoolean"
Ohh yeah in Update
but not in OnPickupUseDown/Up
99% sure this is a bug of the graph compiler.
What is the problem again? x)
The user is not interacting with the object.
The problem is... Without that node there for the user interaction check... the magazines look fine. But if I include the OnUsePickupDown (not UP for some reason) then the Closed magazine meshes all take on whatever state the default of MagazineOpen was....
So it's like this code:
PUSH, value_1
PUSH, MagazineOpen
COPY
PUSH, value_1
PUSH, MagazineOpen
COPY
JUMP, 0xFFFFFFFC```
Is being called somehow when the user is neither holding the object nor pressing the use button.
That code, does absolutely nothing.
It says "Copy the value of MagazineOpen to value_1, then copy the value of value_1 to MagazineOpen"
You can probably see how redundant that is.
Ohh actually
It copies the first to the second
so value_1 to MagazineOpen then MagazineOpen to value_1
let me take another look at the assembly
LOL why do I keep finding all the bugs in this thing when I've only just started using it...
Because there is a ton of them
Believe me youre not the first
The graph compiler has been causing troubles left and right...unfortunately
I mean you know...Udon is in Alpha
But yeah I think thats another case of false optimization that the graph compiler tries to do there
I also found the bug where dragging objects from the inspector panel into Udon to make nodes would cause the public variables they create to not appear in the inspector till I restart Unity.
I'm gonna go ahead and copy those variable nodes over and see how that works.
Hm... well that seems like maybe it worked?
Btw all that talk earlier about what we did in the old days with event variables is kinda ironic considering...
This is what this is going in...
Okay so I think maybe the code is working as expected now. I tried several combinations of hiding and showing the meshes and it reset them all to the correct states based on how I had their MagazineOpen variable defaulted...
.export MagazineOpen
.export Open
.export Closed
.sync MagazineOpen, none
instance_0: %UnityEngineGameObject, this
value_0: %SystemBoolean, null
instance_1: %UnityEngineGameObject, this
value_1: %SystemBoolean, null
Boolean_0: %SystemBoolean, null
Boolean_1: %SystemBoolean, null
MagazineOpen: %SystemBoolean, null
Open: %UnityEngineGameObject, this
Closed: %UnityEngineGameObject, this
.data_end
.code_start
.export _update
_update:
PUSH, Open
PUSH, instance_0
COPY
PUSH, instance_0
PUSH, MagazineOpen
EXTERN, "UnityEngineGameObject.__SetActive__SystemBoolean__SystemVoid"
PUSH, Closed
PUSH, instance_1
COPY
PUSH, MagazineOpen
PUSH, value_1
EXTERN, "SystemBoolean.__op_UnaryNegation__SystemBoolean__SystemBoolean"
PUSH, instance_1
PUSH, value_1
EXTERN, "UnityEngineGameObject.__SetActive__SystemBoolean__SystemVoid"
JUMP, 0xFFFFFFFC
.export _onPickupUseDown
_onPickupUseDown:
PUSH, MagazineOpen
PUSH, MagazineOpen
EXTERN, "SystemBoolean.__op_UnaryNegation__SystemBoolean__SystemBoolean"
PUSH, MagazineOpen
PUSH, MagazineOpen
COPY
JUMP, 0xFFFFFFFC
.code_end
Yeah that looks better
so as a general tip:
Dont reuse nodes. At least not right now.
Well I'm glad it was just a bug and not me losing my mind. And my touch. 😄
Hello, I'm looking for some documentation or example to make a button toggle multiple empty simultaneously on and off at the same time, would you have one please?
empty as in game objects?
Yep
you have udonsharp imported?
Yep
then there should be a script that comes with it
that does exactly what youre asking
Indeed, thank you!
is there a Tutorial or anything for creating NPC´s or more specific Bosses on Udon SDK?
Is there a simple two thing toggle anyone has?
And also a toggle where it turns off the other mirror and turns the other one on but when clicked again it doesn't turn back on the other
why not
let me turn it back on
I was going to find a basic AI script and convert it and then I realized I was looking for basic AI which I don't think exists
@ me if you find an answer to this
Well I want like a good mirror and a bad mirror and it to turn off when you're using the other one
@misty hedge i might have something for you if my internet survives
Thanks!
For the mirror toggle or the switch
its a package labeled “mirror system” which i believe has that, but dont quote me as it does other things for mirrors as well
i dont my internent is strong enough to send anything, sorr
https://booth.pm/en/items/2668806
Here's an option you could look into if you just want something that works.
Touch Controls Prefabs for VRChat w/ Udon. Requires SDK3.0[Udon] (last tested w/ v2020.4.4p1) and UdonSharp[U#] (last tested w/ v0.18.8). View the README.md file in the package for more information. Models by Yodokoro (source https://booth.pm/en/items/2458051) The model is included with their
Isn't that just a pretty button?
Have a look at the video in the description.
If it doesnt fit your usecase, no worries. Just presenting it as an option.
Thanks
Are there owner/master based restrictions on SendCustomNetworkEvent? It's hard to find much documentation. My stage microphone button correctly toggles for everyone, but sometimes not all players on stage get their voice distance set and I'm trying to figure out why.
`does somebody know if they sell only the vr controller appart from the glasses i only want the controllers not the glases do they sell?
@fiery yoke Well, the magazines seem to be displayed properly, but they're not triggering in game when I try to use them while holding them. For reference, this is the current version of the code:
I mean I assume the trigger is what I'm supposed to be clicking to "use" something I'm holding. I tried both triggers and such.
Also, MagazineOpen is set to Synced "none".
Hm, why does this have "PUSH, MagazineOpen" twice at the start and end of the PickupUseDown function?
.export MagazineOpen
.export Open
.export Closed
.sync MagazineOpen, none
instance_0: %UnityEngineGameObject, this
value_0: %SystemBoolean, null
instance_1: %UnityEngineGameObject, this
value_1: %SystemBoolean, null
Boolean_0: %SystemBoolean, null
Boolean_1: %SystemBoolean, null
MagazineOpen: %SystemBoolean, null
Open: %UnityEngineGameObject, this
Closed: %UnityEngineGameObject, this
.data_end
.code_start
.export _update
_update:
PUSH, Open
PUSH, instance_0
COPY
PUSH, instance_0
PUSH, MagazineOpen
EXTERN, "UnityEngineGameObject.__SetActive__SystemBoolean__SystemVoid"
PUSH, Closed
PUSH, instance_1
COPY
PUSH, MagazineOpen
PUSH, value_1
EXTERN, "SystemBoolean.__op_UnaryNegation__SystemBoolean__SystemBoolean"
PUSH, instance_1
PUSH, value_1
EXTERN, "UnityEngineGameObject.__SetActive__SystemBoolean__SystemVoid"
JUMP, 0xFFFFFFFC
.export _onPickupUseDown
_onPickupUseDown:
PUSH, MagazineOpen
PUSH, MagazineOpen
EXTERN, "SystemBoolean.__op_UnaryNegation__SystemBoolean__SystemBoolean"
PUSH, MagazineOpen
PUSH, MagazineOpen
COPY
JUMP, 0xFFFFFFFC
.code_end
Best practice question (udonsharp) :
Im trying to instantiate parts of a random maze, so im using VRCInstantiate, but it appears this will automatically add a rigidbody to the instantiated element.
Is there a better way to spawn "static" objects, or should I just stick with that and just lock those items into place by preventing the rigidbody movement ? iirc I cant make them kinematic as I still need their colliders and kinematic colliders are disabled
nvm, I think the rigidbody component was added by another process
So going by a post I found on another forum here, it appears my issue may be that OnPickupUseDown and OnPickupUseUp will not trigger unless you have enabled AutoHold on the pickup, because Desktop and Vive users could not otherwise trigger the pickup while holding it because the hold button is the trigger. So I guess they disable activating pickups for all headsets including those that don't have that limitation just to force designers to do the right thing and not use it without AutoHold? It would be great if the docs would mention important things like this, because I've been trying to figure this out for hours now! There's no mention of this quirk here: https://docs.vrchat.com/docs/event-nodes
This is a list of Udon Nodes that are considered "Events". Events are used to detect actions and set off chains of action or logic. All below nodes have flow nodes where logic requires it. Interact Fired when a VRChat player interacts with this object. OnDrop Fired when a VRChat player drops this ob...
hi im making a toggle animation using avatar 3.0 menu and i disabled locomotion but how do i disable jumping
"Interact
Fired when a VRChat player interacts with this object."
What does this mean? Like, under what cirumstances, will this fire? What constitutes an interaction? A player picking the item up? Clicking the trigger while holding the item? Pointing the targeting laser at the object and clicking?
Yeah. Its very vague. But its hard to define it. Basically VRChat has an internal "Interaction" mechanic. Which is like a pickup, but instead of grabbing it you press the trigger which "clicks" it.
Hm... I wonder if perhaps I should use that for my magazines instead then. I'm not sure if I want to enable auto hold which will make them stick to your hand instead of acting like a normal pickup, but I also want the player to be able to open them.
But I thought with the Index I pulled the trigger to grab things. I can't recall, it's muscle memory. 🙂
Well yeah I think trigger also grabs stuff...for whatever reason
I guess when you make a fist you just "pull all buttons" technically. So trigger works just as well as grip, probably is more convenient as well
It depends on the platform, which is why the description is vague. It could use a better description, though. Interact is triggered in Desktop mode when you left mouse click on an Interactable Object, and on Oculus Touch when you press the index trigger on an Object, for example.
Well but a description like "Interact is fired when you interact" is pretty useless
I found the docs here for the controls: https://docs.vrchat.com/docs/controls#
Click the headers for each section to be taken to the bindings page for each control scheme. VR Headset VRChat officially supports the following headsets and their corresponding control schemes: HTC ViveHTC Vive ProOculus RiftOculus Rift SOculus QuestOculus Quest LinkValve Index Although we may not...
The Index I guess is grip... I keep forgetting I don't have that second trigger. I used to have a Rift. 🙂
I'm still a bit confused about this though, because isn't OnPickupUseDown also the trigger on Index? So like... Are both that and Interact fired when I pull the trigger while holding a pickup? Or will Interact not trigger while I am holding the pickup, and OnPickupUseDown will trigger instead?
Pickups and Interacts are generally incompatible with each other
or at least their behaviour can be odd and not necessarily what you want
Well I mean... I don't even know what I want really. I mean what is the right way to allow a player to open a magazine in VR? Grab it with both hands and pull? 😄
When you are holding a pickup, you get OnPickupUseDown and not Interact, correct.
It depends what youre going for, if you want a realistic opening movement, then you need quite a complicated system. If you just want a simple thing that works then use OnPickupUseDown
But then I have to use autohold and the magazine will stick to your hands which is different from the behavior of all the other pickups...
autohold currently only works on platforms that don't have separate grab buttons, just Vive Wands and Desktop I think
Of course I may just have to live with that. I understand there's a lot of different input devices to deal with. I'm just trying to decide on the best way to handle it.
https://docs.vrchat.com/docs/vrc_pickup
Auto Detect - Automatically detects what to do
Yes - After the grab button is released the pickup remains in the hand until the drop button is pressed and released
No - After the grab button is released the pickup is let go```
Used to allow objects to be picked up and held Requires: RigidbodyColliderRPC's are available via the SendRPC action
I saw something somewhere about auto detect and how it functions, and I think it mentioned the vive and desktop, though it doesn't say there.
But if it doesn't work for non desktop and non vive users... Then what is Auto for?
For that matter... You're telling me it doesn't work for Index... But I was counting on enabling that being the solution to my problem with the OnPickupUseDown not working for me!
@floral dove If Audohold doesn't work on the Index, then how do I trigger OnPickupUseDown? Cause it won't trigger and other posts here said I should set that to Yes to make it work....
I'm gonna test it now to see if it makes a difference or if it's still broken with that on.
Maybe it works on Index, too - I don't have one to test with so let me know what you find out
Also... Why does this thing compile shader variants every time I upload my world when I'm only using standard shaders?
I don't even recall seeing it do that before until a few months ago.
@floral dove Successful test! So, it would appear that I do in fact need to have AutoPickup set to "Yes" not "Auto" in order for the OnPickupUse event to fire, AND it appears that even with AutoPickup set to yes, the pickups do NOT stick to your hand with the index when you grab them by squeezing the grip, and you can simply let go to drop them, which is what I wanted.
Anyone know how to correctly add a keypad to a door?
https://github.com/cherryleafroad/VRChat_Keypad
Using this one. Got the code part to work, but the door disappears and we fall through the world.
i play vrchat on my computer and i get so confused wit sum things bc idk how to do them or whatever on my computer
Is there a simple way in udon to turn particles on and off based on the area somebody is in?
A simple example. Create an empty gameobject with a Trigger attached to it. Then add an Udon behaviour to that object and attach this graph to the Udon behaviour. The particleSys variable has to be public so you can assign it from the Inspector. Then whenever the player enters the trigger the particle system should start, and when the player exits the trigger the particle system should stop.
I have a station in a big trigger collider and I'm doing a bit of logic in the OnPlayerTriggerStay event that doesn't seem to fire if a player is sitting in the chair. Is there a slick workaround for this?
I wonder if the collider on the chair is blocking the collider of the ship so it doesn't think you're in there anymore and you may be able to switch one of the colliders to a different layer like Mirror Reflection...but that's a guess
Or potentially check to see if the player position is inside the collider bounds instead of using onplayertriggerstay.
XD
Is your string too long?
i got this error while using Usharpvideiplayer
URL too long?
yes?
Hello everybody
I want to have a script so when it gets triggered, It will trigger an interact with a random child object's button.
Is it possible?
I tried to google but I couldn't find anything
Example:
[] - Button
[] - Script
[] - Parent
[] - Child Object with button
[] - Child Object with button
[] - Child Object with button
[] - Child Object with button
you want a bunch of objects to do something on interact
AND
you want there to be a button that sets them off all at once?
No, I want the script to trigger a single child object, At random
So someone clicks the button, Which activates the script,
The script then randomly interacts with a child object
ok there's a way to do that with an array that I don't know so I'll let someone else answer
but that's how you do it I think and then you just pick a random integer and hook that into your array element
wow it's 1999 again
Any tips on what I can try to google in the meanwhile?
basically you want all the child objects to be scripted with a behavior
then you want to load all those objects into an array
and have your code pick one
I've tried things like
Unity button interact with child objects button
Unity C# randomize button interact
Unity script to interact with buttons
or potentially you can put them in there yourself as a public variable and just iterate your code a dozed times if it's small enough to not bog down the editor
*dozen
Do you guys know how VRChat does the world up? I'm trying to get an aim constraint on an avatar working, and it behaves differently in Unity than it does in VRChat. I need to specify what kind of up vector is being used (the different options affect Unity behavior dramatically), but obviously this is something that has to do with the world my avatar is in. And I don't know anything about worlds, or how to find this kind of thing out.... except to come here
World Up in general is always Y+ ... not sure what you mean.
Then I'm probably doing something else wrong--but it's good to get confirmation that it's a confusing question. One more value to leave alone while I try to get this working. 🙂
Transforms and rotations can be pretty hard to wrap your head around, indeed
@restive dust thank you so much! :D
it doesn't make sense to me because I didn't have vector math in school. I don't know how position plus up equals direction, multiplied by a value equals a velocity or whatever, I just follow the book
I have no idea how to do Quaternion rotation, I don't even know what that is or how to apply it
Well yeah having some background in Linear Algebra and Geometry certainly helps when working with 3D Space :P
Yeah I think that's the situation. It's doesn't fire an exit event when you sit down, but fires entry when you stand up
That's extremely good to know
Could be why the person who wrote my walkable ship script made it check for player position inside the collider bounds, otherwise you'd have conflicts if you put other colliders inside.
yeah maybe that's the easiest way
honestly every time I start with onplayertriggerstay I always find a better way to do it
you guys got any big-brained ideas when it comes to simulating procedurally generated terrain like Scorched Earth?
This will turn on and off globally FYI. If you want it to only turn on for that person, you want to branch based on player IsLocal
depends if you're doing it for optimization or for visual effect
is this stuff to make an avatar from scrap??
Nobody knows how Quaternions work. 😜 That's really advanced stuff. All you really need to know about them unless you're writing a 3D engine yourself is that they don't suffer from gymbal lock like Euler rotations do, so if you use them to rotate objects from one orientation to another, they'll never get stuck in a state where say, both the Y and Z axis rotate the object the same way, and you lose one degree of freedom of rotation. They also allow you to rotate from one orientation to another in a straight line no matter the rotation, whereas with Eurler it might take a longer route than it needs to. I think? In any case, Unity uses them behind the scenes, converting Euler rotations you specify to them and providing rotation interpolation code, so you don't have to worry about the actual math behind it all.
Ofcourse there is people that know how Quaternions work, but you dont need to know how they mathematically work. As you said you just need to know what operations you can apply to them and what results you get and how to interpret those results.
Its still really fun to learn how they work and the mathematical theory behind them. 3Blue1Brown has an incredible interactive video demonstrating Quaternions.
One of these days I'll get a more curious head about it
As for vectors... First let's start with normals. A normal is a vector with a length of 1. Imagine a normal as a line with a length of 1 pointing out from a surface on your model. Normals are used for lighting and physics calculations. Now imagine you've got a missile and you want to move it in the direction its pointing. First we start with a normal in missile space. If we assume the missile is pointing down the Z axis, our normal will be 0,0,1. Now, let's say we want to move our missile at 5 meters per second. We can do one of two things. Either we can multiply our normal by 5, giving us 0,0,5 (you just multiply each of the three components by the magnitude) and then transform that vector into world space (using Unity's built in math functions because the matrix math is complex and they already did it for us) or, we can first transform that normal into world space, and then multiply that resulting normal by our magnitude to get our vector. Either way we get the same resulting vector. Then what do we do with that vector? We just add it to the missile's position... after multiplying it by DeltaTime or whatever it's called in Unity which is our time step per update.
Hehe I didn't mean literally nobody knows how Quaternions work, but most game programmers don't. I certainly don't. I have never been able to find an explanation for how the math works which I can follow. They're like some 4D hypersphere rotation or something. 😄
Quaternions are a black box. Accept that they represent a orientation, use the class's methods, and ignore the raw float data.
I understand how they work - and it's not even slightly useful knowledge
that makes sense, I just had to look up magnitude to get speed and figured that one out pretty quick
Rule of thumb - if you are operating on a quaternion's float values directly, there's probably a method you should be using instead.
this entire exercise in a roundabout way was supposed to give me a cool ground vehicle that was just super fun to drive
so I'm learning what the functions do in incremental steps
I've got a cannon here and the cannonball is what I'm applying velocity to
all these stupid projects from the beginner programming books we all had in the old days
that eventually teach you the language
I've got the angle set, which sets up the projectile just fine, and I've got power from 0 to 1, rotation, and now I've got to make some different projectiles.
which means I'm looking for an easy way to set one gameobject in an array active at a time
I guess I should do that in the script for each one
How do I go about adding those little text things when players hover over a button with Udon? I think with SDK2 it was just a string you could add. Is there an Udon button prefab with the same thing, and if not, how might I add it?
You mean the text specifically?
Look for the text in the inspector if I know what you're talking about
@cunning mist Yeah, like this tutorial shows how to make the button, but I don't see how you add the tooltips like SDK 2 had. https://www.youtube.com/watch?v=ibDu0dCeUE8
With the recent Udon updates, some of the basics have changed, so here's my most basic tutorial redone with the new editor, and not recorded at 2am! If I get enough requests, I'll redo my "Contextual Buttons" video as well, which will give me an excuse to just rename them "Event Buttons" which actually makes sense.
00:00 - Intro
00:20 - Udon Gr...
LOL that's your tutortial.
Thanks for making all those btw they're the best source of info on this stuff I've found so far.
Also Tooltips are now a lot easier to add. If you have an udon behaviour on it with an Interact event, the spot for the text shows up automatically now.
Just right in the UdonBehaviour.
And yeah that's me haha
Glad to help!
Is that toggle global so all players will see it, or is it local only? And if its local only as I suspect, is there an easy way to make it global, or like do any of your tutorials cover that?
I don't have any yet, I'm kinda delaying my networking stuff for the networking Update coming VRSoon™
In the meantime, instead of doing all that in Interact, have it all in a Custom Event and call that event from Interact with SendCustomNetworkEvent.
Sounds simple enough. But I'm wary of events. I tried using them in SDK 2 to make a raccoon in my murder campground world make the same chitter noises for all players by having the master decide which one plays and it didn't work at all and I couldn't find anyone who knew how to fix it.
Don't worry, EVERYTHING runs one events now! Fortunately they're like the most stable part of Udon so it'll be fine. 👍
@cunning mist It's not events being buggy which concerns me, it's the confusing mishmash you get when you're trying to make sure all clients are on the same page and having the master make the final decision on whether something did or didn't happen to keep everything in sync. For example, when a player collides with a trigger, I could have the player tell all the other players they collided with it. But maybe the packet is lost on the way to some of the players or worse the master, and now everyone is out of sync. Or maybe I have them tell only the master they collided, but what if that message gets lost in the mail? Or I could have the master detect that they collided with the object and then tell everyone else including the player that collided with it that they collided with it, and while that would make sure everything was always in sync it would also introduce delays for the players before things they collide with react to the collision. And that complexity is why I couldn't get my stupid raccoon to work right. I could easily have just made it trigger a random sound when a player touched it, but triggering the same sound for all players was much more complex and the master had to be the one to pick the random track to play to do it. And I thought I had it figured out, but it didn't work. Perhaps because of a bug in in the audio jukebox or events or something. Or maybe I just screwed up. I have no idea!
Anyway, speaking of audio... the audio in VRChat is seriously messed up...
So I've got that song, right? And you can see from the waveform it's pretty loud in the audio file already, almost peaking... But in game, if I leave the NEAR distance at 0 as is recommended for proper spatialization... It's really quiet. I tried increasing the gain, which from what I have read is not supposed to be limited in worlds, but above maybe 20db gain, it didn't get any louder, and it was still pretty damn quiet even with just me in the world with my world volume and main volume setting at 100%. My windows audio is also at 100%. I bumped it up to 40db just in case it was just not getting twice as loud every 6db as it should, but it was no louder.
The only way I can get the sound to be a reasonable loudness in the world, where one could actually hear the music over conversation while standing 3 meters away from the speaker, is to increase the NEAR value, which I have done here. But 0.5 meters for the near value is still insufficient here. I assume the volume will double if I increase it to 1m, but based on the current volume level I'm thinking I'm gonna have to bump it up to 2m to get the volume level where I want it. But that then means that instead of the audio sounding like it's coming from the speaker on the monitor, you're not going to be able to tell where its coming from 2m away from it, which is not at all what you want for good audio. I thought the built in compressor was supposed to take care of audio which is too loud, so why this limitation on world authors that makes for bad sound spatialization?
That was the next thing I was going to mention... So yeah, I could check that and have a linear falloff instead, but it doesn't really solve the core issue and won't sound as realistic. That is assuming it even works. With avatars I have never had any luck with that setting.
Unless you're suggesting I click that and don't make the falloff linear... But why would that make a difference?
Is there a known bug here?
Nope, just leave all values on the Spatial Audio Source default and check those last two. You can handle all of your settings on the audio source itself.
But are you suggesting I do that and use a different curve? Like a linear falloff? Or are you saying that just checking that box all by itself will make it louder?
Yep just check that box
Okay I'll reset my near values to 0 and give that a shot and see what it sounds like.
But you said leave all values the default Does that include the gain?
Just right click the component title and hit Reset Values and check Use Curves and you're good.
Yep
Okay I'll give it a shot now.
Been a while since I dug into network stuff. Also never used OnDeserialization. This is doing what I want but am I making any obvious errors?
Main goal is to have "Name" (which is a synced string) be set for other players before setting the text
@cunning mist Well, it's certainly louder now, but there's no falloff at all. It's as loud 50 meters away from the source as it is right next to it.
Those are the settings I used.
Oh you still have it set to 2D, missed that.
Grab the 2D slider and drag it all the way to 3D.
Also put doppler level at 0 that's the worst default setting in Unity
What 2D slider?
Spatial Blend
Ohhh
Hi, I'm not sure if this is a udon solution I need or not, but I've been porting assets from a game I've been permission to put in VRChat, and I've been learning how to setup UI stuff. I want the ui to face the player at all times, so I've been using a Billboard shader to do that, and that has worked so far, except when i realized that the hitbox of the buttons stays where it originally is and doesn't move with the shader, I had originally tried rotating these objects with Udon behavior, but I haven't gotten super far into learning it despite jamming a hundred tutorials into my head. What would the easiest way to rotate a gameobject to face the players position?
I've never even touched that before. But I'll give that a shot. And why's doppler bad? That's how sound works in real life! But it is pointless here...
Doppler is pointless in 99% of the use cases you have in VRChat, let alone Unity. It's like having Auto-Lightbake on.
Sure but... I've never noticed it so why bother disabling it?
The quickest way would be Transform.LookAt(PlayerHeadPositionThing)
It might actually do nothing in vrc, I don't recall
The Doppler, that is.
is transform.lookat in udon behavior, a udonsharp, or default udon, C#?
You can use either Graph or U#, both are fine 👍
ok so it's a udon behavior, sweet, I'll look into that, thanks for the tutorials and help!
If you're working to convert a preexisting game, it may be an easier transition to use UdonSharp since you have the preexisting script it used.
A lot of the code from said game won't quite work in VRChat, so I'm building a lot from the ground-up in terms of functionality
OH, question while I'm here as well
Tracking the players position. I've had trouble getting those gameobjects working in Unity, the prefabs at least. And by that I mean the gameobjects that follow the player and report their position, how would I go about setting that up consistently?
@cunning mist Now I hear nothing at all no matter how close I get to the audio source.
Your curve graph is a bit funky, try swapping it to Linear and then back to logarithmic. Either that, or set it to Linear and add your own falloff points
It remains the same when I do that. I can make the curve less extreme by setting the minimum distance to something a little greater than 0 though.
Yeah just go ahead and set the curve manually
The min distance is the distance at which it starts to get quieter, not when you start hearing it. I believe this defaults to 1.
@cunning mist Yes I understand that that's where it begins to fall off. If that value is too large then you don't get good sound spatialization. I'm not sure what the default is, but VRChat I believe reccomends you have it set to 0 for realism. At least the version of it on their script, the near radius.
I'm not sure what the Unity default is though, I'm building a new test version now.
Okay so you're correct in that it does default to 1 which is why my falloff looked odd to you.
Well the custom curve was pretty good, but I'm gonna try and go back to the logarithmic but with a near distance of between 0.1 to 1m and see if I can do better that way. The curve I made just didn't fall off rapidly and smoothly enough in the distance to sound right. But it's definitely fixed the issue of the sound being way too quiet up close, so thanks for that!
In other news... I've got an object I don't want to render in a camera view. But it's a static object that the player needs to be able to jump on. I'm thinking if I have to I might be able to have two copies of the object, one invisible that's just for collisions on the usual layer, and another which is visible but is on some layer I can opt not to have the camera I have producing a rendertexture show. Also I just remembered I want to hide the user interface or at least the user's photo camera from that camera... gotta figure out what layer that is...
Hm... I see a UI layer but I don't know if that's VRChat's menus or Unity UI stuff... There's also a UIMenu layer... maybe that's it...
ok so I have this setup, trying to get the ui layer rotating to face the player, not working
also uh, ui layer is the layer that the mic overlay is on and it shouldn't be interactable
i think
Hm... Maybe I could set the object to TransparentFX? This site says that collides with everything the default does... I don't know of anything else that uses that layer, so I think I could hide it from the render camera safely? http://vrchat.wikidot.com/worlds:layers
Use VRCPlayerApi -> GetTrackingData (Head) -> get position
Attach that to the Transform -> LookAt input.
Then if it's looking the wrong way (away from the player), you'll need to call Transform -> Rotate (0, 180, 0) to flip it around.
oh sweet, let me give it a shot
are the update loop and recttransform setup right though?
Yea. Update is fine if you want the object to constantly look at the player as they move around. RectTransform is just an extension of the regular Transform, so that'll work fine.
alright, this still isn't working, does it track in desktop mode or only in vr?
TrackingData (Head) always exists on all platforms. It represents the "view position" of the player (aka the game camera).
a, so this is probably something I set up wrong in regards to something else then
You need to pass in Networking -> get LocalPlayer into the tracking data input
Perfect, that was it, thank you so much
One more question, do i need to disable these scripts when they aren't running? I just hope they don't cause too much performance drain, I mean
Something like that should be very minimal impact in a technical sense, but in general it's good to offer players some way of toggling UIs, especially ones that move, though not a requirement.
Depends on the use case mostly
that's what I'm doing for this, the ui's fade in and out of existience, I just need to make sure they get hidden from rendering I guess
ok, sorry for being a knob, but how do I get the vector3 back out of this after it goes in?
In the drop down, there should be an option with just a (Vector3) on it
how would I get a vector out of this with +180 on x if the option goes away when I plug in position?
Then set the Y axis to 180 and attach your gemtext instance to it
wait, this is position not rotation
Then hook up the white arrow noodles so look at is first, then followed by Rotate
Don't hook anything up to the Vecto3 input of Rotate
input the literal value of 180 into the Y axis box
oh, oh, so rotate AFTERWARDS
Yes, but you still need to have gemtext hooked up to LookAt as well.
gotcha gotcha
But that should be it
yup that seems to be working, thanks again for the help !
👍
Do you have an example of this actually? I'm not sure exactly how to go about it
The only think I can think of is to loop through every player on update and check if they're in the bounds but that seems hefty
Android can't send files
Uhh
Search the discord for walkable
And you'll see where I put it in #udon-showoff
Make sure you use networking get local player instead of the initialization variable or the only one stationary will be you lmao!
ahh walkable blimp?
this is pretty close to how I was thinking about it. Guess I gotta get less shy about putting stuff in update. I'll worry about it once it starts slowing down lol
Just wondering what version of unity works with skd3? Still only the 2018?
the same version that VRchat is literally built on
2018.4.20f1
Thought so thanks :)
I'm trying to have Sphere be active only within the trigger collider on this object the script is on. What am i missing? 🤔 🤔
*only when ANOTHER collider hits this object
preferably a specific collider
basically i'm making a crayon that draws only when it touches the paper. so I have a thin collider on the surface of the paper, and I only want the tiny object that has the trail emitter on it to be active when the other collider on the tip of the crayon is within that thin collider on the surface
im new to udon so this probably has a simple answer but
when i send a custom event it only works in the graph that it was sent from and not any other graphs
Events are not global across all UdonBehaviours. You have to specify a behaviour, if you dont it implicitly assumes you mean the one that you're sending the event from.
how would you go about specifying a behaviour? im assuming thats what the instance connector is for
Yes. You need to provide it with a reference. The easiest way to get a reference in Unity is to declare a public variable, then you can drag'n'drop the object into a field in the Inspector.
i now have the SendCustomEvent setup like this:
but the graph on doorway still isnt detecting the event 🤷
im getting this error without any further context :/
In the inspector, did you add the graph to the UdonBehavior component's udon program source slot?
👌
are you trying to get a reference to itself then?
nope, i have two separate graphs that im trying to get to reference one another
Try creating a public variable of UdonBehavior type and plug your target script component into that.
while that seems promising when i do that i get this in the console:
for what ever reason the solution was to duplicate the graphs, delete the old ones, and reset the variables :|
thanks for the help (thats not sarcasm)
?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...
It's in alpha, too, so actually there is a lot left undon about it too
Alright, I have a serious blocker that's stopping me from doing any work on any of my worlds. I can't stop playing Valheim. Send help.
Hello, Good evening, I would like to make a button that just activates an empty, I don't want its to be a toggle, just activate an empty, do you know how to do it please? i have looked in udon sharp but it only offers a prefab toggle
Does anyone know how to make a vrc trigger using the udon scripts? QwQ I am trying to make button toggles in my world with the UI buttons. but it doesn't have vrc triggers like 2.0 so I'm not sure what to do
You already have a loan toggle button in udon sharp, if you don't have udon sharp here is the download link https://github.com/MerlinVR/UdonSharp/releases
@scarlet lake
Thankies owo
Hello! I'm pretty new to Udon and map creation in VRchat.
I want to create a button in Udon that resets a bottles position to it's original position. Is that too hard? D: Help
np. I kinda passed out shortly after my last response.
Can someone please help me figure this error out? it is causing my mirrors to stop working after a certain period of time
Hello i'm wondering if anyone has made fireworks for SDK3 , i know there is a SDK2 version of it, been trying to look around
pls ? 😥 #udon-general message
What I mean is that this example you sent me disables an empty?
as in an empty game object?
Yes. it enables.
It checks to see if the state is enabled. If it isn't, then it will enable it.
It's a one way toggle.
It won't ever disable it.
Nice perfect
In the Start event, store the original position and rotation of the target object (bottle in this case). Then on interact (or whatever event), update the position and rotation to the origin. Gotta make sure the person updating the transform data owns the object though in case position sync is enabled, so the SetOwner method is called just before doing so.
Holy moly, thanks for the help!!! :OO I got a question though.. How do i get the "Set OriginPos"?
Drag the variable of originPos into the main grid while holding CTRL.
Think im stupid, but could you show me where? cause i can't find it :(((
how do i call a function from one udonsharp script to another? ive got a variable i want to pass between scripts and i cant figure out how to use setprogramvariable
You dont. The point of UdonSharp is to emulate the behaviour of C# in Udon. You do exactly the same thing with an UdonSharpBehaviour as with a MonoBehaviour to call methods and pass arguments.
Ye okay, just dont know how to get those two variables. I pretty much only know how to get the transform
Gonna be pedantic and say it IS possible, but unnecessary and antithetical to what U# can do.
Yeah. But you would be doing exactly what UdonSharp does for you. Thats just redundant, and makes life harder for yourself.
Unless you want to be able to support inputs from both udon sharp and udon graph scripts. But that's for more complex prefabs, like a pub/sub system.
But yea, like I said, antithetical to U#'s featureset.
Like so?
... Jesus, sorry... still learning 😛 Wish i could give you something back
pls read #avatar-search-old
No worries mate. It's a learning curve. We are here to support each other in that process.
People will read it if they want to. Please keep this channel to udon stuff only.
srry if theres a typo bt
k
Can i ever DM you if i need more help?
I'll send you my asset server link. I'm most active over there.
I try to avoid too many DMs, as I want the knowledge that is learned through discussions to be available to others as well so they can learn from it or help out.
Alright, not sure what the problem is but the button doesn't work. I tried to make a test cube and use the "test cubes" transform position but that doesn't work either
Inbetween the event and for loop, do a boolean check (Branch node) for PlayerApi -> IsLocal and connect the event output to the islocal input.
I'll check on this is a bit. Taking care of something else atm.
thank you very much, gonna try :)
hey...
im back with another question
currently both of my udon programs arent being executed properly and i end up getting this in the console: "Program execution time exceeded max VM time of 10 seconds. You may want to check for infinite loops/recursion."
the problem is that one of the programs is designed to disable itself once it completes its task and the other program is meant to constantly loop until the other programs finish. does anybody know of a potential solution to these issue's
the other program is meant to constantly loop until the other programs finish
You shouldn't need to do anything like this. Can you post a picture of this graph and say a little about what you're trying to use it for?
An event shouldn't take forever to finish. You need to finish your event as quickly as possible and not hold off on letting it finish. If you need something to constantly check, make it poll.
im attempting to make a rudimentary procedural generation system, each room has an empty gameobject at each door way with a program to create another room, i also have another program which counts how many rooms have been created and prevents any more from being created once the limit has been reached, the limit being 15 for now
this is the doorway program:
and this is the room counter program
could you explain what "poll" means?
polling is a fancy way of saying "every some interval, check to see if the state of something matches a condition"
Since the Update loop already exists an an interval, all you need to do is have an if statement (branch node) to specify the condition, and only execute logic based on you desired true/false check.
Another, more complex, side of it could be that your generator logic is just a very heavy section of code, which could benefit from generating X parts of the whole per update frame. Then have a flag the declares if the generator is done to run whatever logic to apply the changes based on the result of the generator.
will an udongraph node CustomEvent be able to listen for a udonsharp sendcustomnetworkevent?
Simple answer: yes
Complex answer: as long as it is done correctly.
thats kinda what ive been doing
except now ive changed it to a branch instead of while
i still seem to be getting the same error 🤷
how do you use a vrc speciallayer on the udon sdk? it doesn't seem to have it ;w;
And I want it so that people don't collide with pickups
Are the pickups kinematic?
They aren't
They have gravity
The pickups and it's children are also all set to the pickup layer
I managed to get it working!
Is PlayHaptics in Udon#?
ye
one more and hopefully last question,
how would i go about creating a nand gate in the graph?
thank you very much, i didnt even know those nodes existed
They are the "textified" equivalents of the && and the ! operators on bools
i have decided to switch to udonsharp and it has been much easier to work with.
i have one hopefully simple question, how do you reference a udon# behaviour?
Udon needs some cable management
🤔
depends on context. most times just referencing the type directly works as intended.
im trying to reference a public class on another behaviour
yes. referencing the type (aka class) should work.
if you have more u# questions, you can ask on the u# discord linked on this page https://github.com/MerlinVR/UdonSharp/wiki
thank you very much
Is there a way to get Udon not to do this? It makes it hard to enter data when I can't even read half the object names no matter how wide I make the inspector. It's the Udon section causing this cause when I minimize it the rest of the inspector looks normal again.
It seems its just the arrays which have this issue. I tried restarting Unity and creating a second Udon graph on another object and it's fine until I add a public array of any type. Then the data entry fields look like that.
Is that with the latest SDK? Fixed up array inspectors a few releases ago
Also I just discovered that merely renaming my array variable erases all the data I just entered into it...
@floral dove Hm... I'll check I'm not sure if I do.
Actually how do I tell what version of the SDK I have installed?
There should be a version.txt
2020.12.16.43... I assume that's old. I'll grab the latest.
Make sure to backup / commit first
Commit what?
If you're referring to some kinda cloud backup system for Unity I've never used that, but I'll make a backup to be safe. 🙂
Oh yeah, if you use git for version control you'd make a commit.
But a backup works just as well 👍
Ah, one of these days I should probably figure out how Git works. But I don't even like using their website... it's always confusing to navigate.
It's got a learning curve, yeah. But it's super worth it once you have a lot of projects and libraries that you reuse
What's the best documentation for making a world? I've tried youtube, but they are all SDK2.
i'm actually in the middle of figuring this out and the thing is, they call SDK3 "Udon" even tho on the website it says Udon is a programming language for vrchat worlds, it's confusing, but if u search vrchat Udon on youtube you'll find a tut series by VRchat themselves.
and my question for here is, i'm watching the tut and it says in the unity hub that you can select what modules you want, i don't have that option tho??
ah google saved me
There's a little "Collab" button above the inspector. Unity gives you 15gb storage for free, and can even add two other unity accounts to download/upload the project to work together.
I just use it as personal cloud backups
Otherwise it's simliar to git - actually I believe it is secretly git.
i'm trying to make it so that when a specific object is inside the collider, Sphere is active. But how do I tell it WHICH object needs to enter the collider?
im my prefabs i have a key/lock example. same concept.
Terrific!! Thanks so much! 😄 @raven peak
i haven't developed for vr chat in about 6 months. Can someone please remind me the best way to update SK3?
nevermind
why is it greyed out
smh why does this always have to be such a problem
your game depends on people making stuff for it, so why are the tutorials outdated and the programs inconsistent
cus its constantly evolving and everything is broken/ and or subject to change
it can all be improved and slowly is being improved
so stuff isnt gonna work forever
they could push out tutorial videos for everything you want but it would likely be outdated within a few months
which is why its nice that theres a shit ton of people who figure things out together and some post their own tutorials! dont be a dick we're all confused XD
It's alpha
fAssets\VRCSDK\SDK3\Runtime\UnityEventFilter.cs(1016,32): error CS0103: The name 'Cinemachine' does not exist in the current context
what's up with this error anyone know
?
Assets\VRCSDK\SDK3\Runtime\UnityEventFilter.cs(1013,24): error CS0246: The type or namespace name 'Cinemachine' could not be found (are you missing a using directive or an assembly reference?)
restart unity
I don't remember why that happens
but the solution is either to restart unity or reimport the SDK
Folks I need some big boy skills:
I need to make a teleprompter and I don't know how to put a text file in my project and have a script get the text file line by line and display that on a uitext. Haven't got the first clue how to do that so if you have any examples please show code.
I'm thinking I need to get the first I guess 5 lines of the text file and put them as strings, and then display them in the UI text like that
and scroll it
hey i need help making pvp in my world can some one help me with that i never touched coding or udon before and i wanna know how it works so i can use it
download any example project and see how it works
Anyone know if it's possible to get particle positions/particle intersections?
Hello i made a Array in U# to Instantiate random cards to their count but its only local and the button is only master. Where do i put the Networking in so its Synced to other player?
also the Values needs to be synced
The major thing to note is that VRCInstantiate is not yet networked, so it only spawns locally and cannot do sync logic on spawned objects.
You'd want to switch to an object pool method where all possible cards exist ahead of time and the position/visibility is updated via sync somehow.
Does using constraints with Udon pickups affect syncing? I have an object I want players to drag across the ground but not lift up, so I used position and rotation constraints to an unmoving gameobject:
problem is, its position doesn't seem to sync half the time, and the movement itself is very stuttered and laggy
half the time in testing other players couldn't even move it after grabbing
If you are using constraints on a synced object, only the owner of the object should have the constraints enabled. Everyone else will ignore the synced position and use the constraint value (which is local) instead.
Copy that, thanks!
< This guy is so ready for networked arrays so I can set up networked object pools in 2 seconds flat lol
in yeet world people can grab each other, everyone
but it doesn't work for me, i don't know why
there someone else who have to the problem than me too
you should probs ask the other people in the world how they got it working
they just came and it worked
i have some heaver questions about instantiate and how it can be used, for instance if used vea start event will it spawn one locally for each player as they join or spawn one globally for each player that joins, and if not the global i can use networked events to trigger it in such a way or use onplayerjoin, idk which would be more stable?
FYI the upcoming networking update has an Object Pool component too 😉
So, my VRC whites out and stops responding when I launch "build & Test" in VR mode, so the only way for me to test my world in-VR is to publish to VRC and load in actually in-game (which is just a bit of extra work :/ )
Is this a known bug people have dealt with and fixed before?
that just sounds like normal unity
So that's a normal bug and it's broken for everyone?
Well it just started happening in the last few days, cuz testing worked fine until recently :(
i mean, imo its annoying but most unity projects will do that. I don’t know why its not doing it when you b&p but id assume the “not responding” phase would be more unnoticible
Yeah I still get some frame jitters when I load in in-game, but they last like 5 seconds
Whereas VRC completely whites out and freezes permanently when launching in straight from unity
hmm, is your vrc updated? do you let vrc have its ”minute”?
I have left it open for far longer than it takes to load in normally, yeah
And it works fine when I'm not in VR
If I turn on the tickbox to force desktop mode, it works fine
IT specifically freezes when building and testing in VR
could be a bug, could also just be because youre wanting to boot up in VR thats causing it to need more time
Hey so I had an Oculus account on a VR set which I’m going to sell because it’s not working properly, does anyone know if I can merge the account or log in to it?
I have the Oculus Quest 2 by the way
Cause I bought a new one and I want to play on that one but idk if I can log in via oculus accounts
try #user-support-old - this channel is for questions about our programming language Udon
Oh okay, my apologies
for the qvpens, be sure to use the quest compatible shader on the booth page.
Are the docs for https://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html correct? I have a disk drive, and a floppy the player can pick up. The disk drive is part of the world, and I was gonna put a box collider on the front of it with IsTrigger checked. The floppy itself however is a physical object with a rigidbody, so it will collide with the world and the drive, but not the trigger at the slot of the drive. Now, this seems pretty straightforward to me and that I put my script on my floppy drive trigger collider, and it detects what object entered that trigger zone and then it does its thing with it.
However, the docs state that "One must have Collider.isTrigger enabled, and contain a Rigidbody." which makes no sense to me, because why would my trigger volume which is static, need to have a rigidbody? Are the docs just wrong here and/or poorly worded, and in reality I need ONE object to have IsTrigger, and the object that is to trigger it needs to have a rigidbody? Or does the rigidbody actually have to be on the object with the trigger volume?
Ooohhh i will make sure I've done that. Thanks! :)
The docs are correct. https://docs.unity3d.com/Manual/CollidersOverview.html has a more detailed explanation of collider interactions and when they send events. One of the colliders out of the two must have a rigidbody, if one of the objects is static and the other is moving, you would put the rigidbody on the moving object. Generally speaking, all moving objects with colliders should have a rigidbody on them since it helps the physics system update them more efficiently.
I'm struggling figuring this out... how am I supposed to get the "playerHead" TrackingData object's transform.forward direction equivalent if you're only capable of extracting its position and rotation as Vector3s and not as a Transform?
does putting a rigidbody with a collider on it inside a trigger collider make the rigidbody not collide with terrain? Because sometimes it goes right through the ground...
and I have a physicmaterial and set it to bounce
I also want to know this
@paper plinth I think it's just the trackingData object's rotation * vector3.forward
I had a hell of a time trying to use the head for a lot of things
Quaternion math is evil. If just taking the rotation times vector3.forward works than I will be very happy
so get the eulerangles of the head and multiply by vector3.forward?
Nope, use the quaternion
quaternion rotation * vector3.forward = object's forward
I'm using it to compare the player's hand rotation with their head, to see if they're holding their hand palm-forward, but I don't think I can just stop there because I'm pretty sure setting an object's rotation to your hand's rotation makes its like pointing in the top-left of your hand because bones are weird
Why can't I use Friday night funkin avatars on pc?
read through the #faq to read about where to get help for different issues. This channel is for our programming language, Udon.
I've had a hell of a time in general setting object rotation to bone rotation at all so I hope you show graph or show code. Do you know how to get head tilt left and right? Because I was trying to bind the angle of head tilt to rotation of a speeder to get the star wars effect where you lean to one side or the other to steer and I gave up.
here's how you'd get the z-axis rotation of a player's head:
having a issue right now where only the master of the world can interact with object
More details?
I have a GameObject[] which I'm checking distances if they are close enough and then I want to save if it has been close enough for each one of them. How would I go about that?
the only idea that currently pops is to make it into an array and increment it (i++) but I assume there is better way than that
The docs are correct. One of the colliders out of the two must have a rigidbody, if one of the objects is static and the other is moving, you would put the rigidbody on the moving object.
But that's not what the docs say. They say:
Both GameObjects must contain a Collider component. One must have Collider.isTrigger enabled, and contain a Rigidbody. If both GameObjects have Collider.isTrigger enabled, no collision happens. The same applies when both GameObjects do not have a Rigidbody component.
If one object MUST have IsTrigger AND contain a rigidbody, and both cannot have isTrigger, that implies if I have a static object with no mesh and a trigger collider on it, it MUST have a rigidbody... Which makes no sense for something which has no mesh and cannot move.
Clearly though, that cannot be right, and I'll have a look at the link you provided to see the more in depth explanation of collisions.
Well now I'm even more convinced that other page is wrong...
Here you can see under "Trigger messages sent upon collision" that it says a static collider with istrigger, will collide with a rigidbody even if that rigidbody also has istrigger enabled. Which the other page said was impossible: "If both GameObjects have Collider.isTrigger enabled, no collision happens." So it seems like the other page was written under the assumption both objects would be dynamic.
Um... then again, this matrix says a trigger message IS sent if two Rigidbodies with IsTrigger collide? So... I guess that other page is just completely bonkers?
Jeez, based on that matrix it seems like the only time a trigger message ISN'T sent is when you don't have IsTrigger on either object, which makes perfect sense, or if both objects are static and one has IsTrigger, which also makes sense because two static colliders would either always be colliding or never collide. But in any of the combinations of static and dynamic objects colliding or dynamic objects colliding, it doesn't seem to matter at all if both have IsTrigger, which goes directly against what the other page says about that being forbidden. So either this grid is somewhat wrong, or the other page is completely wrong.
it says no collision happens, which is correct. Collision != trigger
Well yes, a collision != trigger... but in context:
"OnTriggerEnter happens on the FixedUpdate function when two GameObjects collide."
They seem to be using the term "collision" loosely here, because OnTrigger happens even when a collision does not actually occur, unless they're using two different defintions for "collision" in the same page, where one means two objects overlapping, and the other means a physical collision where they can't interpenetrate and a collsion occurs.
I mean if you look at this:
Then if we are to use that definition for "collision" then "OnTriggerEnter happens on the FixedUpdate function when two GameObjects collide." cannot be right because that matrix shows one object will never "collide" with another that has IsTrigger enabled.
So perhaps they should have said: "OnTriggerEnter happens on the FixedUpdate function when two GameObjects intersect."
Though that is still not clear enough. I would have written: OnTriggerEnter happens on the FixedUpdate function when the colliders of two GameObjects intersect."
I don't know what issue you have here, the docs may be a little weird but the collision matrix makes it very clear exactly how everything interacts
There are times the docs are wrong, this is not one of those
Well my issue was I wasted a good hour because the docs are bad and I was confused about how to make what I wanted to work work because of that. 🙂
So you're still telling me the docs aren't wrong when I just showed you how they're clearly contradictory?
they aren't?
"OnTriggerEnter happens on the FixedUpdate function when two GameObjects collide."
What is a collision?
Is it when two objects bounce off one another? Or when two objects interpenetrate?
If it's when they bounce off one another, then that sentence cannot be true, because according to this if one object has IsTrigger enabled, they will not bounce off one another:
And "collision" is when they interpenetrate then "If both GameObjects have Collider.isTrigger enabled, no collision happens." cannot be true because this matrix shows that IsTrigger will be be called regardless of if both have Trigger enabled:
The docs are wrong because they're using two different conflicting definitions for "collision". If we choose only one definition for what a collision is then one of those two sentences is wrong.
Well sure... If I assume THAT is the correct part of the documentation, but without a third source of information that's not a good assumption to make, but probably the correct one?
This is why they had THREE guidance computers on Apollo. 🙂
If you are so concerned about the documentation being incorrect, you can test it yourself. It'd take far less time to test it than you said you took looking for the behavior.The collision matrices are the accurate part and this is quite common Unity stuff so someone else would've noted it and had the matrices fixed.
I agree the matrix is probably correct, I was just expressing frustration over the other page which is the one that documents the command I was using having unclear instructions and no link to that page you provided. Could I have simply tested it to discover what works? Sure. Does that excuse the poor documentation of Unity? No. 🙂
Anyway enough about collisions! I spent way too much time on the simplest part of a much more complicated problem...
What I'm trying to achieve here is I have a disk drive and floppy disks. Each floppy disk, when touched to the trigger collider on the floppy drive, needs to trigger a video player to play a specific URL. I already have arrays of the objects and their associated URLs for the floppies on the floppy drive... And in theory it ought to be easy to determine what URL to play... except I need this all to be synced for other players.
So I'm now stuck trying to figure out how to sync this up over the network. Do I check to see if the player running the script is the master, and have only the master detect when these collisions occur? That seems like the easiest method, though perhaps not the most responsive, if the master has a high ping or the player has a high ping and they don't see their action create a result instantly. Also I'm not even sure yet how I would have the master tell the other players which URL to play. I can't send an event with a parameter, so I guess I'd have to use a sync'd variable and set it to -1 when nothing is playing maybe, and otherwise send the index into the URL array, assuming I can even get that somehow?
I wonder... how reliably are synced variables synced? Like, if I allow ANY player to set the synced variable when they detect that trigger... And multiple players set it at the same time... Will they eventually all automatically sync that value up? I don't know.
I also believe there's a limiter on how often a player can set a URL for a video player, which could screw up syncing if several players try to change the URL at the same time by changing this synced variable and I try to update the other player's URLs and some of them fail...
I suppose I should start by looking at the SyncedVideoPlayer Udon example and... oh my god. I hope I can just make use of this without having to replicate it to sync up my URLs, it looks pretty complicated!
"Load new video when _VideoNumber is changed" ... ooh, maybe I can make use of this to do exactly what I want without too much modification? But what is VideoNumber? I don't see an array in here...
Oof. It seems like VideoNumber is just an integer which is incremented each time a new URL is specified. Hm...
Hm...
Wouldn't that disable loop every time the video player starts even if you have it checked... Oh wait. I seem to recall some documentation somewhere about looping not being supported on synced players yet?
Hmm... This code uses a URL entry field to allow the owner to change the URL. But I could input a URL from my URL array. However... to make this work, I need some way to first make the player who touched the floppy disk to the trigger volume the owner of the video player. And I don't know under what circumstances a player becomes an owner of an object. There's a "transfer ownership on collision" field, but I don't know that an object being held by the player triggering a trigger collider on the video player would constitute something that would transfer ownership to them...
I'm new to making content in Unity and VRchat, and I'd like to use the Udon graph editor but I cannot get past the "Welcome" screen, how would I do this?
Have you added an Udon Behavior to an object? If you have done that, there's a button to create a new grph, program, or assembly, but I think it defaults to program, and you'll want to change that to graph and then you can open the graph from there once you make a new one.
Aah okay, good to know!
private bool[] hasSoundPlayed = new bool[4];
bool default to false iirc.
Does anyone know? Using SendCustomNetworkEvent target to All in the function to add one to the synchronization variable, is there a problem with the variable value of the client?
Why sometimes it happens, master value from 0=>1, client from 0=>1, sometimes it happens repeatedly increase master value from 0=>1, client from 1=>2
Is it because the setowner is delaying the synchronization variable?
For having anyone update a sync var value by some finite value (increment in this case), you'd use Owner instead of All. If the variable was unsynced, then All would make sense.
hola
Not sure what you are asking, but this channel is for udon specific stuff.
Is there any way to set an object to the position & rotation of the RightHand TrackingData without it being offset weirdly in rotation?
Because I've noticed that setting an object's rotation to the right hand's makes its "forward" direction point somewhere between Y+ and X-, basically straight diagonal
I attempted to convert the rotation of the bone to euler angles then apply an offset manually before applying that rotation to the object, but the complicated relationship between quaternions and eulers made that thing spin so weirdly
I think the actual rotation of the transform is going to vary from avatar to avatar
maybe you can align the rotation to world rotation plus an offset?
I don't know how avatars work
id like to know an answer to zerithax question as well. as ive seen avatars bones be twisted 180 degrees. so whatever bonetracking is done is usually off
You can rotate a quaternion using degrees. First you can set up a euler and then convert it to a quaternion, then after that you can just multiply the original quaternion by the offset quaternion. One thing to note is that they're not commutative, so you want the orginial quaternion first to then multiply it by the offset one, otherwise you'll get unexpected angles. E.g; OffsetQuaternion = OriginalQuaternion * Quaternion.Euler(45,0,0);
what is an "if" function called in graph?
The equivalent is the "Branch" node.
how would i do if(var name == plr.displayname){}
with the branch node?
this is what im doing
I believe you're looking for "String.Equality"
Just drag out of LocalPlayer and search DisplayName, then plug that and your current "Name" variable into that last branch.
Right now you're getting the entire array of all of your names and seeing if that array is equal to the entire PlayerAPI, which might cause some problems haha
If you want to know more about For loops in Udon, I went over them in this tutorial:
https://youtu.be/y-YSWkJtutI
- Check out https://tryuniverse.com/ and use the code VOWGAN to get $50 off when you enroll. *
Enabling and disabling large numbers of objects all at once is pretty easy, and here I do so using Colliders for a set of couches. All assets are available on my Patreon if you'd like to have access to anything I made during or before the video.
00:0...
ok thanks
I won't use that bc I don't make games but thanks
Hello peoples! I am interested in a concept I saw in a recent VRChat world I visited where there was a mirror on the wall, but it didn't exist until I walked up to it. By using PlayerToggle behavior scripts and linking it to a mirror I was able to make the mirror turn on when you stand in front of it by entering the toggle zone (area in front of the mirror), but I can't figure out how they were able to animate the mirror being "revealed".
It opened and closed like a garage door, but if I stopped halfway it would also stop so it wasn't a single animation. Possibly multiple playertoggle boxes on the floor? Never seen anything like it, but it was amazing to look at and watch
That's pretty creative
Right? I like the area underneath turning the mirror on vs a button already, but have never tried animations before
So I've been looking at the video player code again today and I've got a question. Am I understanding this right? Can I just create a trigger somewhere in the world which calls SendCustomEvent("OnURLChanged") and then the owner of the video player, whoever that is... (I assume the master if nobody else has interacted with it and I'm going to disable the interface on because I'm having users select videos by sticking floppies in a drive, so nobody else should be interacting with it) will then execute the script to queue the video and sync it all up and I won't need to do anything else?
Can't find anything as a reference
@restive ridge Kinda sounds like they tied the rotation of the mirror to the player's distance from it and disabled the mirror when they were beyond the max distance. The math isn't too complicated. Assuming this was made i n Udon it shouldn't be too hard to implement.
That would be a custom shader they had for the mirror, not sure where you could find it.
Unless of course I'm misunderstanding what you mean by "garage door". I've seen mirrors that do reveal things with shaders but also ones that fold up like a single-piece garage door rather than the roll up ones.
However if you want to go the shader route., there are these ones on Patreon which kinda function how you describe: https://www.patreon.com/posts/ultimate-mirror-37481376
Imagine the mirror is static
and as you walk away from it, the top of the mirror gets replaced by an animation as if it's closing from the top down to eventually be like nothing is there
The mirrors in the patreon I linked function kinda like that, though they open sideways in the examples.
let me check those out
Oh wait no there's one that opens vertically.
Oh yeah I see! The one on the right is similar
They also made a fantastic looking water shader which is why I signed up for their patreon originally.
Yeah the "Choose any shape" section has it exactly like what I saw
Thank you! I will definitely check these out
I'd try and help with the videoplayer question you have, but i'm still pretty green with Udon atm and haven't played with the video stuff at all yet
You can use SendCustomNetworkEvent to call "OnURLChanged", targeting the Owner of the video player. They will receive this event and the graph will fire on their machine. However - you still need to get the new url or id to the owner of the video player.
however, if you instead put a collider on the floppy, and sync its position, then you can have the video player listen for a CollisionEnter or TriggerEnter event, check if the current player is the owner, then check if the collider is a floppy, and if both of those are true, you can use GetProgramVariable to extract a VRCUrl from the floppy and use that to change the video on the player, which will then sync to the other users.
Hi, dumb question, I'm trying to put up some avatar pedestals in my first world and they show up with pictures of the avatar fine, but they can't be clicked on/interacted with. What am I missing?
take a look at the example pedestal in the UdonExampleScene and add the UdonBehaviour and program that one has
Hi guys can someone tell me how to install my avatars in vr chat I can't understand from YouTube videos
visit #faq to learn where to ask your question - this channel is for questions about Udon, our programming language
float.multiplication
thx
which means just do it lol
there's a function for that in a PLC and it's super handy
how would you want it to work differently?
input the float and the top and bottom numbers
4 to 20 ma becomes whatever you want
aha - you probably want Mathf.InverseLerp
you are correct thanks
It can be combined with Mathf.Lerp to scale a number from one range to another
ie - use Lerp to normalize your input to (0,1), then use InverseLerp to scale it up to your new range
super handy
I will be scaling the output of a dial
and not the 0 to 360 dial, the complicated one
that one is float.multiplication lmao
So like this?
- Have a trigger volume on the floppy drive.
- Have a collider on the floppy to interact with this trigger.
- Have the floppy itself have an Udon graph with a variable that contains the URL for that floppy.
- When a trigger from a floppy is detected in the trigger's Udon graph, use GetProgramVariable to extract the VRCUrl from the floppy.
(Not sure the best way to tell if the object in question is a floppy but I'm guessing GetProgramVariable will return Null if the program variable doesn't exist on that object so that might be the most direct method.) - Have the trigger volume on the floppy drive SendCustomNetworkEvent("OnURLChanged") passing the new URL to Value for _SyncedUrl.
- OR, edit the videoplayer script, put the videoplayer stuff on the object with the trigger volume, and replace the node that looks for that event with one that looks for the trigger instead, and again pass the URL to Value for _SyncedUrl.
And that should be it? I suppose doing #6 is better than #5 as it doesn't require me to send a network event unnecessarily. And since I'm gonna have to move all my URLs onto the floppies anyway there's no real reason to have a separate script for the trigger.
Btw, the original plan was going to be to have an array of objects and an array of URLs associated with them and then try to cross reference them when the trigger happened, though it occurred to me today that the trigger would not feed me back an array index for the object involved since I was not going to be iterating through the array to look for these collisions, so I was going to end up having to scan the whole array to find the matching object to the collision every time a collision happened and then use that index to look up my URL. But your idea is much better. 🙂
For detecting the floppy, you could check the name of the object, make sure they all start with "floppy" or something.
If the first thing you do when handling the collision is check if Networking.IsOwner on the floppy drive, then the rest of the graph can happen on just the owner and you don't have to send a custom network event. Just read the url, use SetProgramVariable to change it on the video player, then SendCustomEvent to the VideoPlayer to trigger OnURLChanged.
If the floppies are synced objects with colliders, everyone will fire the OnTriggerEnter event locally when it intersects, but only the Owner needs to respond to it.
I didn't know if that was ok
Occasionally it doesn't detect collisions and my cannonball falls right through the floor
I don't think that's the same issue but I check to see if the name of the target includes "target" before I let the collision magic happen
"use GetProgramVariable to extract the VRCUrl from the floppy. "
I assume there's a way to get the UdonBehavior on the floppy that triggered the collider to pass to GetProgramVariable?
And do I have to check if that is Null somehow?
And/or is there a way to instead compare the UdonBehavior pulled from the object that collided with the UdonBehavior on all floppies to see if they're the same? (Rather than checking the string for "floppy" which could also trigger on another object if it has the name floppy in it by accident.)
Because if they are the same, I know I have a floppy, and I know GetProgramVariable will be successful.
And also, if GetProgramVariable is not successful because the variable doesn't exist on that behavior, that returns Null, right?
GetComponent of type UdonBehaviour on the Floppy, check it using IsValid. You could put your floppy and drive on a new layer (above layer 20 for user layers I believe) and set your layer to only collide with itself to lessen the chance that it will happen on an unrelated object
Yes, I believe GetProgramVariable will return null if the target variable doesn't exist
Is there any node that allows us to freeze the player so that they wont budge?
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 floa...
Immobilize seems to be what you need.
Was looking over this earlier, however that doesn't prevent the player from moving as much as I'd need
Yeah immobilize doesnt immobilize at all
you can still jump, crouch, prone, respawn, be knocked around by physics objects acting on you and more.
"GetComponent of type UdonBehaviour on the Floppy, check it using IsValid."
This checks if the object has an UdonBehavior on it, but what I'm wondering is if it's possible to determine if an object has a specific UdonBehavior on it. In other words, Can I GetComponent on the UdonBehavior, and then see if that UdonBehavior = FloppyBehavior?
Obviously I can just look the name of the Floppy as you suggested before, but I'm just trying to learn about my options here. I could compare the object against an array of objects for example, though simply naming them all "Floppy -" is probably the easiest.
Sure, give it a try
When I asked if it was possible, what I meant is, I don't know how to handle that. Though it just occurred to me that I guess I could create a public variable and drag the Floppy behavior into that on the VideoPlayer and then compare against that? I'm not sure though if that will count as being the same object if I do such a comparison...
It's worth a try. I've never compared UdonBehaviours like that so I'm not 100% sure how it will work.
It doesn't work in U#, but maybe the graph editor has that functionality.
The best way around the limitation is to have a specifically-named variable in the Udon Behaviour, which you can check with GetProgramVariable (which either returns null or 0 depending on the type, if the variable name doesn't exist, as far as I've seen). If the variable exists, you've got the right behaviour type, if not, then no dice.
It's a hacky solution, but I guess that's what we have to do while Udon's filled in with more functionality.
U# does handle that, just do GetComponent<YourType>()
is there any UDON discords?
asking for a friend who got banned here for advertising a modded client apparently dispite never doing anything of the sort
and they have no idea where to go
question; WTF is 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...
Its also a type of noodle
but thats actual UDON not vrc udon
damn it now i am hungry
I name the parent object "targets" and check the name of the parent of the transform for the word "target"
what mirror reflect layers do i use to show only the skybox and all players? i tried "player" and "playerlocal" but it does not show myself. only the skybox
am i just dumb?
nvm i got it
answer should have been Player and MirrorReflection, not PlayerLocal
well what does playerlocal even do? cuz the mirror works how i want it now with player and mirror reflection but i also still have playerlocal
PlayerLocal is the first person view
So whenever you look down at your own body that's player local
It has the head squished down to not get in the way so it wouldn't work in mirrors
It used to be a problem where people had both mirror reflection and player local on in mirrors which was causing visual glitching because it overlapped the two bodies
So now it's just force disabled in mirrors
okay. well, another question then:
whats the difference in these two udonsyncplayers? theres one for Unity and one for AVPro. which one should i use? does it matter? cuz they both seem to perform the same
AVPro can play streams while Unity can't, and it also supports multiple audio sources, but AVPro tends to have issues at times depending on people's hardware and audio settings.
How does one take a screenshot of a portion of a graph or the entire graph? I can obviously screenshot what's in the Unity window, but some of my sections are longer than that and would require multiple screenshots. I thought I saw a means to have it save out an image of the selected nodes or the whole graph.
No built in method for that, sorry
Is there a way to check what the player's avatar's total bounds are?
No access to player avatars, sorry.
I figured there were cuz I thought there were worlds where people have set things to auto-scale based on an avatar's size
i use a program called lightshot. it overrides your pc's normal screenshot method and you can do custom edited screenshots
Which is what I'm after 🤔
Oh if you're looking for avatar size, just check the distance between the player's base and head position.
Is there any other way to look at how big a player is and tell something to scale based off their avatar's size so I can have things fit lolis and giants alike?
oh 🤔
Vector3.Distance(Networking.LocalPlayer.GetPosition(), Networking.LocalPlayer.GetTrackingData(TrackingDataType.Head).position);
Anyone see any obvious errors in my code here?
Specifically in the highlighted section.
If you want to fullscreen the graph window, press LeftShift + Space
It doesn't look bad to me, though getting a gameobject from a collider will always be valid, so you don't need to do that first check.
Basically what this is supposed to do is detect if a floppy touches a trigger. If it does, and the local player is the owner of the video player, then the code above extracts the VRCUrl Video variable from it's graph, and then inputs it into the synced video player to start it for everyone.
@cunning mist Well I heard IsValid doesn't just check for Null, but also for players who left the instance. I'm not sure why players that left the instances still exist, or why its important to check if you're not referencing one, but I thought maybe that could be an issue. But perhaps not.
That's if you're getting a player from an array of VRCPlayerAPIs, and then only if you're using the VRCPlayerAPI.IsValid version, since the Utilities.IsValid is for anything else.
OnTriggerEnter does not fire for players, instead we have OnPlayerTriggerEnter.
oh hey vow, on the topic of v3.distance, a well-versed programmer guy I know was telling me the other day that since V3.distance is using the pythagorean theorem and therefore square roots, it's actually more intense, and a replacement (albeit more complex) would be to get the inversetransformpoint of one object using the other as the parent, if I'm remembering correclty
I'm not sure if this is applicable to all situations where you're getting distance, but I believe it is
As I try to wrap my feeble mind around re-explaining something that was explained to me days ago
You're fine either way, though Vector3.Distance is typically fine if not used every frame haha
.> I love my distance checks in update lol
That makes more sense though, InverseTransformPoint is the better Distance check when checking at runtime
This is why wall occlussion for voices is annoying. Works fine for 10 people, but when you have a full instance uh oh
Audio occlusion would be fookin awesome tho
aw poo you can't do inverseTransformPoint without a transform and getting VRC player stuff only returns pos and rot
I have a setup for it, but it involves way too much raycasting and literally no smoothing. It will have to be redone if I ever want to release it.
sadness
Ah ha, that's why you have an empty transform object that you constantly set to follow those positions, THEN do those fancy things
that sounds horrible lol
Correct
You can probably figure out the exact height between head and base when swapping avatars if that's consistent, like if the player's head temporarily doesn't follow their body during avatar loading you could check for that exact distance, but then you'd have to be checking that constantly.
Yeah, that's why I asked. I was hoping for some sort of callback equivalent, but that's probably too much to ask for
Oh I guess callbacks are called events in unity 😛
I guess if all else fails I could just make a dang button that people have to press when they first load in/change their avatar so it recalculates their size
That's the typical setup. Have you been to Fax's Squat Racing world? They do a similar setup for calculating height for the squatting.
I have been to a very small number of worlds, so everything I've wanted to do, afaik, I'm the only person who's done it xD
@cunning mist Audio occlusion is an interesting topic. Seems like handling it might be similar to doing real time radiosity, cause like, a sound wave moiving out from a point source would be much like a point source light. Then figuring out how loud the sound is would be like finding the average brightness that a point sees maybe? Or perhaps it would be more like the 3D lightmap thing which the Bakery guy has been working on, and you'd just sample the one texel at the location of the ear in 3D space after doing the math?
Oh if you're planning anything beyond checking the one wall that's between you and the other person your computer is going to melt haha
Hey Vow, while we're here talking about complex stuff that's probably not possible, I've had one of many dreams since looooong long ago that I would like to ask about lol
Would it not be possible to literally reverse engineer the way a light works and create a "negative light" that does exactly what a light does, but detracting brightness instead of applying it, thus allowing you to make a light-taking torch instead of a light-giving torch, etc?
I've dreamt for a long af time of one day holding a torch that projects a lack of light onto things that are already lit
I think I saw someone on the Unity forums make something like that.
All my Udon stuff is just things I want to tinker with in VRC, and I know lights are expensive af, but maybe I should google around and see if I can literally just recreate a light component but tell it to take light away instead of adding it
That's probably pretty easy if you're a shader wizard. I don't know how that stuff works, but I imagine you'd just have a sphere that would do that sort of projection using shaders.
I am not a shader wizard, but the more I look at shaders, the more I feel like that's closer to my true calling than programming alone :P
This is less of a shader though, and more of a light itself
If a light says that it shoots rays that light triangles they hit as the lights/rays bounce around a room
A negative like should shoot rays that darken triangles they has as the negative lights/rays bounce around a room
For all intensive purposes, a negative light should in theory act exactly like a light game object, but removing instead of giving
Does anyone else have an issue with Udon graph being really slow to update when you have a lot of nodes like this player example? Like the example has like I dunno 50 nodes and when I go to drag a noodle, my activity circle flashes on the cusror repeatedly for a bit. Then the groups all the nodes are in appear after which makes me wondr if the groupings themselves have some bug slowing everything down cause the nodes themselves are always there but the groups keep disappearing and being redrawn when I add a noodle.
In a perfect world, it would interact with all shaders exactly the same as a light does, but darkening and removing light instead of adding it
Raccoon, do you use Node Groups?
Which rendering path does VRC use?
Oh uhhh I don't recall, it's enforced on upload so you can't change any of it.
I'm editing the SyncedVideoPlayer example, which uses node groups, yes.
I don't want to :3 supposedly you can use code to set a color's RGBA to negative 0-1, but this only works in deferred
Also that might have been patched out, but that's something I'll hav eot test
Yeah definitely. I edited the default sync video player a bit and had to wait forever for small changes. I swapped over to a USharp player instead and have been much happier
Remove all node groups. Right now they cause recompiling the graph once for each node in them.
And a light with negative RGB on deferred render path has worked to remove light from things
How? Selecting the group and right clicking does nothing.
Select all the nodes and hit "Remove From Group" or something
That works, thanks.
👍
How do I tell if something is a group with nothing in it, or a comment?
Intuition
When I delete the groups they are either uncovering hidden comments or shrinking down to look like one...
Pfft
Thing is they also have boxes behind them with the same text and I can't tell if that's a comment or another group... So I have to delete them and recreate the comment about what the group was.
And editing comments is annoying as well cause dragging them to resize them is also slow.
Note, this will all revert the next time you import an updated SDK
Oh I'm not editing the original example Udon Graph, I made a copy of it. 🙂
But thanks for the warning!
Also considering how badly I screwed up my project when I tried to update the SDK a couple days ago, I don't think I'm going to be doing that much except on new projects.
I deleted the directories and reimported the SDK and everything went pear shaped with tons of compiler errors. I had to go back to a backup version and then delete the directories outside of Unity and some more hidden directories not in the Assets folder and only then did I get it to work but Udonsharp was still giving me issues or something so I just removed the player pickup script that needed that for now.
Wait comments do look different than groups... So why the heck did every group in this video player have another group hidden below it with the same name as the group on top? I'm not talking about how it shrank down when I removed all nodes either. I mean if I picked up and moved the groups, there were other groups below most of them...
The comments are the ones I added down the bottom with the white outline and the lighter text.
Anyway it seems as if the groups merely existing isn't a problem. Once I removed all the nodes the graph sped up significantly. Maybe they affect performance a little still though...
Hey guys :D. At first i want to apologize if my English is weird some time cause its not my main language. Now my Question. I started doing some Udon stuff for my VRC World and i just wanted to do a pokeball which can spawn Pikachu. It already works fine but the problem is that i can spawn unlimited Pokemon and im scared that there will be some trolls who will exploit that. Is there a way to automatically delete a spawned Pokemon if another one is spawned ? I also thought about a timer which deletes them after a short time or a button which can be used to delete them. Any Ideas ?
Usually when people talk about spawning objects I hear people mention they should use object pools. Object pools mean instead of spawning a new object, you have a bunch of pre-existing objects in an array, which you then iterate through with a synced integer as new ones need to be spawned, and when you get to the end of the array you reuse the first one again. So that would solve your problem of trolls ever being able to spawn too many objects.
I think Instantiate is also slow or something, so using it to spawn dozens of objects like in a particle fountain would be bad. Or maybe you can't sync those objects between players cause you can't check the checkbox? Anyway it seems like people think you shouldn't use it.
I don't think anyone else can see them
Oh that sounds good i think 😄 is there anywhree a tutorial how to do that ? Im a noob in that kinda stuff 😅 🤯
they can its on public
Create a new variable GameObject, but with [] on the end of it. That's an array. Set it public. Then in the inspector you will see the array there with a size parameter. Set that number to however many you want. Then drop objects into it to store the references to them. But don't rename the array after or it will delete all the data you entered! Then just make a bunch of Pikachu in your heirarchy and hide them all, and then in your code you show them when needed.
I'm very new to this myself but that's the basics.
okay thanks a lot ill gonna try that out :). Also if someone have another ideas im still interested in other ways i could to this 😄
i dont even know what udon does
Can i just replace My Pokemon GameObject with that array then ? will that work ?
I think that whole Spawn Pikachu code segment needs to go.
And instead you would have code there to increment a synced integer PikaCount, then use that as an index into your object array whereupon you unhide that particular pikachu.
Also not sure what the section after the code that positions the Pikachu at the spawn point is supposed to do. Like RB there is a rigidbody variable... Which I can't tell if its public, but it would probably need to be? Because otherwise it's referencing nothing... But it would make little sense to use a public rigidbody variable either when you could just pull the reference from the partiuclar pikachu object you're working with.
I get that that section is supposed to apply forward momentum to it, but you should be using something like GetRidigdbody or whatever the command is just as you use GetTransform to get the rigidbody of the pikachu you're manipulating.
Oh wait I see your first section gets the reference to the rigidbody and then sticks it in that RB variable.
i saw all that in a tutorial for a gun and used this as reference. I dont realy know a lot about all that udon things. just made it like the guy on youtube does ^^
and abviously changed some variables like Pokeball or Pikachu 😄
Now that I see how RB is set up the code in the second two parts seems fine.
So just the instantiate node and the pokemon object below it need to go and that is where you'd access your array of pokemon and increment your index counter variable for each one you spawn.
Of course they will all continue to exist forever once you display them, so then you need to decide how they'll eventually disappear. And if you keep spawning them the oldest ones will teleport back to the spawn point to be moved again.
Btw you will need to check syncobject on the pokemon you create in your scene so they will be synced in their position for all players.
thats okay as long there arent hundreds of them ^^ ill gonna try my best to do what you suggested me
oh okay 😄
Also, I'm kinda new to Udon and I figure this is a good place to ask now while the chat is active, but is it more optimized to have one Udon Behavior with several Events inside it, or separate Udon Behaviors for each Event?
Is this error normal when you have a video player in the world?
UnityEngine.Video.VideoPlayer:set_url(String)
VRC.SDK3.Video.Components.VRCUnityVideoPlayer:<ApplyVideoPlayerSettings>g__PlayVideo|25_0(String)
VRC.SDK3.Video.Components.VRCUnityVideoPlayer:ApplyVideoPlayerSettings()
VRC.SDK3.Video.Components.VRCUnityVideoPlayer:Start()
I don't think it matters in terms of optimization.
ok thanks
Quick question regarding local vs global trigger events.. I have a mirror tied to an invisible zone where once a player enters it, it turns the mirror, and upon exit it turns off. The problem is it's apparently global, so if a person steps in the mirror comes on, and if another player comes in afterward it turns it back off.. is there a way to make the toggle only for the local player? Or do I need some form of udon conditional statement to check if the mirror is on in general vs a toggle?
Also to answer Lo Mein, I don't believe clustered commands are inherently bad for optimization because they are ran one at a time anyways generally as I'm not sure if udon can run parallel commands within a single behavior.
From an organizational standpoint I think it's always better to have small scripts that do one thing very well vs a large program that does everything. Generally a best practice with any language as it adds reusability and is less spaghetti code in the future.
I think the alwaysbufferone means "master" or global. I'll test a bit later by switching to local with a second body spawned in. I'd rather do that than modify the toggle code I built for it
You're asking about udon but that picture is sdk2. Are you using sdk2 is that just an example of what you're trying to do in udon?
An example of what I'd like to do on udon. I pulled this from my googling on my mobile as I'm currently vibin with my wife on the couch haha
Ah so you don't actually want alwaysbufferone then. That would mean that it would broadcast to everyone when the event happens, including late joiners
In udon, all you need to do is onplayertriggerenter > check if player.islocal > branch and do stuff if true
Yeah I'd like the mirror to only trigger when THAT specific player enters and only for that specific player
Yeah I'll update the code. Haven't tried using the graph for conditionals yet. I assume they have conditional methods to plug noodles to?
That's a branch, yes. It allows you to split the flow (white noodles) in two directions based on a bool
I assumed haha, just still new to udon so am making assumptions based on other languages I have played with.
So if it checks if the player is local, does the event trigger locally only?
Or does that need to be explicitly defined as a local trigger vs a global trigger
It does not broadcast by itself, but it will detect other players simply because those other player's positions are already synced
So when other players enter the zone it would still trigger the mirror when others enter (meaning the current player inside the zone would see the mirror vanish)
Unless you check if the player is local, yes
So then it makes me think the better option is to leave it how it is, but add a condition for if the mirror is active, to just ignore
I think I misunderstand local. I'm probably saying it wrong. Let me try and explain it differently for how I define local events
To me, a local event would be where a player clicks a button, and something happens, but ONLY for that player who clicked the button
All other players would need to click that button to see the resulting action themselves
A global button would let all players view the action at the same time
That's correct. That is the case for things like interact. But onplayertriggerrenter is a bit different because the other players are synced
Ahh so there is a distinction then
Onplayertriggerrenter is not inherently a networked event, it is all calculated on your own computer. But you receive the position of the other players and that will trigger it
So by all technical definitions it is local, but for practical purposes all you really need to know is that it is synced
So checking if player.islocal is true tells me what specifically? Local to that specific zone that they entered?
hey im having problems to get in some maps, can someone help me?
Is local tells you that that player is the one running on that computer
Is the "VRC Unity Video Player" component still supported? Friend commissioned a world a while back and it's a... Little sloppy, when he tried to build and publish unity crashes (although it builds and tests just fine), the logs say that the byte stream of the youtube url on that component isn't supported or something and that's why unity is crashing.
like when the map is a little bit big i try enter in the middle of the download it stops downloading and sends me back home
You are on quest yeah?
I believe it's 50 MB limit for quest or something
So while the world might exist and allow android users, quest doesn't allow it. It's happened to me a few times as well when I'm not running on virtual desktop
how can i change this?
You can't
A workaround if you have a PC is to link to your PC via a supported cable and stream to your headset, but play as a PC user
Or use virtual desktop and stream wirelessly, which depending on your network might not work as smoothly. It works fine for me. Sometimes get lag spikes, but is overall a fine experience for me.
I'm having trouble getting my video player to work. What I'm trying to do is make it so when a floppy disk touches a collider on my video player, the floppy passes a URL to the video player's script, and the video player then plays that URL. The idea is to put the collider in front of a disk drive, and load up let's plays from Youtube of different games on the monitor. I thought I had it figured out, but it doesn't seem to be working at all. Udon itself hasn't crashed because another script I have in the world is still running fine, and I don't have any compiler errors. Here's my setup:
So the floppy has a rigidbody and a collider on it, which isn't set to trigger, and it has a script whose only purpose is to store a VRCUrl for the videoplayer script to access.
Then on my video player I have a child object which I can position in front of the disk drive which has a box collider on it set to trigger mode. Being a child of the player, it should still cause OnEnterTrigger events to fire...
Well that's weird, the comments in my script have gone bye bye...
Anyway, so here's the player for the video player itself. I copied the script for the synced video player, and I modified the section which looks for the OnURLChange event which is normally triggered when someone enters a new URL into the text entry field, and instead I replaced that with code to detect objects entering the trigger, and then check to see if those objects have an udon behavior, and if they do, to attempt to pull the VRCUrl video variable from that script, and if its not null, then pass it to the code which handles starting playback:
The only thing I can think of is maybe for some reason I am not the owner of the video player even though I am the world master and the only one on the world. I tried clicking on the player and buttons though, in an attempt to make myself the owner and that didn't change anything.
Another possibility is maybe I messed something up when I tried to make the screen render to a rendertexture? It seems like it should be set up correctly though. Here's the screen mesh it's displayed on:
And the material:
And the rendertexture I used:
are colliders blocking your interactions?
I don't think so?
The trigger collider for the floppy drive is in front of the drive, outside it. And I don't think my post processing volumes should affect it. And there's no other colliders in that region.
I'm gonna try adding a new video player prefab to the scene with the original settings for the material on it and see if that helps but since I never heard any audio coming from the player either, I don't think it was playing at all. Also I made the trigger volume bigger just in case that was the issue and just to make it easier for the player to find it.
Of course with the default setup Autoplay is on so now I have an error about "Cant Play Movie" but the project built and is uploading so I'll test it with that error there.
Branch Question:
Want to add a branch after both Get activeSelf nodes to only send when false
it won't let me connect the branch to the unaryNegation though
any idea why?
it seems like you can't connect branches to boolean
unarynegation negation does not deal in flow
Yeah I had a feeling that was it
Do I have to add a dummy step to passthrough?
node* not step
Oh I am dumb
I can just pass TRUE or FALSE as the unaryNegation instead of using it
since I was passing the opposite state before, but I know the state I want to be in now
wait no it can't set it active either
Basically the top pic works when a player enters an area, it turns on a mirror, and when they leave it turns it off
but this branch will basically handle the case when multiple players are walking in and out
so it doesn't turn the mirror off and on constantly
so long as a player stands in the zone, the mirror should remain on, and when no players are on the zone it should switch back to off
It seems I can't pass true or false to SetActive from Branch either though so must be another flow issue like with UnaryNegation
wait no it does connect
testing now
So I've narrowed down some things with my video player. As I mentioned earlier, I went back to the default prefab to reset anything I changed on the video rendering side of things and then changed only the Udon script to my new one with the check for the trigger. And well, it still doesn't work, but I can play a video from the URL bar in game, so I know the video player itself is working, AND that everything to the right of this screenshot is working because it uses the same code as the event that fires when you enter a URL, but, either the code in this screenshot is somehow flawed, or there's some issue with my collider not triggering it or I don't know...
Here's the assembly for that section of code:
And just the first portion on screen above:
PUSH, obj_7
PUSH, Boolean_17
EXTERN, "VRCSDKBaseNetworking.__IsOwner__UnityEngineGameObject__SystemBoolean"
PUSH, Boolean_17
JUMP_IF_FALSE, 0x00000D5C
PUSH, onTriggerEnterOther
PUSH, instance_17
COPY
PUSH, instance_17
PUSH, instance_16
EXTERN, "UnityEngineCollider.__get_gameObject__UnityEngineGameObject"
PUSH, Type_0
PUSH, type_0
COPY
PUSH, instance_16
PUSH, type_0
PUSH, object_0
EXTERN, "UnityEngineGameObject.__GetComponent__SystemType__UnityEngineComponent"
PUSH, object_0
PUSH, result_0
EXTERN, "VRCSDKBaseUtilities.__IsValid__SystemObject__SystemBoolean"
PUSH, result_0
JUMP_IF_FALSE, 0x00000D54
PUSH, onTriggerEnterOther
PUSH, instance_17
COPY
PUSH, Type_1
PUSH, type_0
COPY
PUSH, object_0
PUSH, instance_18
COPY
PUSH, object_0
PUSH, symbolName_0
PUSH, object_1
EXTERN, "VRCUdonCommonInterfacesIUdonEventReceiver.__GetProgramVariable__SystemString__SystemObject"
PUSH, object_1
PUSH, result_1
EXTERN, "VRCSDKBaseUtilities.__IsValid__SystemObject__SystemBoolean"
PUSH, result_1
JUMP_IF_FALSE, 0x00000D4C
PUSH, onTriggerEnterOther
PUSH, instance_17
COPY
PUSH, Type_2
PUSH, type_0
COPY
PUSH, object_0
PUSH, instance_18
COPY
PUSH, object_1
PUSH, _syncedURL
COPY```
Big question, is there a way to have Avatar 3.0's parameters be read by a world 3.0? The goal is so allow the players to summon a menu object in front of them when they select the menu option under an expression with an avatar 3.0 that they can use?
Nope, Udon has no access to the player's avatar mesh-wise. You can read bone positions and rotations as you'd like, but nothing as far as they player's rendering.
Theoretically I could instruct someone to just wave a wand in a specific way or have them put their hands together and move them apart to summon a menu then?
@dawn forge technically
theres a few ways to use bone tracking data and what triggers do what. but the simplest method i can say to open a menu is by either using the acc menu button or a secondary button on your controller rather than tracking for a specific movement
How do I create a string to output a message to my debug log? I searched for string in the nodes, but all I get are string array commands or at least they're called string[], maybe strings are always arrays? In C many years ago I would have used a char array, but I don't know how C# may differ in this regard. Strings are clearly a thing here though. I saw a snippet someone posted a while back with a node that just said STRING on top of it with a text field to enter the string, but I can't find that in the node search.
Okay so C# has actual strings but how do I create them in Udon? https://docs.unity3d.com/ScriptReference/String.html
I tried making a string variable, then dragging it to the graph while pressing ctrl to create a set node and I don't get an entry field on the set node. Do I have to make this public and then edit it in the inspector? Because that seems kinda wrong for debug strings?
Here's the specific example showing setting a string within a node that I can't figure out how to replicate: #udon-general message
Huh? I can find the string constant node now when searching before brought up nothing?
Wait... Quick search and Full Search bring up different things? With quick search I can type string, click string, and select const string. But with full search I have to specifically search for "Const String" in the list to find what I wanted. I'd gotten into the habit of using full search because Quick search often would not find what I was looking for.
Okay, well it seems I didn't even need to get debugging to work. I think I just found the issue, but I don't know why it's happening...
So I have added a box collider with IsTrigger to the object I have the Udon script on, right? And that detects the collisions with my floppies as it should.
But, I originally had the trigger collider on the child of the object with the Udon script, which from what I understand should be perfectly fine and should still send an OnEnterTrigger message to the parent object...
I did this because it was already positioned in the right place on the drive in the scene, and the collider needs to be rotated. I could rotate the screen itself and reposition it that way to be in the right spot, but that's not a great solution cause I might want to make the URL bar available, or I might want to have say a stop button positioned elsewhere...
But anyway, does anyone know why the child object's collider would not call OnTriggerEnter for the parent?
This is where I got the info on child colliders triggering onenter for parent scripts: https://answers.unity.com/questions/410711/trigger-in-child-object-calls-ontriggerenter-in-pa.html
Perhaps the reason this was not working the way I wanted or expected is because the parent in my case does not have a rigidbody.
I wonder if there are like non-networked events I could use to have the trigger object tell the parent to change the video... But I'd have to pass some information between the two scripts I guess? Hm...
Maybe on the drive trigger object I have it wait for a trigger, if its a floppy extract the URL, stick it in public variable, then call some kinda local event to tell the screen to check that variable and enter the URL, but only if the local user is the owner of the screen.
Well the player has nodes to react to events, but I can't figure out how to actually trigger an event from within a graph...
Also I'm not sure if the react to event node is like... networked. Like, is there even a way to send events that don't go over the network, or do they all?
Is there way on udon to boost someone voice, like with VRC_PlayerAudioOverride or something
Something distance?
can someone help me in dm setup flying pillow with udon pwease? ;-; im full lost with what scripts i need to put on my pillows, so they can collide with each other and gravity smooth fly around when u drop them
(udonsharp) if I spawn an object using VRCInstantiate, how can I change some properties of that object and have the change sent to all clients ? For instance if I want to change its material color or enable a component ?
My simplest approach would be to use GameObject.Instantiate on each client side and send network events to manage the objects locally, but apparently this is not allowed.
Im not sure what "gravity smooth fly around" means, but afaik you just need be a simple VRC_Pickup component, and check off gravity on its rigidbody if you want it to float, and have drag > 0 (like 1) if you want to slow down by themselves
Short answer, you don't. No synced Instantiation for us.
That's why you use ObjectPools! No need for spawning in new objects if they already exist
We have docs on that now!
https://docs.vrchat.com/docs/player-audio
Players have two sources of audio: the voice coming through their microphone, and sounds attached to their Avatar. With Udon, you can change how a Player hears other players' voices and avatar sounds. For example, this graph makes it easier to hear another specific Player, boosting their audio by 5 ...
Hey, thanks for your videos. The thing is im not sure object pool fit my needs : im trying to make my own pen system where each stroke is its own object - a pen like that already exists, but 1) I dont know where to get it 2) I want to be able to make my own code for it because im not gonna learn much by just placing prefabs.
So, no client-side object spawning, and no object control (apart from position sync I guess) once they're spawned ?
That's what we call a bad idea
Like
That's sooooo many objects you would be spawning
Happy my videos are helping, but there's got to be a better way than ttoonnnss of object Instantiation for your pens.
When I say stroke i mean continuous lines. Its still a lot but not like one object per segment. Beside this system already exists and does not seem to cause trouble even with a fair number of strokes. I just wish I knew how they did it :p
im trying to make a game map (kind of Jar's Among Us game) and while I had some success on some scripts already, I need some more proficiency to go further
I a litte bit confused by Udonsharp [UdonSynced] tag, it seems unreliable, and SendCustomNetworkEvent() seems very limited (cant pass a parameter ?)