#udon-general
59 messages Β· Page 82 of 1
ERROR: [UdonBehaviour] An exception occured during Udon execution, this UdonBehaviour will be halted
Quite useless error message.
hold tab and then click expand top left
it should show more details if it's expanded
let me try again
you can also just go to the file where it's never collapsed
Possibly that's the error:
2022.01.07 20:49:31 Error - [UdonBehaviour] An exception occurred during Udon execution, this UdonBehaviour will be halted.
VRC.Udon.VM.UdonVMException: The VM encountered an error!
Exception Message:
An exception occurred during EXTERN to 'VRCSDKBaseVRCPlayerApi.__GetTrackingData__VRCSDKBaseVRCPlayerApiTrackingDataType__VRCSDKBaseVRCPlayerApiTrackingData'.
Parameter Addresses: 0x00000009, 0x0000000A, 0x00000008
Object reference not set to an instance of an object.
Not sure, as the log is a mess
But I do nothing with TrackingData here, so might because I am not using a VR headset
that's probably a different udonbehaviour
are you sure this udonbehaviour is crashing when you click interact?
Yep.
Because the script is a simple Light button toggling room lights and changing the lamps material from a material with emission (turned on) to the same material without emission (turned off).
And what actually happens in game is, that only the first light gets disabled, but when it comes to the first MeshRenderers material, thats where it breaks
then find the part in the log where this udonbehaviour is crashing
When I cut off the material part from the flow, the lights successfully turn on and off
2022.01.07 20:49:27 Error - [UdonBehaviour] An exception occurred during Udon execution, this UdonBehaviour will be halted.
VRC.Udon.VM.UdonVMException: The VM encountered an error!
Exception Message:
An exception occurred during EXTERN to 'UnityEngineMeshRenderer.__set_material__UnityEngineMaterial__SystemVoid'.
Parameter Addresses: 0x00000009, 0x0000000C
Object reference not set to an instance of an object.
This one I guess
yeah that would do it
I am using one FOR loop for both, lights and MeshRenderers
so are you sure every single mesh renderer is valid in that array?
Because every light has exactly one meshRenderer
Should be, I just dragged them in one by one again to be sure
could you take a picture of the inspector with the lights and meshrenderers?
I will, one moment.
I just saw that somehow the array length chaned in the editor. 2x light, 1x meshRenderer. That would explain the error. Let me quickly double check and test again
if you want to harden it against that kind of thing, you could add an isvalid check on everything
you could also use mathf.min on two array lengths so even if they're not the same lengths it'll stop on whichever one is shorter
Good idea! thank you π
I just saw that somehow all MeshRenderers got reset. Not sure what kind of change did this, but I definitely need to be more careful in double checking these things when errors occure.
I guess now it will work once compiling is finished. Again thank you for your help! Definitely learned how to more efficiently Debug in Udon thanks to you
Still same problem. Could it be a problem that I attached a VRCObjectSync to all light objects? Would it be better to attach it to the light switch and will this have the same effect? (All players having the lights turned on or off if somebody uses the switch)
objectsync doesn't have anything to do with this
it does not sync whether or not an object is enabled
all it does is sync the position
if you want this synced you should have a synced bool
but that's still not your problem if it's crashing
Oh okay
Yeah, still same error, despite having added all MeshRenderers and Lights. I will try it now with removing all VRCObjectSyncs from Lights, LampMeshes and Light Switches, just to make sure they don't interfer
Is there a difference between GetLength() and get Length() ?
Shouldnt happen, nothing else is accessing them
I will try a different approach
I will try to create two for loops, one for the lights and one for the meshes
that's not the problem
if it was, you would get an index out of bounds exception
just add isvalid before doing anything with the meshes
Okay, then I'll try that
Thank you, the isValid did the trick and addresses all MeshRenderers. Still wondering as to why it doesn't run through the loop without it.
because somehow, one of your meshrenderers is invalid
Hm, I will check them one by one and see if I find the reason.
Other question: You mentioned to sync the lights between players, I need to sync the boolean
So I added a boolean to the Udon Graph which has sync checked and once the boolean gets set to true/false, there is also a check in "sendChanges"
Do I also need to add a VRCObjectSync to the light or the lamp mesh (parent of the light) ?
It seems not to sync between my two instances.
Ah nevermind, it gets synced, but on my PC only shows the changes once I change to the other instance.
Oh, no it doesn't sync. I got confused. Seems the light toggle only works locally
you need to hook up the boolean so it actually applies the changes you want. It's not automatic
Should I maybe better create a RequestSerialization of the light[] and meshRenderer[] ?
I know, I hooked it up
the basic flow is that on interact you would setowner (localplayer), set the bool to it's inverse, then requestserialization.
Then onvariablechanged of the bool, you would set the lights to the state of the bool
aaah okay
thank you! I will try that
Where do I find the "onVariableChanged" ?
It's an event?
hold alt while dragging a variable into the graph
ooooh okay!
by setOwner you mean the owner of the light switch or of each light and meshRenderer?
okay
Do you have to call playerapi methods on the client that is said playerapi?
What is the input of the RequestSerialization? The current UdonBehaviour I am in?
Do they have ownership of their own playerapi?
Yep, I call it in some other udon behaviour
yes, but the self ref is implied
you dont need to add it
So I don't need to feed it any input?
depends, some of them yes, like teleport
yeah i was getting errors yesterday when I tried to run immobilize on all clients from my game master
I think teleport failed silently
but good to know
Are player APIs owned by their corresponding player then?
Can't malicious players call functions like teleport manually then?
How would they go about it? You mean when the necessary mechanic is built into the world?
Well if they call the teleport function and they have authority (as they're the owner of the object)
there'd be nothing saying "no you can't" right?
Hm true, but how would you call the function from within Unity Client?
Via usable item?
I'm not sure as I don't really know a lot about cheating (other than what to generally do to prevent it in networking)
But if they could make their own method calls through some client they make they could just make it execute a teleport function
I guess one could write a gun script that on first click stores the raycast hit its pointing at and on second click teleports there
I'm mostly asking because I'm not really sure how to make my game safe from cheaters
I suppose its always impossible to prevent the current gamemaster from cheating
I think generally speaking, VRChat is not yet at a point where its cheat-safe. When you allow users to create content, you are literally opening the door for cheaters, with so many APIs exposed.
Btw, my script works now, Thanks Phasedragon!
true π I suppose I can just let it go for now and worry about it if cheaters become an actual issue
I mean, basically VRChat is a huge sanbox with no consequences gameplay-wise. To me it feels semi-immersive. I play a game but I don't really fear any consequences of getting hit, losing or whatever, as I can just leave the world at any time and things usually don't really collide with the player.
My world is trying to change that a bit. I made little robots the player sits on and drives around with to player soccer. When the ball hits another players robot really hart, the robot topples which also topples the players view and will feel quite uncomfortable, being thrown around in the world like this.
I will make a list of how many beta testers puke π
Haha, yeah I think that'll create a lot of motion sickness.
Lets hope so π People should be SCARED of getting hit π
Optionally I will implement a top down third person camera that is not affected by the toppling and see what people prefer.
Guess I know the answer to that already haha
Btw, when I want to teleport Objects, do I set the Owner of the transform or the gameObject itself?
I mean before teleporting
set the owner to what?
localPlayer
depends on what its for
I have a lot of physics clutter in my map and a button that reserts everything to its starting position
you'd still want to sync it to the rest somehow
unless its like
physics clutter that doesnt have to sync
Each object has a VRCObjectSync attached to it
then you dont need to set the owner
No, the clutter shall be synced
But if another player messes with the clutter like holds it in hands, the other player pushing the reset button won't be able to reset its position
someone should correct me if im wrong because this is from a UE4 dev perspective, but generally you'd send a network event to the owner thats like
OnClientRequestReset
when the button is pressed
Not sure if it works the same way in Udon.
Afaik you add a VRCObjectSync to every object you want to sync between players.
To make them Physical objects, you add a VRCPickup which also gives them a Rigidbody.
Per se, these objects are already synced between players, but if by using a button, you try to Β΄set the position of the object, I believe you have to set the position locally and then make sure the one who clicked the button becomes the owner of all objects before teleporting them as well.
I think it would work the way I described
what you're saying is basically saying "make the player pressing the button the owner, so his changes sync"
I didnt find a "OnClientRequestReset"
what im saying is "make the player that pressed the button run an event on the owner of the object, which will sync automatically becaue its the owner"
wait
1 sec I'll show you what I mean
You'd have to make an event like that
Okay π
custom event with a name like that
Basically, the button and the clutter is owned by the first player that joined and they have authority over them so their changes are the ones that get synced to others
so its easiest to just have the owner run the code that resets it all
Thats how the reset script looks right now
ok im launching my project now and ill make some psuedo code
But owner changes when somebody else takes the clutter in hand
so after 5 mins playtime, half the clutter is owned by different players that were last fiddling around with it
ahh
Clutter has the flag of changeOwnerOnCollision
This is why I was planning on just resetting ownership to the one who pressed the clean up button
It cleans up right now, but only if the person is already the owner of the clutter. Not sure why it doesn't Set the owenership
in that case you could do either that or make it so the current gamemaster gets the ownership
I didnt touch the game master thing yet, otherwise I increase the amount of possible human errors when messing with that as well for the first time here xD
the set ownership doesn't work because
probably
only the owner can set the ownership to someone else
let me double check that though
Okay, thank you!
dont quote me on it though it's just an assumption
nvm im wrong
I'm not sure why its not working then
Hmmm, weird
I have to read the ownership from the gO, not the transform right?
I'm assuming the last bit is talking about the caller
i'd assume so yes
as its the gameobject that has ownership
Hmm weird, as I am doing exactly that
Checking if the current player is the owner and if not, giving him sovereignity over the object
no errors?
kk
seems it successfully changes ownership
but fails at teleport.
Damn I have to run, friend is waiting. Thank you for your help mate! Highly appreciated!
No worries π I hope u can figure it out
@jaunty dagger there's a literal respawn function btw if you're looking for respawning the clutter
probably wont fix your issue
Ah perfect
but might be useful for your case
thats what I would need
Friend is waiting to join but I fail compiling the map xD
Getting a weird error in the upload screen of Udon
whats the error?
I updated Udon SDK today, could that be the reason?
Aaaaand i get kicked out from my account in unity every time after compiling and failing to upload
Deleted my old builΓΆds from the map and trying again now. HOpe this worked
hmm no clue sorry
Np.
Maybe its the VRCWorld object. will try to delete that and recreate
This kind of crap always happens when you try to show your world to someone xD
Does anyone know where to find the damn VRC_PipelineManager?
Figured it out
Can you save data in a world on a specific player? Like having a database basically
So you can have savegames etc
It was proposed in a dev stream. But no currently you cannot.
There is a project a friend of mine was/is working on, that allows this in a hacky way.
Cool, well I'll probably wait for the official support, I'm not in a rush π
Hey guys, was wondering if there is a tutorial out there for how to stream videos via the VRC api as in the world Movie & Chill
And also if anyone knows a better way of handling physics and collision via the network than Udons built-in methods and classes.
I need something more accurate and precise for a soccer game I am working on.
No idea about pre built movies etc like moivie and chill but there is one i know of for url inputs from yt
but i dont think that is what you are looking for, sorry if i couldnt help
Ah a nice person from this channel just sent me the link π
I think it's the same player as in Movies & Chill
ooo
glad you managed to get it!
A very dumb question but how should I go about making a audio slider for 1 audio source? the tutorial I am using has 2 and inserted a forloop but I don't know if I just remove it and continue everything else or if there is a completely different structure to it altogether
Here is an image of how the tutorials one looks:
After updating to 2019 (I put it off for quite awhile) all my programm sources are empty. How do I fix this?
I have backups btw
make a public variable for AudioSource, you can remove forloop, get length, get audio source. connect custom event directly to set volume, keep value as it is and connect public variable of audio source (not an array) to instance in set volume
Thank you! I will try my best!!!
you don't even have to use udon for this, you can just create a slider in your UI, and in the OnValueChanged event thingy just add the audio source and put volume as the property to edit
Step 2.5 in this document is specifically about preventing that from happening https://docs.vrchat.com/docs/migrating-from-2018-lts-to-2019-lts
Migrating your project from Unity 2018 to 2019 LTS isn't as difficult as you might think! Here's a guide providing each step in detail.
Thank you too! I will try and do both and see which is easier
but the thing is
I did that xD
then try it again
with event one on slider, would be perofrmanter than udon
I will, thanks anyway
you could also try right click > reimport on your scene file
but only if you haven't saved it since migrating
sometimes that data is locked away and just needs to be refreshed enough to pull it out. But as soon as you save, you've lost it forever
I backup the 2018 version before updating or touching anything so should be no problem
π
sorry to bother you again but just to double check, is this ok or are there any mistakes?
Did it again and this time it worked, idk what I messed up but thanks!
probably wasn't you messing anything up, it's just that unity misses things sometimes
could be me could be unity, it is fixed so thank you!
yes, does it work as expected?
I have not checked yet but now im happy it looks ok π
Is there a way to get a player's Id from a raycast? Do I instead need to create an object associated to the player, that the raycast then hits?
yes, the latter. Because VRChat didnt think or care about raycast-player interactions
ah, gotcha. Thanks ^^
what are common reasons buttons may not work?
I think i have my udon correct but are there any small details you would recommend double checking before seeking full advice
you didn't put a collider on them, you didn't give it an interaction. if its a ui button, you didn't put a ui shape on the canvus or you didn't call the event when clicked
are you talking about UI buttons or udon interact?
i put a collider on all (mesh collider with convex and IsTrigger on) I think i have the interaction down, I added a ui shape on the canvas and every button (not sure if i needed to add to every button) im not sure about calling the event when clicked refers to, that may be the one but im unsure
here, check out some of the steps in this doc https://docs.vrchat.com/docs/vrc_uishape
Script used to make Unity UI interactable in VRChat. Requires a Unity UICanvas element on the same GameObject. Steps to making an Interact-able UI with VRC_UiShape Add a Canvas using the right-click menu in your hierarchy.Add a VRC_UIShape component to the Canvas.Set the Canvas Render Mode to World ...
uuuuuh, i dont know how to answer so ima say both?
thank you!
you do not need a uishape on every button
not sure if mesh collider works, that could probably break it
Gonna Switch to box collider to set it out then!
well the buttons work fine but they just dont do their respective duty. EG) play/pause can be pressed but doesnt pause. I think i have tried everything recommended thus far from people and the link so is it safe to assume it may be an udon related issue?
If sending ss of udon graphs can help identify the issue i am more than happy to
you could check your log and see if something is crashing
its empty which is the sadge part π¦
pics of the button and the event that is supposed to be called would help
will do, gimme a min ^^
Ima do just 1 button aka play/pause
I was working from Vowgan's tutorial
You put Play/Pause in the event in your button but the event name is PlayPause in your code
Does VRC support Vector Graphics? (SVGs)
We can always convert them to SDFs if needed but I wonder if they're just inherently supported?
Is there a way to make a player look at something? via a PlayerTriggerEnter lookat(thing). or rotate to face said thing
Or can I grab the quaternion of a player holding a pickup?
nvm
π€ Everytime I create an U# script it says this... I guess there's no solution for this.
im getting lag in my map and used the profiler to see what was going on. Does anyone understand where the lag is coming from here?
I need help. I want to make a video world. Does vrchat not support splicing URL strings?
unfortunately no, and exploiting work arounds to do so goes against TOC. that being said, you can have set urls in your scene, with say a button that plays one of those url
thank you..
is there a way to change the interaction text on a gameobject via udon sharp?
Thank you, that was the issue, it works perfectly now
Can you get udon on chromebook?
i dont think it should be impossible but dont take my word for it
it might work if it's one of those newer x86 chromebooks that supports linux apps, and then using the linux version of unity, but that version isn't officially supported by VRChat and the majority of chromebooks are ARM anyways
Not sure why but link loading doesnt work, i believe the url input field works fine, here is the event and button settings
you have a box collider on the button?
yes
that's a bit unconventional
are you sure this is a problem with the video player, or is it a problem with the button?
in the tutorial they have event custom and send custom event switched, i dont know if it makes a difference
uuuuuuuh
i would guess the button for loading the link as i can enter the url in without a problem
here is the settings of the url input field
if it helps
is the button sending to the correct udonbehaviour?
maybe? how would you go about checking it (sorry I'm not good with this)?
are you referring to this?
it is!
yes, there is only 1 udon graph so far, it has the slider volume, play/pause and that url event i showed earlier
and if you click the button, does that cause the input field to stop working?
The load button?
yes
essentially yes, the link stays in the input field but doesnt get loaded onto the tv
that's not what I'm asking
you said the inputfield worked if you don't click the button, right?
when I say worked I was referring to me being able to write links in it but not load them, im sorry if im making this more confusing than it should be
is there a reason why you're not just using a video player prefab?
just drop this in https://github.com/MerlinVR/USharpVideo
I guess the best answer to that is because i am dumb...
building a video player is pretty complicated, so it's fine. Maybe you can take a look at what this is doing to see how stuff is supposed to work
That's an amazing idea
though it does use udonsharp, which could complicate things even more. I don't know off the top of my head any video players built with graph
the tutorial i was watching used both graphed events and udon sharp so I can compare the prefab to the tutorial, either way thank you very much for the prefab!
Now i just hope i dont struggle at somkething as simple as putting it into the world
I can use TeleportTo to set a players pos and rotation, and then i want to use Set Velocity to boost them forward, but calling SetVelocity even with a delay after the TeleportTo is not sending them in the constant velocity direction(like 5 on the z)
It seems to always send them the same direction in relevance to where they were facing before the TeleportTo, need a way to wait until they are facing the right way
calculate the forward direction with where you want them to be rather than their current tracking data
My graph just died so i have to recreate, but i basically took the currentpickup quaternion, and used that as the reference for the TeleportTo and it will make them face away from the pickup on collision
And im trying to make it happen anytime anywhere, based off current rotation of pickup
always just face away then set velocity forward
so whatever rotation you're plugging into the teleport, take that and use it for the velocity too
ooo okies, lemme remake everything and try, thanks!
unless you know how to fix this?
not sure what's broken about that
opening the graph just gives this on every click and the variables wont load
and the nodes wont load
or highlight
started happening random π¦
make a canny and post the graph
it should prompt you to log in with your vrchat account
lol
I need a canny for making cannys >_<
So without SetVelocity it works
but the setvelocity is like 10000 times too powerful and doesnt go in the right direction
So he always faces the right direction, but he only moved to the left
No matter where i am
direction is good, velocity is not
you want to times a vector3 (velocity amount) with the quaternion rotation and put that into the set velocity. you don't want the Quaternion.eulerAngles
so i would take a made up vector 3, and times it against the raw quaternion?
and slap that as velocity?
multiplying a vector3 with a raw quaternion changes that vector to face that rotation direction. never done it in udon graph though
basically
give that a go. see if it does what your after
agreed ^^
any good double jump examples?
or where to start
I can get the InputJump, and test if the player is grounded, but how do i get the local player who jumped to mess with?
where does the pictures go when u take a selfie
should be in your pictures folder under vrchat
What would go on false for instance to let another jump event happen when they are airborne?
inputjump happens on both the down and the up, and the bool value indicates which
i asked before tho it was under world development but with no luck, perhaps here i would have some as i think it might be udon related aswell,
so im looking for whatever can make me able to build a map where i can have spherical walking or / and sideways wall walking etc, basicly the trippy illusion of walking upside down but everything is in normal angle for u, i saw maps having some like it before and i wonder how to do for vrc because i barely can find any proper in regards to it .
That's technically possible but really really complicated and janky
Just adding a boost if they try to jump while in the air would suffice
But this doesnt work
you don't have the flow connected on the left
yeah all i found in regards to it, if udon scripts etc was player based, i tried to add them to the vrc_world but with no luck as it seems it wont apply it to the player itself kinda, also i believe its partially something that would have to be made on the objects / meshes rather than the player i believe ? tho im not sure exactly, it is a very complex one but i would love to build a map with that in main focus .
infinite jump woot!
if you're new to udon I would highly encourage you to start with something a bit more achievable
just keep track of a bool or int and check on update if they're grounded so you can reset it
im still on a amateur state for sure, but yea i see that might be a good idea :p tho ye i hope i can end up working towards that, i figured rigidbodies also could be in play but i guess its alot of udon work too
ty!
the biggest challenge is networking. The whole thing is just an illusion and you need to manipulate where players see each other
Looking to get a hand bone for instance, and calculate a velocity using point A of hand OnPickupUsedown and point B being OnPickupUseUp, Vector3 Distance returns a float but unsure how to jam that back into a V3 variable for velocity
B - A = the difference between the two
Will test then, thank you!
Is there a way to test build in VR with multiple clients?
Or even have a desktop client as long as 1 can be in VR>
yeah, just launch VR then disable VR and launch again
disable reloading
whats that
it's an option that reloads the client's world instead of launching a new one
but if clients are not launched together they won't be in the same instance
Is that found on the VRChast SDK window for building?
if you go to the settings page in the SDK and "show extra options" you'll see it
with and without
Can I put a cube with rigidbody on the Player layer and make it fire OnPlayerTriggerEnter event? or is that only player players
There is an example scene on the SDK3 that has a mirror toggle with the point (raycast/UI button) You can see how it works from there
so i have all setup but when i test it doesnt work
What doesnt work? Are you able to click the button on vrchat? Either the UI is not set up properly or the Script is missing something
i setup it up right but when i go in nothing works
Change the layer to "default" I think if it is in "UI" you can only interact if you open the vrc menu
if you don't want people to collide with it, walkthrough is better
thanks π
going show screen shot in world deve what ive been working on
Anyone know why Udon Behaviour would start showing like this after an U# update?
Change your inspector from Debug to Normal
Is there a good trick for activating a collider that hits anyone but the local player?
as in person A activates a collider and B,C,D are effected but not A
Already is in normal π¦
Hello, how can I add a video playlist? Is there a project where I can download it or something? Right now I am using USharpVideo player, is it possible to do something like this with that video player?
I've found ProTV video player which has a playlist.
Now that I managed to fix the first issue I had by reimporting everything, I am getting this error. Even tried to revert VRCSDK and U# but nothing is working. Everything that has an udon script is showing as not found.
Tried restarting Unity and reimporting all related scripts but no luck.
Any help is much appreciated β€οΈ
EDIT: idk how I fixed it but I must have reimported Udon Sharp, VRCSDK, Udon and some other scripts 10+ times and it eventually worked. Love unity
I dont know too much but try reimporting the audiolink script. And another thing that i had was i needed to compile it but i have no clue how to do that anymore
Yeah I've tried reimporting all the scripts I used and recompiling but that is when it spams errors. No idea what is happening considering a revert did nothing too
Man sorry i could help much good luck on it, hope you figure it out
All good thank you anyways β€οΈ
As soon as i pull any gameobject out of my scene into udon it starts screaming
How can i fix that?
Is anyone familiar with drop input events for Quest? It works fine on my WMR but doesn't seem to fire when I release my grip on the quest
Hello, I am using ProTV video player, I added a playlist with a search box, but the search box doesn't work, can someone help me?
inputdrop does not fire when you release the grip button, it fires when you press the button that triggers "drop" which only applies to some controllers. If you never receive inputdrop you can assume that the player is using one such controller, and in that case you can have the same thing happen when you release grab
Ah, perfect I'll switch the nodes to grab. A nice easy solution, thanks Phase
you must go to the search bar game object, go to the udon behave in the inspector, find the playlist array, then drag and drop the playlists in your scene into that playlist array. if you have already done this, may i see screenshots of the playlist inspector and searchbar inspector?
I can't, there is no button to open udon graph
what does imageplaylist inspecotr look like?>
It works now, all I had to do was put the PlaylistSearch in to the ImagePlaylist "Playlists To Search" array.
Thanks
how do i make a transparent mirror
How can i go back to look for other Stuff in the create node thingy
everytime i click it it goes to VRCEvent Search
but i want the search that i had the first time i opened this
make sure you don't have another node highlighted
when you click on a node, it will give you only search results related to that node
Makes sense
is there a way to make an object uninteractable after something happens
sure, set disableinteractive true
What would be the instance?
the udonbehaviour that you want to disable interactive
you can leave it blank if you're talking about the one that this script is running on
Thank you
Anyone know how to disable the TMP things in the editor, they get really annoying
gizmos button on top right acene window
How to add 2 numbers together in udon i litterally cannot see it in the math module
I'm feeling very stupid not to be able to add 2 numbers together lmao
Found it
How can i get a variable from another udonbehavior
You need a reference to that other udonbehaviour, either by having a public variable of it or by using getcomponent. Then use the GetProgramVariable node
Depends on your use case. The reason to use an object pool is because you usually want those objects to be able to send networked data, like with pickups. If you don't need that, you can use instantiate and have it all be managed and synced by a central non-instantiated object
if you're working with virtually unlimited objects then you might not even want every single object to be sending data anyway
could you provide more details about what you're trying to do? I could give you some recommendations on the best way to accomplish your goal
yeah you should just have a big object pool
make sure to put the pieces on a layer that does not collide with itself and performance shouldn't be too bad
pickup collides with itself. 500^2 collision checks is expensive
and you don't need 500 objects of each type, you only need 500 objects that can transform into whatever type you need
that transforming can be done with instantiation
you could have a big manual synced int array somewhere that corresponds to what type each object should be. Then it instantiates whatever children it needs to be that type
not if they're instantiated
but you can sync on the main object
Is there a good trick for activating a collider that hits anyone but the local player? As in person A activates a collider and B,C,D are effected but not A
onplayertriggerenter, check if not local player
What is udon?
Ahh, my 3 am brain couldnβt compute that thank you
In a nutshell, its the current way we can use Unity to add avatars and worlds to Vrchat
O ok
Its a visual scripting addon like Playmaker but someone made it so you can C# code as well and turn it into "U#"
not avatars
oh is that just SDK 3
it's just worlds
avatars have their own SDK3 which is a different system
?whatisudon
VRChat Udon is a programming language built by the VRChat Development Team for use in VRChat worlds! It enables complex behaviors and logic in VRChat worlds. Read more about Udon in our documentation: https://docs.vrchat.com/docs/what-is-udon
Whatβs this Udon thing anyways? VRChat Udon is a programming language built completely in-house by the VRChat Development Team. It is designed to be secure, performant, and easy to use via the VRChat Udon Node Graph, a built-in visual programming interface that uses nodes and wires (we call them βno...
I have a InputUse im using to enable a gameobject with a collider, the collider has a graph on it to play a audio 1 shot on enable, and then a OnPlayerTriggerEnter and after 1 second the object turns off until InputUse is called again. My problem is both clients hear the OnEnable audio but the OnPlayerTrigger is not firing on non local players
This would work to detect other players on trigger enter right
adding the islocal and branch makes it not fire on the person triggering it, but with or without i cant get other players hit
Did you try a video player? I've seen sound cloud links work with that, so there is a chance mp3 will work.
I'm about to try
i have to edit the source code since im making a song browser
a track contains a VRCUrl object and when you click it, it should just play on the USharpVideo
i gotta figure out how i can do this the easiest way
ill just make my own method
Man this is so cool I wanna get into it too
ProTV has a working playlist, with a custom editor to manage what's inside which is neat.
However, making it yourself isn't too difficult. Not sure if creating a script for every button is a good idea performance wise, probably fine if you disable networking. I'd personally give each button an Id and use that to identify the song in a VRCUrl array.
how exactly would the getcomponent method work?
plug the udonbehaviour type into it
and out of that getComponent how exactly am i able to get the ProgramVariable?
like this
that should work, are you sure that isLocked and isClosed are spelled correctly?
and that there is an udonbehaviour on Door with those variables?
Yes and yes otherwise CyanEmu probably would've complained
Oh wait
nevermind
me idot
??
And the OnEnable of the other object fires
but the OnPlayerTriggerEnters only sees local player
make sure the collider is touching the ground. Remote player colliders are a small sphere around the feet instead of a full capsule
Pretty big collider i think it touches
im basically moving a object to a players location on click
and anything caught in that triangle should get hit by OnPlayerEnterTrigger
which it does if the 1 who clicks steps on it
does it have a rigidbody?
it does not
if you're moving an object with colliders it should have a rigidbody if you want collisions to happen properly
before it was a child of a pickup with a rigidbody, maybe thats it
Ist this bool automatically changed when another script calls SetProgramVariable
definitely hitting other player, and the other player sees it hitting them
but only the 1 who clicked will get the OnPlayerTrigger Event
what does the onplayertriggerenter look like?
i def can
no you cannot
D:
I had that same triangle collider on the end of a pickup, and wherever i faced that player, they would rotate the same way im facing, and get launched
to teleport another player you need to communicate with them somehow and then get an udonbehaviour on their client to call teleport
but before i was using a pickup get player as my ref for rotation on the teleport
This 1 works on teleporting other players
idk what you were doing but it's probably not what you think you were doing
oh
Yeah, in that case the other player detects the collision and teleports themselves using the currentplayer of the pickup
Hmm how would I strip out the need for a pickup? and just have a disabled gameobject in the scene at start with the collider, be able to hit other players
a manual sync type deal?
with serial and deserial
well how do you want to define the location that players get teleported to?
I want it based off their current location
basically want to move them up .01 Y to get them off the ground
turn them around
and velocity them away
so why do you need to define some specific player?
and why does that need any networking at all
player A clicks mouse and enables and move the object so the collider is facing away from them, anyone caught in that goes woosh
but if i click while sprinting, i can also enter the collider and get wooshed
the isplayer local == false fixes the clicker getting wooshed, but still need any other players to feel it
ok so when a player does inputuse they need to take ownership and set synced variables for the position of the thing. Then other people receive that data, move it into place, and if they touch it and they need to know about the owner they just do networking.getowner
hmmm... click > take ownership > others test for owner, OntriggerEnter if not owner execute?
yeah
gotcha, ill play around with that thank you!
this should work yes?
only if that event is on this udonbehaviour
plug a different udonbehaviour into the "instance" slot
oh
yeah that should work
you really should just use an udonbehaviour variable instead of gameobject+getcomponent though
then something with my teleport system is broken because as soon as i interact with the door it just does nothing
The disable interactive is above this
is target or count not set in the inspector?
check your log to see if anything is crashing
What is Debugging? Debugging is how you learn about what's going on under the hood in the VRChat client and your world. It's a key skill to develop for programming in general, and for building your worlds. VRChat Logs When you use the VRChat client, it saves logs about things that happen like worlds...
I've seen a few worlds achieve vehicles moving on a track (eg UdonTycoon), what's the method being used to achieve that given splines don't seem to be exposed?
make your own splines with math
M A T H M A G I C
is there a guide to do the following when bullet hits a box it turn the renderer off, play a particle effect, play a sound,
Can probably just look up any unity tutorial for that, most of the things exist in Udon for Collider event and setting gameobject components on or off. As well as audio play 1 shots
It's rather niece topic, in an environment that already doesn't contain many tutorials in general. I would look into seeing if you can find any similar prefabs at places like VRCPrefabs.com and the likes, and seeing what they did and adjusting it. Most people will likely use udon#, and if your comfortable with that, many unity tutorials for C# will help. If your doing this with udon graph, perhaps looking at Bolt tutorials might help? but they too aren't that common either and there are differences between Bolt and udon graph.
As for that script in particular, it would be something like this. I haven't tested this, and I'm suspicious of the 'particle system play' part of it not working, but it'll hopefully give you some pointers as to where to look
@indigo finch could we vc and u help me out
Honestly, I think someone else will be better at helping you achieve it. There's just too many holes in my udon knowledge. I just shared something that will likely work (or at least close to it) to help give you a jumping off point, and/ or to get the code roasted and me learn something new ^^
That seems as good of a reference point as any. It'll likely use udon#, but there are plenty of people that can help, expecially if you can break down the problem into a small, specific question
Does anyone knows a way to load image texture from "URL" inside udon ?
Why not just, put the PNG into your project
posters, calendars
i think for now with udon, only via video players or avatar previews, maybe im wrong, but i think the thing that used in sdk2 to load images after join isn't supported in sdk3
you can try to look at some Japanese, Korean calendar prefabs, they should have any kind of implementation of this, i think https://github.com/AoiKamishiro/VRC_UdonEventCalendar but maybe not π€·ββοΈ
@indigo finch this shit is getting to overwhelming i'm making a game and i did all the map making and i am not meant to be doing the f**ing coding my friend is but he has not done anything for a week and i really wana get this done i have been trying to do sht for 4 hour and i give up for now
Interesting ! thanks will look into it.
For the time being I did the same with SDK2 with VRC_panorama .
Is there any demerits if i stick with sdk2
Eventually SDK2 will no logner be supported, and then you can't upload or update worlds or avatars using SDK2 anymore
I wouldn't reccomend using it
plus a lot of cool prefabs are sdk 3 only
Would anyone know how I would be able to toggle the material in for the world from dynamic materials instead of it being in the actual world?
Hi, is there a way to get video players to play a Youtube Playlist?
I'm using Wolfe's Video Player
currently it's playing the first video, but doesn't change to the next video
Is there an easy way to freeze an animation?
sure, you could create a float variable and have it affect the speed of the animation. Then just set it to 0 to pause
Genius π
Should this work π
yeah
I'm trying to capture and store a still image from a render texture (to take a player 'profile picture') for a menu system (similar to what the Among Us world does), how is this achieved? I've tried something like the following but getting "ReadPixels was called to read pixels from system frame buffer, while not inside drawing frame."
Unless that update call is being fired before the current frame completes...
you don't need readpixels at all, just render the camera to the rendertexture that's it
readpixels is for something else entirely
And if I turn the camera back off.. it preserves the last capture?
yes
sweet!
Thanks
I'm building up a menu system for a game and for a game master to review a player list and assign roles etc. The main annoyance I have though is it seems the best way to do stuff is a menu where you cycle through each player, as its possible to say, have a button per player and know what button was just clicked on because of the limits of the event system not letting you pass data
So I can't do something like playerButton(player), only, playeroneButton(), playertwoButton() and that REALLY doesn't scale :D;;;
The most common way people get around that is by setting the textfield of a text ui component to some specific value, and then sending a custom event to an udon behavior, which then reads that field. It requires either manual setup in-editor or an editor script though and is very roundabout
@fiery yoke The other thought that came to mind was doing something painful like seeing if I can read what control the laser pointer (be it head or hand sourced) is focused on.
Skimming through though, that looks like it would pretty impossible to discover though
you can do that if they're toggles. the udonbehaviour can loop through all toggles and see if one is true. then it knows which was pressed and can also reset it back to false
I still prefer the text string method though
I thought custom events mind have no arguments though? Unless I've missed something here.
eg, if I have a player button with a display name
And I send 'PlayerButton()' clicked, how do I know which player button sent the message?
correct, the text is a way of creating an argument though
The button sets the text then sends the event to the udonbehaviour. The udonbehaviour then reads the text as the argument
Oh, so something like this is permitted?
regular text, not textmeshpro
Oh sure, I only had a textmeshpro to hand to quickly build this
lots of button events get filtered https://docs.vrchat.com/docs/ui-events'
Right, but even a deactivated invisible regular text field would still be updated?
yep
Okay, awesome
Clunky but awesome
Then I could string to int, int to matching int in the player list, then woo
@grand temple Many thanks :)
use int.tryparse
Oh, one small urk, I'd still need player buttons for every player slot wouldn't I? Because I'd need to input the data for the first field. I couldn't just VRCInstantiate a button and change the data within that onClick Invoker.
so just have a bunch of buttons disabled
Yeah.. that's what I thought. Just you know. Say, 32 player world, with the 2x overflow to the hard cap, that's 64 buttons to setup. Sob.
that's not a big deal
Well... one last idea.. split the difference. Use a paginated list.
Then I only have say ten buttons, and keep track of which users are on that page.
With a different ouch being that players leaving/joining would cause a reshuffle
So i got it to work but it seems that it doesn't work to play animations in reverse using a speed value of -1. Do you have a trick to go around this so i could play my anim in reverse? πΌ
use an animator variable for speed instead of the animator speed itself
when you click on a state in the animator, at the top right there is a "speed" property. You can enable a multiplier that can be a variable
Oh nice o__o; Is this something you made for yourself?
yeah
Ah cool! Well, thank you for sharing! ^^
How hard is it to convert a pc world to quest compatibility
not that hard. There are some limitations such as limited transparency/cutout support.
Udon stuff is pretty much the same
Depends entirely on the kind of world
I never quite understood that one, how do you do like... windows, without transparency?
You can fake it with matcaps
I have an issue where I can't click canvas buttons in-game in the world I'm making in SDK 3, any ideas?
Take a look at the common problems in this doc https://docs.vrchat.com/docs/vrc_uishape
Script used to make Unity UI interactable in VRChat. Requires a Unity UICanvas element on the same GameObject. Steps to making an Interact-able UI with VRC_UiShape Add a Canvas using the right-click menu in your hierarchy.Add a VRC_UIShape component to the Canvas.Set the Canvas Render Mode to World ...
How can I globally reset objects in my world?
@dusk lance i noticed the CyanClimbing package is listed as SDK2 prefab, is there a SDK3 version out anywhere?
Is there any way I can call finalIK script methods through udon?
At this time, CyanClimbing is only for SDK2. Other people have made their own climbing systems, but they may be paid. I suggest checking booth or gumroad.
Does anyone know how can I get local player bone positions?
I'm guessing it's something like
VRCPlayerApi.GetBonePosition(,HumanBodyBones.Head);
but I don't know what to put on the first parameter
Networking.LocalPlayer
many thanks
thank you
this may be a silly question but how do i upload my world without replacing the version that is already published?
upload to a different world ID
Is there a way of destroying objects?
yeah, just call destroy
Unity's destroy doesn't work though
how do i change the world id?
click detach in the scene descriptor
can you share the code or graph you're trying to use? It should work
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.name == "TestCube") EarnedCube(collision.gameObject);
}
public void EarnedCube(GameObject obj)
{
Destroy(obj);
}```
In order for oncollisionenter to happen you need both objects to have a non-trigger collider and at least one of the objects needs to have a rigidbody. Is that the case?
Yeah I know about collisions, though I just realized I forgot I set the object with the script attached to trigger lol π€¦ββοΈ
OnCollisionEnter is specifically for non-trigger colliders
Still doesn't work it seems though
are you getting any errors? Directly asking for the name of something like that could cause your udonbehaviour to halt if it hits a protected object
you could filter it by checking if (!utilities.isvalid(collision.gameObject)) return;
No errors from what I'm seeing
Also because I saw it before you removed it, wasnt there thing with "PlayerManager"? I remember that some class names are already taken or used so UdonSharp gets confused. Or something like that.
It was a niche issue a while ago, not sure if thats still the case.
No worries on that, it was irrelevant so I removed it
Also Unity itself would alert you if you used the same class name
Yeah not in all cases. Unfortunately its not all that straight forward.
I specifically remember having an issue with generically named class (Im like 90% sure it was PlayerManager)
But yeah:
- Respect the rules for collisions
- Make sure the behaviour didnt crash
- Make sure your method of testing the collision actually works
(So when you do a Debug.Log, make sure you also run a Debug.Log in Update to both make sure it actually logs and didnt crash)
How do I label this section of code? Like a comment
it gets a bit confusing, ive seen comments in other code
right click, add comment
what is udon
This is extremely frustrating, I've been working on this for an hour now, an Udon graph is working in editor when I invoke OnClick(), but isn't working in game even though I CAN click the button
VRChat removes some button events for security reasons, you may be running into that
You can use Unity UI events to directly call methods for simple interactions, rather than building an UdonBehaviour. However, we've limited what can be called to this list: Animator PlayPlayInFixedTimeRebindSetBoolSetFloatSetIntegerSetTriggerResetTriggerspeed AudioSource PausePlayPlayDelayedPlayOneS...
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...
?whatisudon
Hold on... Maybe my issue isn't with the button itself. Does VRChat not allow GameObject creation using C# script??
no, you cannot upload worlds with C# scripts directly. You must use udon
however, UdonSharp is a tool that allows you to compile C# into udon
Okay, thanks, now at least I know what's wrong
{
GameObject spawnLocations = new GameObject();
spawnLocations.name = "spawnLocations";
int count = 0;
foreach (Transform child in transform)
{
GameObject location = new GameObject();
location.name = count.ToString();
count++;
location.transform.position = child.position;
location.transform.rotation = child.rotation;
location.transform.parent = spawnLocations.transform;
}
}``` So what's wrong with this
I get this error System.Exception: Method is not exposed to Udon: Void .ctor(), Udon signature: UnityEngineGameObject.__ctor____UnityEngineGameObject
you can't create new gameobjects like that
If you need to instantiate, you can do so with VRCInstantiate, which will clone an existing gameobject
any better way to create chairs without taking the VRCChair, scaling and moving it to the correct spot and deleting the model? I mean, obviously there is, but what would that way be? I feel like custom behaviors/scripting with Udon could be just as tedious, but maybe Iβm wrong.
How would I call this U# method from a graph asset (featuring parameters)
Now I'm not creating any new GameObjects, I'm just trying to Find() GameObjects and VRCInstantiate and it still gives the exact same error
are you sure you replaced all the new GameObject() parts?
void Start()
{
GameObject spawnLocations = GameObject.Find("spawnLocations");
int count = 0;
Vector3 position = new Vector3();
Quaternion rotation = new Quaternion();
foreach (Transform child in transform)
{
count++;
position = child.position;
rotation = child.rotation;
GameObject temp = VRCInstantiate(emptyObject);
temp.transform.parent = spawnLocations.transform;
}
}```
And I was gonna drag the emptyObject from the hierarchy onto the script in the editor
I mean, if you're not using new gameobject then there's no way to get that error. I guess clear your log and recompile?
Could Udon be used to make a functional elevator where the door shuts, and the Elevator proceeds to go to the floor it's supposed to go to, open the doors up, and be able to use it again to go back to the original floor?
Yes, that's totally possible. That's probably a decent beginner project
So, i have a manual udon behavior that anyone can call with InputUse, it makes them owner, executes and OnPlayerTriggerEnter only hits non owner, what would be a good way to add a cooldown on InputUse for anyone who has called it recently to prevent spamming?
Seems to work
set a float to time.time and check if time.time-float > cooldown
ahh gotcha thanks!
I can skip a separate object for cooldown and just make a custom event that counts?
sure
using
Quick question for peeps here! Event_OnPickup, does it fire for only the player picking up the item like Event_interact? Or will it fire for all clients in the world when the object is picked up?
only the person who did it
perfect, thanks
How are people making these? Right click Comment just gives a centered text line and it obscures all my noodles
groups seem to work but i cant change their size
Ah nevermind, select nodes then group
Is player TrackingData not consistent between desktop and VR? I'm trying to track the head position for a portal camera, but it's coming out off-position in VR.
You would have to open the uasm asset and find the udon variable that it compiles into, which is fragile because certain changes in the script could cause it to compile to a different variable name.
The better option would be to predesignate a variable to act as the method parameter and be used by the method in place of the usual one.
Attached is how I would write it using an IN_ prefix to denote the variable as one that is used explicitly as an input to an event call. To call it, you'd do UdonBehaviour -> SetProgramVariable [target, "IN_PAUSED", true] then UdonBehaviour -> SendCustomEvent(target, "_SetPaused");
(Ignore the red squigglies, cba to type out all the objects).
Might be because you don't set a value on PickupUse* events
gotta connect a const value to the value input
boolean const true or const false and attach those constants to the value input
Does the owner of a gameobject also become the owner of the UdonBehavior on that object?
yes. Only the behavior on this GameObject. Not it's children
Excellent. Thank you!
Unfortunately external url texture with VRC_Panorama is not working with android build ( for quest 2)
- although it works with windows deployment
Is there any material or texture optimization that we wanna do to make a texture quest compatible ?
couldn't figure our why it happens
Hello there, i'm just kind of reposting my message from #world-development here, trying to be more specific.
Is there a way to add 2 different interactions in one component depending on the platform the user is on ? For example, a door handle that could be grabbed in vr to trigger a sliding door that would just be a trigger opening the door automaticaly in PC ?
So I currently have this Udon graph to change the mesh renderer from a material already in the world. However, I also want to use a material from Dynamic Materials as well but I have no idea how to do that. Any help?
don't use dynamic materials, that's an old sdk2 thing
So i'm gonna have put the texture on a plane and then just grab from there instead.
just make a public material variable and drop it in the inspector
How would you do this? I'm very new to udon and don't really know that much
Like this?
the name doesn't matter, I mean check the public box in the dropdown
Ok done it
now it 2ill show up in the udonbehaviour as a slot you can put anything in
I don't see any new slots
Oh wait nevermind just needed to compile
give me a moment to sort it and i'll see if it works
I think I am still a bit confused, may try again later
Hi I followed a tutorial to create a URL player with play/pause, volume control but the volume is the only part that works! the play/pause dose nothing and loading a URL just freezes the current playing video! can anyone see whats wrong?
There is no UdonExampleScene in the VRChat Examples folder?
Have you made sure that the buttons are calling the correct sendcustomevent's with the correct capitalization and everything?
will check that over now! thanks
ok that fixed the play/pause button! had a cap L in play by mistake! load URL still not working so gonna have a look and see if i can see whats up with that part of the graph?
nope no idea why the URL is not working? back to reading docs i guess
Is there even any way to automate object position reset in Udon?? I ended up writing this script that should automate creating empty gameObjects where the spawn locations would be, with an Udon graph that teleports the objects to those empty gameObjects. Now it works half the time, and they teleport very slowly. public GameObject emptyObject; void Start() { Debug.Log(transform.childCount); GameObject spawnLocations = GameObject.Find("spawnLocations"); int count = 0; Vector3 position = new Vector3(); Quaternion rotation = new Quaternion(); foreach (Transform child in transform) { count++; position = child.position; rotation = child.rotation; GameObject temp = VRCInstantiate(emptyObject); temp.transform.parent = spawnLocations.transform; } }
hey im kinda new to unity and i was wondering if there is like a way to union diffrent cubes together
That's typically something you would be doing in a 3d modeling program like blender, and then you can export the model to use it in unity
oh ok ok ill model the road in blender then!
thanks for the help!
appriciate it
sure, just replace playerapi set velocity with rigidbody set velocity. Make sure the object has an objectsync on it and then also make sure you do setowner
Yup, there is a 'PlayerApi.isUserInVr' node. An example of that script would be something like:
How would I get every instance of a component in a scene? Say, for example, every MeshRenderer component? Every time I try an alternative method, I receive an error that the method isnβt exposed by Udon
you're welcome!
hey so is there a way to fix the βunusual client behaviorβ
and thats a ip grabber
anyone?
That sounds... destructive. Perhaps this will be more useful. This example script grabs the mesh renderer of every child of a public gameObject and turns it off. With it, you could grab all the objects you want to toggle off their rendering, put them all under an empty and use a button to toggle them all off
Awesome, thank you very much for the help
np ^^
hi I'm working on a game i no next nothing about udon it's a gun game i have the map made it;s just coding i'm stuck on could someone help where i should start
i flicked throught it but he did not really explain it he just kinda did it i'm trying to remake steel n gold but know nothing about coding
@reef nebula u have been typing for soo long
current it is getting the player's velocity and adding onto that, then applying it to the rigidbody. You probably want to add onto the rigidbody's velocity instead
that doesn't really explain why it would do nothing though, it should still move it just not how you want
have you assigned a rigidbody to the "fighter" variable in the inspector?
is the rigidbody set to kinematic false?
kinematic true will disable physics and setting velocity will do nothing
if you don't want it to have gravity you can disable gravity
probably want to add a bit of air resistance unless you want it to keep flying indefinitely
that will prevent it from speeding up beyond 50, but that will not slow it down
I don't know if someone from the support team can talk to me now
it's a value on the rigidbody
anybody please
if you need help from VRChat support you should contact them at https://help.vrchat.com/hc/en-us
yeah but what I want to reports is complicated
either way, this is not the appropriate channel for that
Tf is UDON
?whatisudon
like target crash one person (me) from a map and when relaunching the game return to the same map it instancrash again
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...
@blissful shore how would i make it so when a animaion plays so does the particles at the moment when i run a ani atm i have the gameobject it is in just turn on and off but after testing my bool it dose not render the partical more then once
I don't know who to talk to and what category to report it
and if I can talk in this server of this
You should use particlesystem.play instead of relying on play on wake
ooo thanks i was looking for something like that did not know what it was called thxs
is that for udon or the animation tab cus i can not find it in the add propertys
animations can't do that, you'd need to do it with udon
ooooki
It doesn't appear that Udon offers many methods to arbitrarily find and return one or more components/GameObjects. I'm trying to add a component to all players at runtime, but I can't seem to find a practical way of accomplishing this. Does Udon not intend for this kind of usage?
I guarantee there's a way to do what you want, but not specifically through adding a component to a player. There is gameobject.find to find some object by name, but that will not give you players because players are protected and cannot be modified by the world. Furthermore, adding a component to an object is not supported. You can instantiate objects as a copy but be aware they will not have any networking capabilities
how would i add the partical.play
Oof, well, that settles it, then. What I'm trying to do is impossible. Thanks for letting me know
typically if you want to give an object to each player you would need a player pool that automatically assigns objects as they join. If you want to then attach those objects to players you can simply set their position on update
Add a new variable of a particlesystem. Make it public so that it shows up in the inspector. Then search for the particlesystem.play node
Hm, that's good to know. Unfortunately, since I'd need to modify a component on a player, there's not much I can do at the moment. Thanks for the advice, though!
but what component do you want to modify?
if you give some details about what you want I may be able to point you in the right direction
MeshRenderer to allow LightProbeProxyVolumes
For higher-fidelity dynamic lighting. No idea why it isn't a feature by default
ok that's fair
so like this but how do i connect it so when the ExplodableBarrel animator is true they both play at the same time
connect the arrows with the white lines together. That is called flow and determines the order in which things happen
so conect it to the setbool one?
yes
urrrrr? i'm sorry i'm still lost
connect the white arrows together
i did
and how does it look now?
yes, that should work
make sure that the particles are enabled and do not get disabled by the animator
vrc need vc chats here
non-convex mesh colliders don't work on rigidbodies. Set it to convex, which will simplify it
transform.rotation
you can get and set transform.rotation, though you probably won't want to directly set it because that will spin way too fast. You could instead use Quaternion.Slerp and provide the current rotation of the rigidbody, the desired rotation of the rigidbody, and some very low number like 0.05 which will determine how much it moves per frame
have you enabled the particles? In the latest screenshot I can see that they are disabled
yup
does the animator work?
in both directions - turning it on and also turning it back off
could be something wrong with the particle system. What does that look like?
also woah, you have two scenes. That's not supported for a VRChat world and would probably prevent you from uploading correctly
I'm trying to port a world from SDK2 in which an animation plays upon interaction with a part of the world and makes a game object active. I've gotten the former to work, but every time I try to add the object enabling, the whole thing breaks, possibly because said object is part of the armature doing the animation
i know i'm just playing with a prefab under the project
is it cus the bool is in the animation
how are you trying to add the object enabling?
I see nothing that would prevent that from working. The animator is not touching the particle system. Does the particle system play when you manually click play? Does it not have emission or something weird?
Mostly through the GameObject.Set kinda commands
just make sure you're plugging in a valid gameobject and it should work
Like this?
yep!
it plays fine when i push play
how exactly are you testing this?
CyanEmu
CyanEmu pushing toggle on the event
Also that
you
CyanEmu pushing toggle on the event
@grand temple Also it seems that the anim is working okay, but the object isn't spawning
honestly I have no idea why this would break anything but just to rule out any weirdness, try unloading the other scene entirely and use VRChat to test instead of cyanemu
i did
you disabled the other scene. Unload it
u sure the graph is right the bool comes from the animation controller
yup
did that
@civic birch what r u making?
A machine the dispenses a piece of gum, the anim carried over fine from SDK2, but I can't seem to enable the gum object via Udon
It's supposed to do this when I click on a part of the machine
did u try maybe just an animation to toggle it on and off with a bool
Not sure that would work as it's part of the machine's animator
But I am trying to use a bool in Udon to toggle it
I'm wondering if there's just a reeeeeally specific thing I'm missing
does the animation forcefully disable TCGum?
Branches are the equivalent of an if statement. Isvalid is checking whether or not something is valid, and bools are always valid so that will always return true
Nope just moves the bones
How can I check if something is true or false then?
with a branch
OH
TCGum was also the means of deactivating the machine in SDK2 as its own trigger, so I enabled and disabled the object itself
do you have any udonbehaviours on TCGum?
Not yet as I'm stuck on the "turn on machine" part
do you have any other udonbehaviours that affect TCGum in any way?
I can check for leftovers from SDK2, but that's about it
Nothing here
you have slerp, but not doing anything with it. You need to slerp from the rigidbody's current rotation to the pickup's current rotation. The resulting rotation should be plugged into a rigidbody set rotation node that happens after you set velocity
actually moverotation I think would be the best
yeah, you can start here 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...
however that mostly handles the vrchat-specific parts. A lot of this is actually straight out of unity, so you can also reference unity documentation for things like rigidbodies https://docs.unity3d.com/ScriptReference/Rigidbody.html
I'm about to lose my mind over a piece of virtual gum
@civic birch @slate orchid I'm not sure why you're having issues, those both sound like extremely simple things that shouldn't be having any problem. I would recommend trying to recreate the same scenario in a fresh scene where nothing is happening except this one udonbehaviour and animator. For good measure, you can also take a look at this page and make sure you're not getting any errors. https://docs.vrchat.com/docs/debugging-udon-projects
You could also try adding udon debug logs to make sure that things are happening when you expect them to
What is Debugging? Debugging is how you learn about what's going on under the hood in the VRChat client and your world. It's a key skill to develop for programming in general, and for building your worlds. VRChat Logs When you use the VRChat client, it saves logs about things that happen like worlds...
i got it working but....the particles goes off a good few sec before the ani
you can use sendcustomeventdelayed to delay things
shouldn't i have everything done in udon instead of turn stuff on and off in the animator
depends how you want to do it
is there a easy code to toggle a bunch of verbal's at once
if it requires a bunch of complex timing and moving objects to specific places, it's easier to do that in an animator. But if it's just enabling and disabling some objects that's easily something you can do in udon
yea i am just disabling some objects
you can create a Gameobject array (it looks like Gameobject[]) and that can contain multiple gameobjects. In your udonbehaviour, you can use a "for" node to loop through that array and apply some change to each of those objects individually
so all iwant is for the audio to play amd then the mesh and collder turn off and particles turn on
I got it! I got it!
do you know what the issue was?
I essentially needed to negate the bool that was keeping the object inactive
that... doesn't make sense but ok
Odd... it isn't giving me the option to edit interaction settings
do you have an interact event?
Added it oops
forgot this was just a custom event
How do I remove interactability from an object?
@grand temple this worked but i just need to workout when i push it again go goes back to it's default state
Nice, thanx a lot ! :)
Hmm, I can't seem to be able to interact with TCGum when testing
Do I have something set wrong?
nvm fixed
Still need to do this tho
enable disableinteractive
Tysm
Is that for the object itself or the UdonBehavior?
it's a node that affects the udonbehaviour
Am I missing a piece?
Wait found it I think
weird to use unarynegation like that, just use a const bool
@grand temple can i get some help about setting everything back after pushing the toggle again
ahhh I should really be going to sleep πͺ
try searching google or this channel for previous questions and answers
hi is anyone able to help me
I don't need this info right away, but does anyone know how to make an object work as an avatar pedestal without showing the preview image? Could this be done just by Udon or can a pedestal activated remotely accomplish the same?
I plan on making this a toggleable easter egg
can i plz get some help
Trying to get a raycast to work (just a simple gun), but for some reason this script seems to crash after the first shot
I wanted more info for why it might be crashing, so I did it in udon#, but this one doesn't crash, but it seems to be working... kind of. there is a massive delay between shots, and/ or it almost seems like I have to move the gun around like I have to dodge the old collider. unfortunately, there are no error messages... any ideas what I'm doing wrong?
It shouldn't need a const bool value, and wanted to setActive to false not true. Did realise I didn't check if the raycast hit anything on the udon graph, and thus it might have been crashing if it didn't see anything, but that doesn't explain the weird behaviour with the udon# script
perhaps somethings wrong with the use in the world... eh, tomorrow's problem
I'm in a world of udon hurt my self trying to make a spacechip fly
"attach to me" package works when "I build and Test" when I try to publish the world I get this Error ... PLZ HELP!
does this error stop the build/upload?
its doesnt allow me to type my worlds name n click on publish button ]
do you have Error Pause in your logs enabled? if so, disable that
how do u do that?
look at the console tab, there is a button with that label
It worked β€οΈ Thank u
nice! you are welcome
what happened: you had a false-positive error caused by vrchat's sdk going to play mode but player contexts were invalid there thus the scripts failing and if you have the error pause on, it will somewhat halt the upload, a bit silly
ikr hahah thanks to u mate
Why do Udon# scripts sometime close up like this?
Unity restart fixed it
Weird bugg
how can i get/set the public variables from the VRCWorld component in udonsharp?
the scene descriptor is not exposed to udon
so it's not possible to adjust a player's walkspeed in-game?
you can adjust that, but you would not do so through the scene descriptor
you would do so by getting networking.localplayer and setting runspeed/walkspeed/strafespeed
cool i'll try that thanks. can you also get the player avatar's height like that?
the script on the vrcworld that does that is simply an udonbehaviour which applies settings like any other udonbehaviour can
depends what exactly you need. You can get the player's bone positions or tracking data and compare the distance from root to head
though if they crouch it will be inaccurate
well i saw these mirror buttons that adjusted in height depending on the height of the avatar you were currently using. i wanted to try and recreate that myself in udonsharp
I'm stil working on this one @grand temple . All the ship does now is float in space (its kind of Calming actually) how ever grabbing the flight stick and pulling the trigger does nothing.
you're not doing anything with the slerp
what should I put on slerp? how do I utalise it ?
A is where you're slerping from, B is where you're slerping to
you want to slerp from the rigidbody's current rotation to the pickup's rotation
that will give you a resulting quaternion that you can then take and plug into a rigidbody move rotation node
use A and B inputs
how do you transfer ownership of an object to another player in udonsharp?
tried this but got an error
Networking.LocalPlayer.TakeOwnership(transform.gameObject);
are we there yet? @grand temple
you're using a and b now, but they're going in the wrong direction. You want to slerp from the rigidbody's current rotation to the pickup's rotation. So you need to flip the A and B
Use Networking.SetOwner