#udon-general
59 messages · Page 8 of 1
Yeah udons search functions is bad
And then one more question, the string concat looks like this:
but i need it to look like somewhat this:
but still have (Object, Object)
I just need the input & output arrows
There should be overides, click on the drop down
is there an event for when i click on a gameobject in the editor window? im wondering if i can wire this toggle button to mouse click so i dont have to launch the game to test if it works
Well. There is a thing that let's you cast a Ray from camera to cursor position and mby with that you could get the component and call the function on the object. Can't remember the name tho. Google is ur friend x3
Having trouble with Spawning a synced prefab in Udon. Does anyone know some best practices, or if it's even a thing we can do yet?
wait is GetComponent exposed to Udon?
this channel is for udon not udon sharp, you should ask those questions in the udon sharp discord
but for that you need to use
(UdonBehaviour)GetComponent(typeof(UdonBehaviour))
for getting UdonBehaviors, other components will work normally
not sure how to put that as a method of ClickedGameObject, but ill go ask around about it in the U# discord
(UdonBehaviour)(clickedGameObject.GetComponent(typeof(UdonBehaviour)))
Ah, thanks
looks like raycasting from the camera via mouse position isn't possible in udon, neither the mouse position or the camera are accessible
im wondering if i could just toss it in as a regular C# script instead
Excuse me, what's a good way to recognize hand movement? For example, the hand moves from up to down. [Don't mind using the trigger button]
oh weird this wasnt here before
@solar glen I haven't played with udon enough, but maybe these two nodes will be useful?
I have question for anyone, I setup the UDON project so my avatars can jump but when I tried to add run and walk increases it negated the jump. Should I make a separate UDON project for each (are they called projects or nodes?)
udon doesn't work on avatars, only worlds...
Sorry, I mean to say I set the parameters so that avatars can jump in the new world
I found that if I do not add it jumping will not be available
yeah you have to manually set jump impulse
@strange berry You can set these parameters in VRCWorld
it was like that in SDK 2 but you had to use player mods there
Question. How exactly would one replicate the use function on VRC_Pickup like in Udon? Specifically, this-- https://i.imgur.com/0TZx3K4.png
I've got my controller working for these Azur Lane style rigs for player working but I can't for dear life, figure out how to replicate on the use trigger.
Oh nevermind, I think I found it.
"On Pickup Use Down" I imagine it is. xD
Hmm. That perplexes me then. Because this is how I have the basic controller setup for the rig vehicle I've setup.
https://i.imgur.com/K5T7Cdc.png
How would I get the use message translated into Udon? Or am I overcomplicating it?
I set the weapon to have the box collider only on the hilt
I can pick it up and throw it down and the axe can get buried into the ground
Mm. I see. I understand that part but, I'm trying to use this controller to set the forward movement.
ok
Anybody aware of something that in udon or VRCPickup that would force Rigidbody.isKinematic to be false? I'm trying to toggle it on in a script, and it'll toggle inside the event code, but isKinematic immediately gets reset back to false by ... something. the rigidbody in question does have VRCPickup and an Udon script with sync position on it.
Turns out that it's UdonBehavior's "synchronize position" implementation. It forces isKinematic to false somehow; or maybe it forces it to match what the object was originally? In any case I can't toggle it for a position-synced object, yet I can for an identical unsynced object
welp, I wonder if I can implement 'synchronize position' better with just regular synced variables
Whats the input for VR controllers? Like to tell if they hit the touch pad or triggers?
https://media.discordapp.net/attachments/657394772603830360/698486962306154516/unknown.png
Still wondering how to delete objects!
Can anyone point me in the direction of picking up objects and using them? I.e. Pens
add vrc_pickup to an object
if you want to use the input when the player is holding it, put the "onpickupusedown" function in an udon script
@solar glen I haven't played with udon enough, but maybe these two nodes will be useful?
@silent mortar Thank you
When I name the object I want to remove in Object Destroy it names itself back to default. Is this an UDON bug?
My windows also keep removing text from the boxes when I press play.
I'm new to Udon. Is this correct? I'm trying to understand it with simple things. I just want an audio to play when a player joins the world.
@wide salmon That looks correct.
for some reason, the sound doesn't play when I join myself. I'll test with some friend. thanks.
oh ok. thanks for the info. will try that as well.
Yup, this one works. Thank you again.
Trying to whip up a variable display in udon: is there a way to concat a newline special character in there so my text box is remotely formatted with linebreaks?
Could I get some help with Animation Bools? Not sure what I'm missing exactly to toggle the bool.
click the dropdown and change it to a string
OoOo. I assume then from there, I just add what Bool I want toggled, correct?
Wonderful. Thank you very much~!
quick question! can i have a block going into a block? for cleaning up the noodles puspose...
\n doesn't work :c
maybe i'm supposed to be adding it to the string some other way?
another question: Is it possible to make separate udon scripts interact with each other? Eg: I have a row of 5 buttons presumably each with an udon script on it that handles the oninteract event. I need to find out which one was last pushed so I can undo the actions the previous button performed before activating another button.
or maybe best phrased like this: can i set a variable that exist outside of a udon script?
can i recive player voice chat from point A and output to point B
about Broadcasting room something
@silent mortar Text you type into the string boxes is considered "escaped text" meaning that it wont treat characters specially \n will just be "\n". To get a line break you could use the Convert.ToChar method using the code for the EOL (end of line) character which is U+000A so 10 as an int => Convert.ToChar(10)
Were video players etc broken for Udon based worlds, or was there some sort of work around?
Video Players are not supported in SDK3 yet, so there shouldnt be any Udon worlds with VPs.
You can use the video component, but that requires some “hacks” to get set up. It would also not support YouTube.
They’ll get it added at some point
hope so ❤️
Excuse me, 😭 how can I receive the VR controller button,What are the names of VR controller buttons,I tried to use joystick, but it didn't work
@solar glen It depends what you need them for, but here:
https://docs.google.com/spreadsheets/d/1_iF0NjJniTnQn-knCjb5nLh6rlLfW_QKM19wtSW_S9w
VR controller summary
This page is a combination of the other pages. These
inputs are verified to work on every known controller, and
in cases where they don't an alternative is provided.,Use this world to test:
https://vrchat.com/home/world/wrld_f8d5f7e4-185c-4b82-8ecb-8a...
@fiery yoke Thank you
There is a lot of things to consider when it comes to VR inputs tho
for example Vive has two different modes, standard and advanced. In advanced you have to press the d-pad once, and then it reads the touch capacitive position for movement. In standard you have to press the d-pad into the direction you want to walk in.
So you may get different behaviour for different VR controllers, and sometimes special considerations have to be made
Thank you
Hey guys, is there anything like a repository of images or scripts that show how to simulate the old trigger functions with Udon? As a non technical person, I'm finding quite a roadblock in trial and erroring nodes until I find the one I want!
@oak marten https://ask.vrchat.com/t/vrc-triggers-udon/196
You absolute beast, Happy Easter
Not written by me. Was written by jetdog8808
Say if my world just has basic OnInteract triggers, am I better off using Udon for better performance? Asking since I may end up adding a lot of pick ups to the world
I think for basic behaviour, Triggers are better and easier than Udon.
Ok thank you for your answer
Wouldn’t be a bad idea to go Udon either
Just got to be aware that it is Alpha. So it will change.
Yea, i may try to switch to udon regardless just incase I decide to add something more complex later
Well yeah SDK2 is considered deprecated afaik, so Udon is probably the better choice in any case.
Does udon support VideoSyncPlayer and the usual RPC calls to it by buttons?
Hello All, I am pretty new to Udon but How does one change the interact text? It says "use" but I know there is way to change it. But I do not know how in Udon.
on the top right hamburger menu in the inspector, you can change to debug mode and change it there
so im trying to get the input to work, im not sure if im doing it right. This is what i have so far https://gyazo.com/a37a22c9c50041bc7beb62b7f3b7786d
Oculus_CrossPlatform_PrimaryIndexTrigger is the name im using for the input
trying to make the left hand teleport you to 0,0,0
so does it not work or what?
nope
if that should be correct, i could try building it again several times, that fixed an issue before XD
yeah udon graphs don't always compile. You could make sure that it does by adding a new public variable and seeing if it shows up in inspector
@grand temple Thank you for the tip, I got it 🙂
ok, and just to be sure theres nothing special i need to enable to use the controller inputs right?
no you should be good
as long as it's typed correctly
Oculus_CrossPlatform_PrimaryIndexTrigger
i copy pasted it from the document thehelpfulhelper posted
@warm goblet the SyncVideoPlayer script is not even included in SDK3 yet. So no you cant do anything with it right now.
the opGreaterThan is basicly x > y where x is the top value and y is the bottom value, right?
yes
you might want to do greater than 0.5 or something though because greater than 0 will be very sensitive
just barely touching will trigger it
not sure whats going on then.....doesnt seem to want to work >.< i rebuilt it 4 times and varified it compiled
ok @fiery yoke Thank you. Do you know if Dynamic GI ever got fixed? If I recall the only issue is VRC_CustomRenderBehavior hadnt been whitelisted which they said it should have been.
well ya, so it should like almost suddenly teleport me or keep doing so
but nothing happens >.<
its not in SDK3 yet either.
ok. it seems the script is though is why I was confused.
dang I really figured theyd get that before the public betas even
is there any way to multi-edit Udon public variabls like you can in usual unity components?
No that would probably break it.
v_v ok
looks like I cant do any of my ideas yet. I'll come back in another few months :P
If you have to edit a MASSIVE amount of objects that can be done in an automated way, then EditorScripts is your best bet
I am not sure if the the interaction button local by default but I do not see and option to make local on Udon unless they are default.
Is it local by default?
hmm... is there any other way to force Dynamic GI to update? I tried animating a black directional light but thats not working
@true hawk Everything in Udon is local by default.
@fiery yoke Thank you for update! I am current recreating my spawn world, so I am making sure before replace it
ya i cant seem to get that controller input to work, i tried attaching the output to a converted string so i can see the value, and its just null or breaking
Has anyone managed to make an editor script that makes udon sub-programs?
eg: Create a bunch of ui toggles and automatically generate an udon graph to udon to make them do stuff
aaaand it just works now....with no change.....this udon stuff is gonna make me go bonkers XD
i have a theory, i should shut down the vrchat instance i just build before opening a new one
i have a feeling even with it complied, its probly loading an older instance
So I have this toilet teleporter with OnTriggerEnter, but for some reason when a player goes into it, it also teleports everybody else who is in the world, how do I make it local and that it would only teleport the player who goes inside of it? 😄
OnTriggerEnter won't work for players (yet)
You got to create your own player detection
I made the same mistake: You need to put Cube on a layer which only collided with playerLocal layer
so, i made a script where i have a game object tracking the player, and i have a cube offset by 3 from their head. I then have a teleport script on that cube such that when they click, it should teleport them to the cube. its instead flinging them forward quickly, then as soon as you let go you get flung backwards very very quickly. Do you have to change the locomotion or somthing to use teleport to?
So I have this lift that goes up and down and I want to sync it with everybody in the world should I use the Udon behavior Synchronize position checkmark or VRC_ Sync animation script does it matter lol?
you only use the Udon behaviour to sync
alright thanks 😄
It is normal for the test to be behind the avatar image in Udon?
I can bare see the text since it is obscure by the avatar image
barely*
text*
wait are you trying to upload avatars in udon?
no
world creation
with avatar pedestal
when hovering over the avatar pedestal, the text to see the name or "use" is obstructed by the avatar image.
lemme check real quick
Thank you for the helping
i just tested it, the issue didn't appear for me
what does the component look like?
I followed a tutortial on just creating an interactive button
then attacted the base VRC pedestal
it does change the avatar though, right?
yes
just the text is obscured by the iamge of the avatar
old version the text is on top
then again the old version used a capsule collider
maybe try a different layer for the object? udon doesn't really give you a way to affect the actual shaders and stuff so thats my best guess
I am chreaking again.
checking
So the text on the controller is working just fine, but the text on the pedestal is in the middle of the image so the text is hard to read.
@nimble thunder Something like this
is the transform for the pedestal the same as the one it's on?
i mean the pedestal component
is the transform just set to itself?
I did used a base "cube" but had the same issue
I reduce the size by 50%
@nimble thunder I change the local Scale to 0.5 on XYZ
on the original cube?
yes
okay, see if you can make a new object with the same size, then copy the component onto it
it might be that you scaled it after you put on the pedestal that's screwing it up
okay I will try that and will report back
ok
@nimble thunder Looks like the name is attach the cube and not placed on top of the avatar image
the cube was reduced by 0.5 on XYZ
then placed all components for the pedestal
ohh, its because the cube is what you actually interact with
yeah, you can probably make the cube just a small plane with a convex collider
I did notice the old pedestal has a capsule colider
yeah, that's most likely why
okay I will play around then with the the collider and different shapes
take it as a sign to get creative too, you could always make the picture appear somewhere else and you press like a sphere or a button that does the trigger thing instead
a lot of this new SDK right now is figuring out ways to work around the bugs
yeah, i actually came here to try to figure out a work around for a wing cap/elytra sort of thing
the major issue right now in udon is randomly just having certain nodes make the script stop entirely
like setting variables is just sometimes broken
wow sound complicated, I am not of a programmer but I have sene people open on VS Codes or other compliers to see the code itself
also thank you for the tip on the collider, it fixed the problem @nimble thunder
Understood
so uh anyone have any luck with getting velocity of a player and printing it?
for some reason it just does not save my changes if i try to do that
through a pickup, specifically
is there a way to automate the creation of hundreds of udon graphs? (i've got like 400 buttons)
Write a script that converts it to uasm
oof. this is starting to sound like factorio, except I gotta design my own transport belts and inserters.
fml. i'm not a wizard level programmer.
in a nutshell: unity ui menu system that drives a dictionary. Trying to replace the vrctriggers in my current editor script with udon equivilants
You'd probably better of creating a new system and move a lot of the logic out of the buttons then
I've seen advanced menu systems that only use a few ui buttons
each button = different word, so it needs to activate a gameobject containing a video, set animationint on an animator, set text and so on...
The UI I posted has different words, changed when the list is changed, pagination
All the buttons have their own IDs
then the Udon script takes care of the logic to know where in the list/page it is
So you can pretty much move all of this over to a text file
then parse that
wonder if each button has its own udon graph?
In this one yes, because we can set the button properties.
Once we can set the properties in Udon, then those will be removed
But for now, the buttons just do Interact() on the Udon
And the Main manager gives each button their own ID at start
How is your layout of things?
i guess i'm struggling to see how the main manager responds to the interacts of the child buttons?
Button -> Button Behaviour -> Main Behaviour
what do u mean by layout? If you mean how the menu is laid out: language select > lesson select > word select
Yeah, what does it look like in game?
i know it looks pretty primitive lol
but that's the lesson select menu, under that there's more buttons
I have a github of the editorscript that generates all that if you feel like poking around in my noobish spaghetti code. It uses vrctriggers currently. I'm trying to learn how to use udon atm to potentially be more efficient in my triggers. (currently it has no way to determine which word was last used, so when a word is selected, it disables all gameobjects that do not belong to the word that is selected), so I guess with udon I'm hoping to have a "currently playing" variable which deactivates what it needs to when a new button is selected.
Yeah, looking at this, you should just have a list of buttons ready. Enable/Disable them based on length of the list.
Then have the fields be populated dynamically when you select a menu
so what your saying is to generate the menu during runtime instead of "baking everything" into gameobjects to be enabled/disabled?
Somewhat yeah
Make it dynamic. So each button don't know what they have on them
then have the Manager tell each button what to fill
hmm... interesting. Happen to know if udon supports a jagged multidimensional array?
Not yet
But what you can do is store each page in a text asset
then the asset name is the Page name, and in there you just create a good way to read and split the info into where it has to go
So example would be;
Daily_Use.txt
text|icon_name|video
Then you use that info to fill out the buttons.
hmm what udon node takes in text assets?
TextAsset
ah and I then just drag the text gameobject into that as a variable
yup
oof i just crashed udon/unity by attempting to stick | in a string seperator
You can use what ever, just got to make sure it doesn't collide with anything
Question. How do I set an object to face the same direction as a player is? I made this controller that allows a vehicle to move on pickup_use however, I just can't get it to rotate the same direction the player is at all.
update?
Stay on 4.20f1
ty
Hello , any VRCSDK3 / udon compatibles Pens or keybords like this :
https://chiugame.booth.pm/items/1135731
or this
https://booth.pm/en/items/1555789
[English] Here are the text chat prefabs. All you need to do is add the prefab to your scene. Standard Assets is required. このパッケージはVRChatでテキストチャットができるようになるプレハブセットになります! 通常(無料)と投げイワシ(Boost用)がありますがどちらも同じ内容なのでご注意ください!
The ones i found are just compatible 2017.4.28f1 and use Standard Assets It seems to me
Is there a vrcsdk 3 / udon compatible solution or equivalent?
Or is there a way to adapt them?
It seems to me that Standard Assets no longer exists for unity 2018.4.20f1 ?
Thanks in advance
Best regards , Stephane
is there a way to invert a boolean?
Boolean Unary
thank you!
Ok i got a fairly advanced question, hope any of you able to help. I need to translate a objects location/rotation/scale based on the relative difference between the previous and new location of a reference object (imagine the same behaviour as if you translate a object with a child and the child moves with it). I can figure out moving X/Y/Z easy, but the rotation/scale part eludes me. Maybe matrix4x4 would work?
Why not just simply have an actual child and grab the position and rotation from that object? :P
@fiery yoke that does not allow the same flexibility and doing it with synched objects has never worked well, that and players are not in a hierarchy.
If youre trying to make a player move with the ground they are standing on...thats rather complicated to get right
currently i am just tinkering with a chessboard as example, but i am making the code for general purpose not a specific use case.
so simply what i need is to replicate the same code/behaviour into udon
the same code of a chessboard?? I dont quite get what youre talking about
nope of object and child translations
it's not rocket science, but my only current solution is to follow the only way i know and that will take 4x more code than for x/y/x translations alone
meaning it may take me 2 days to make it work
so from my understanding you want to "parent" something without actually parenting it in the hierarchy?
replicate that behaviour
yeah you'd just need to get the transformation matrix of the parent object and then multiply that with the position of the new object
Well that is what i believed to, but i cannot find a operation to do it with
it should be transform.getLocalToWorldMatrix
Or just use the parent constraint component
Oh so @tame matrix i get the world matrix of each to get the relative from 0, and then OP multiply matrix4x4? but will that work for relative rotations?
it should, you might need to do some math to get the proper offset between them though
@tame matrix i am having a huge hurdle here, the matrix4x4 set value only accepts arrays and i cannot find a way to get a game object to become a matrix4x4 array...
What's wrong with a parent constraint like Phasedragon recommend? Sounds like your trying to reinvent the wheel
you don't need to set any arrays, just multiply the position by the matrix (you'd need to convert position to a vector4)
yes but i need to place the resulting matrix some place right?
no when you multiply a matrix and a vector you get a vector
you use then use the resulting vector as the position
yes but i have no place to put the result i cannot find a set value to use.
also yeah the parent constraint component will pretty much do the same thing (not the scaling though)
you do transform.setposition after multiplying the matrix and vector
Since parent constraint doesn't use scale you can just use a scale constraint with it
it would scale differently than if you parented it with scale constraint
cannot find a matrix4x4 get position
I'm pretty bad at explaining so I might've made it a bit confusing
So for the parent object you want the transformation matrix so you'd do [ParentObject].transform.localToWorldMatrix
then you want to get the transform of the object you want to do the following with which is just transform.getPosition you'd then want to make it into a vector4 to multiply with the matrix, you might need to also translate this vector to get the proper offset between the objects
then you multiply the matrix and position and with the resulting vector4 you set with transform.setPosition
@tame matrix sorry to be a bother, but i am having a hard time getting my head working around it, this is the best i can manage right now and i feel like it all wrong.
What i am looking for is to have the start/stop as a change refferance, and then set that change into the "relocate_this" variable effectively making it so it at a relative position and angle follows the "end".
Having it work for scale would be a nice bonus.
I am going to have to redo the entire thing from scratch as not even the variables working properly...
Is there a way to get raw controller input yet? Or at least raw joystick/touchpad data?
Use Set Active
is that it?
Hello
Hi guys, super nub question. I am trying to create a variable to use for the scale of an object. Scale is expressed in 3 separate boxes, and I am not sure which variable type to use to match this. (string, int, boolean etc) Expressing it as a string 1, 2, 2 doesn't appear to work
Hello there, sorry if this question has been asked before, but I wanted to know if there is a way to get the interact function to remain active while the player is clicking on a trigger. I want to make an object rotate while a button is being pushed.
Is rotation synced for all players?
@flint urchin i need help with your Teleport Example
It’s on the UdonBehaviour
So I can just tick this box for randomizer spawns also?
I don't usually mess with the inspector because it seems buggy due to it being an alpha
Inspector is fine
I'm assuming there's an alternate way to sync objects using nodes
You can sync if yourself yeah, but not recommended
I'm unable to specify objects I want deleted without it reverting the name back to default
so I've just been working on other stuff
but the graph is definitely buggy, nodes will remove text when I press play
Like setting destroy to the name of the object in the Hierarchy
It almost feels like UDON# might be more efficient for world building haha
I can get the rotation I want with this node setup by pressing arrow keys, but I want to replace that with a clickable object in the game
I don't have expeirence with udon yet but what about making a global variable that is then plugged to the branch?
thanks, I'll try that👍
I was wondering thought if someone have already tried to scale avatar collider with avatar size so the collider is not always the same (aiming at small avatars mostly)
you can't access the player collider directly, or anything under the player hierarchy for that matter
for security reasons
I see
but still I'd love to see this as a toggleable feature (in worlds) at some point
there's some tricks you could potentially try for it
you can get bone positions/rotations, so you might try getting the vector3 for the head and foot position and scaling a collider you move with the player based on the distance between them for example
I was working on a custom controller for a while that had that feature, however the project is more complex than I thought. And I already knew that it was going to be very complex...here Im showing it in Desktop, but it also works with any height in VR:
https://discordapp.com/channels/189511567539306508/657394924433571870/696123918683078736
O that thing is cool
@flint urchin Where Exactly do i input the Transform Coordinates
If you've done exactly what I did on the example on the forum, then go to the gameobject where you got this graph, then in the Inspector window (right side) you'll see a field "Target"
found it thx
@flint urchin is there Also a way to change the text it displays so it could say where it sends you to
You have to enable Debug mode in the Inspector to do that at the moment (hopefully that'll change)
You can do this by right clicking on the Inspector tab name and click Debug
then at the UdonBehaviour, you should see "Interact Text"
Thx
Trying to get an object to face the same direction as players on an X/Z axis.
https://i.imgur.com/mYuQPVh.png
That being said, my question-- how do you get an object to rotate on a horizontal axis that follows the players direction? So like say the player faces north, the object faces north. I've tried tons of other methods as well however, I am just completely dumb founded by how to pull this off.
you can get player rotation from playerapi and then get the y axis out of that quaternion
and then offset the y axis for the rotation of your object
I keep forgetting that playerapi is a thing now. . . Lol. Thank you very much!
I have one gameobject which controls 16 child-objects.
I want those child objects to be clickable (onInteract)
Do they require a script each for this, or can the main script give them this functionality?
They all require a UdonBehaviour.
Will the main object get notified when they're interacted with? I'm not sure how to communicate between them
define a custom event on the parent object and then call the custom event from the child with SendCustomEvent using a reference to the parent behaviour
I will look into doing that, thanks!
is there a node to compare two float values and choose an action depending on which one is bigger? basically the equivalent of 'if (float a < float b) { }'
Yeah, Float GreaterThan / LessThan
Can I be lazy and make a "globalVariable" object which I just put into every other object, to have a centralized state?
You can be even lazier and get the parents UdonBehaviour in the start event
You could, but then you have a lot of dependencies. You can design UdonBehaviours to be pretty close to C# classes. However its not quite that easy
Not tested, but technically how you'd do it
But of course, setting the variable in the Inspector is much better
I'm using udonsharp, so I'm not sure how it looks in there, but thanks for the idea!
Will that give a duplicate of the parent udonbehaviour, or a reference to it?
Just the same really
Nice, thanks!
Also, since you're working with U# I recommend joining that Discord. (Bottom of the github page)
Much easier to get help there for it
Btw even if I make public variables using a udonsharp script, I can't seem to assign them. I have to drag them manually in the editor, this also means that I have to hardcode everything
I will btw, thanks
This channel is mainly meant for stuff related to official things, the graph ^^
Fair enough, it should work somewhat the same though
it does
how to build stable sync switch (and buffer for join after too)
I try to sync "state" variable..... it look too slow sync variable or something mistake
Hello ,
Based on SDK3 exemples I try to toggle mirror and collider on my first world :
https://www.vrchat.com/home/launch?worldId=wrld_0825bdc6-5bba-464c-a3cc-38ca8144a2b2
But I have a problem , it does not toggle for the local player only but for all players in the room
I've been trying to find for a while but I can't find the problem
Are there any special options to check?
And I have an other problem,
for testing I try to launch 2 clients on "Local testing>Build and Test"
I can't seem to be in the same instance to test my problem
someone managed to do it ?
Thanks in advance for your help
Best regards , Stephane
@scarlet lake You need to provide a picture of your graph for us to say what's wrong
Also, build and test with two clients don't work. Got to upload and launch two clients
Ok , thank you , yes that's what i'm doing right now but it's long 😋
It's in upload, as soon as it's finished I post the graph
Uh is there a function to tell if player respawned?
No, but it's been requested https://feedback.vrchat.com/vrchat-udon-closed-alpha-feedback/p/request-playerapi-event-respawn
So might be lucky
What are you doing with the animator?
It toggle a on / off on the ui button with up and down movement
If all you need to do it toggle the mirror on and off with a UI element, you don't need a UdonBehaviour
Also, the way you're doing this is very inefficient.
Take a loot at my example for toggle a object on and off https://ask.vrchat.com/t/phaxenors-examples/273/5
yes I was using your example before that, then I wanted to add the animation on the visual "on / off" button and while searching I took the graph example from the vrcsdk3 folder ToggleSync
It's still recommended to not do this in Update
I have the same for collider and a modiifed for light dimming
Because right now you're toggling this every frame
Not related to this but at least I found a solution to my problem now. It's pretty neat, one part of my code already almost handles this naturally so this is way easier for my case.
ok I will try this, otherwise this script should just be for local player?
Yeah
Is there any autocomplete for U#?
I can't remember VRCSDKBaseVRCPlayerAPI blah blah blah.
@flint urchin Thank you .I try this and I would tell you if that solves my problem 😉
@fallen prawn It's just default editor intellisense
try to use jetbrains rider / vscode with unity extension for the autocomplete, hm
Which extensions @fickle stirrup
Yeah, although some part of jetbrains are a bit annoying and it seems to slow down the startup of my visual studio quite a bit. Takes like 10 seconds for the stuttering to stop after visual studio opens
Oh you are talking about vscode.
Could be better there?
But at the very least the unity extension is a must have
hm, not rly 🤷♀️
@fallen prawn debugger for unity (and myb unity tools) for debugger if i remember i replace unity dll with one from current unity because the one with extension is old (or not sure) and that extension is start to work if to use vs code as default editor and double the click script from unity
@fickle stirrup I installed Unity debugger.
But no one still help me
Did you install c# extensions when vs code asks you to? Wait about 15 minutes for vs code to index everything? Restart vs code?
Also I found you need to open it by double clicking a c# file from unity.
So it can create a project/solution
Also does your file have the lines like using UnityEngine;
I think U# generate all for me @stuck mountain
OK 😑
I forgot to put Project folder to workspace.
🤦
It is what it is
IDK what syntax to set run speed to localplayer
it gives me
" System.Exception: Invocation requires method expression!"
You’re using the wrong method
Youre trying to access the static method. Use the instance method instead. For more help on UdonSharp go to the specific Discord.
@flint urchin with your script and old script for animation i get it working fine in editor but in VR the toggle animation script is not executed . have you an idea what is the possible problem ?
You are recreating this I take it?
? i don't understand your question
Are you using this script on a object or just creating something similar in Udon?
I use this script on the toggle button
Yeah, that won't work
It work in editor play mode but not in vr
Because VRChat don't allow MonoBehaviour aka custom scripts
You'll have to create this in Udon
ok I have to mix your script with my old script animation part ?
In a way yes
okay thank you very much i will look in this direction
does anyone know how to setup in udon graph a way to make a game object deactivate while also activating another object with the same trigger?
@severe gust shouldn't that be as easy as dragging the same line to the other setgameobjectactive node?
eg: from your oninteract node branching to both setgameobjectactives?
example:
ah ok i'll give it a try
Anyone here build or "place" a video encoder into their world?
out of curiosity, what's the use case for an encoder inside a world?
Watching movies and playing music with friends, i built a custom home world to chill in and my final touches i want to add is the video encoder
u mean video player?
Yeah, but with a video player you could play the music videos as well.
as far as I know, There is no video player support yet in udon
i usually go into VRchat, go into the Movies and chill world, throw on a movie and do my developing.
Yes, but i have to downgrade to SDK2
i believe someone told me they had prefabs in there already, just haven't gotten around to taking a look
er yeah, but anyway if you're talking about using sdk2, you're in the wrong channel 😛
no problem gamer
Player Mobility "Immobilize for Vehicle" of VRC_Station doesn't work in VRCSDK3 ? It switch to "Immobilize" when build scene.
Anybody run into FlatBufferNetworkSerializer: ArgumentOutOfRangeExeception: specified argument was out of the range of valid values with large synced strings? What's the upper limit?
ah, thanks.
guess i'll try packing into multiple strings
oof, the limit is extremely short. something on the order or 64 chars
I guess you'll need clever uses of encoding or multiple strings like you said
You can use SDK2, but recommend to start learning Udon
Udon is hard to use,but it's working veryyyyyyyyy good.
yes i love it and hate it at the same time 😅
Sorry but i'm still kinda new to Udon, is there a way to turn an animation on and off in the udon graph?
and play and stop an audio
Audio yes, that's done by having the behaviour have a reference to an audio source
Not sure personally on animation but I think it is
@west plover Thank you I'll give it a try
Is there a way to synchronize the animator animations or will I have to wait until the synchronize animation checkmark is available on the udon behavior?
I also tried using the synchronize position checkmark on the udon behavior but that just freezes the animation.
I also tried using the VRC_Sync Animation (Script) but it doesn't synchronize anything.
It's coming soon 🤷♂️
@sudden pecan - check out the 'VRChat Examples' folder, it's got a Toggle Mirror you can look at and mess with for reference.
Is it possible for world objects to track something other than player head or hands, for example, lower arms?
Yeah, get the bone positions and use that
How do we express x, y and z for scale in udon?
What this guy doin
Trying to figure out how to set the scale of an object with an udon control
@oak marten
Express, as in set it? https://docs.unity3d.com/ScriptReference/Transform-localScale.html
Yeah basically, as in what to put here to send a signal to an object to change scale
Do I need to put in (x, x, x)?
Because I need it to appear as
Trying to make a little puzzle where you use sliders to manipulate the dimensions of platforms. But running in to this wall!
is it possible to teleport somebody from one scene to another
or does a world have to all be one scene
All of your world has to be in one scene. If you want to have two locations like in the Solitude world then you can separate them by distance.
ahh gotcha
@oak marten you could probably try to construct a vector3 and then have each slider controll one of the variables of the vector3
if you need further info/help i could try to build the construction part of the vector3
does interact not fire for desktop users?
well, it should
how do i set variables for a players hand cant find the node for it
like rotation and poition data
Interact only works in-game, not in the Editor
And in the above screenshot it will fire twice in-game for Desktop users, as desktop triggers both Interact and OnMouseDown
Interact works for Desktop too
o.O
that is odd...
if it fires twice for desktop users it should be immediately toggling the thing off and back on again
but it just toggles it off
🤔
everything in the transfom componen is a vector3 except rotation, that is a quaternion, but with that there are ways to work with that aswell
...huh. I stuck this in a random object and it worked
so why the heck does my toggle thing only work on mouse down
Are we suppose to use Delta Time for vehicles? It seems that after a certain speed, my vehicle that I made stops rotating based on the players view rotation.
@jagged crow
On interact only fires an action once. Are you trying to like, make a toggle state for a cube to spin?
got a toggle on my mirror but also just trying to get interaction working in general
tried to make a teleport thing but its not working either
Is there a direct way to get the master? Otherwise Ill make a canny
for what purpose?
Youre right I was overlooking something. Still would be neat I guess
yeah I thought you saw the bool output one but needed something besides a bool but sounds like your set
Well Im doing some relatively complex Networking stuff and checking for master is essential there. In my specific case I can just check if the give api isMaster or not, but for example lets say you want to set the owner of an object to the master. How would you do that? :P
There is a much easier way. Have an object that never changes owner. Tada
It will automatically always be owned by the master. Then you just GetOwner() done.
But a Networking.GetMaster wouldnt hurt
would there be a way to transfer master status without the first master leaving?
By default every object is always owned by the current master
I thought you wanted an object that changes master, but I see you said set object owner to master which yeah just having no owner would make it masters
@severe gust regarding your previous question. You can serial link, pararell link and use "add node -> special -> Block" Block will add more output parameters as you fill meaning you can always add one more thing to it.
Anyone know what this node is called? I can't find it. ;-;
https://i.imgur.com/CgC5KcR.png
@glossy sky inequality
Thank you thank you!
Ok everyone and @tame matrix i am still working on that graph from before, i gotten to the point where i can do scale, rotation and relative position, the resulting matrix gives me the correct position but not rotation (rotation goes accumilative but i can get around that easy). But my current issue is that i cannot figure out how to get the accurate difference between the 2 objects position to use for the Translate. I tried using subtraction but it gives a higher or inverted value compared to what it should be. Anyone able to help?
As far as i can figure, when i use subtraction it goes wrong because not all values are positive. like a mix of +- + -- messing it up.
i need some help, i have no experience with udon, but i want to make it so that if a player is far enough away from an object, it's disabled, but re-enables once close enough
this is what i have so far, but i dont know how to target the asset the script is attached to
You’d probably be better off using a Trigger box for performance sake.
But you’ll need to do it in Update
Not start
Then get the objects transform position and check the distance between that and the player
I've decided to update one of my older worlds to use Udon, but I'm running into a problem. I'm getting 3 errors from AvatarValidation.cs. All the errors say that VRC_SpatialAudioSource could not be found. Any fixes?
Vrc spatial does likely not exist in udon, so find the prefab/object that uses it and remove it.
as in remove the script not the object
Got it. I was hesitant to do something like that because the SDK added the script itself after I fully deleted the SDK.
nope removing the SDK does not remove object attached script refferences
@worn atlas try use "late update" event, and make a check using "float less than" (search for it).
I deleted the script, but it gave a lot more errors.
strange, did you clear the old errors?
It goes from 3 errors to 46 error. The new errors are in a bunch of different scripts. The original 3 errors are gone.
How large of a project is this world of yours?
The world is 92.14mb.
could it be that each one of the errors are individual scripts from the old trigger system?
I can't think of what would be causing the errors though. When I look at the old objects, they all say that they aren't connected to any scripts.
I removed everything and I'm still getting the errors. I think it's something to do with the script itself.
It's happening because of your project settings containing stuff from SDK2
Go to Project Settings -> Player -> "Scripting Define Symbols" and remove anything that isn't UDON or VRC_SDK_VRCSDK3
If Post Processing is there, keep that though
If you're unsure, post what you got here
You also got to make sure that all Trigger components are gone from the world
You’d probably be better off using a Trigger box for performance sake.```
ok, ill do that, then
probably easier to control, too
but now the question is how do i detect if a player is in the trigger?
@flint urchin That fixed the error. Thank you.
also how would i make a list of objects to be affected by the trigger?
@worn atlas got to have your own trigger that updates with the player position. "Custom Player Collider"
@boreal plaza check the console for better info on it. This doesn't really say much
oh wait.. It launch in the latest unity version when I think I am supposed to use 2018.4.20f1?
2018 is the new version (check for the official details/info about it)
Yeah I tihnk I accidentally launch unity 2019 something
@roket gamer got to have your own trigger that updates with the player position. "Custom Player Collider"```
i found these things called "on collision enter" and "on collision exit", will those work?
No, OnCollision is when something hits another object (they collide)
You need a capsule collider that follows the player and use that as a "trigger"
ok, how do i do that? i never used the events system, let alone udon
You need to create a "PlayerManager" that on Update, gets the player position and then updates the transform of the capsule collider
I'll have a example picture done in a min if you want to look at that
yes please
Here is a basic of it;
Then just set up two empty gameobjects like this;
PlayerManager (Udon here)
PlayerCollider (child)
i cant find "VRCSDKBaseVRCPlayerApi" for a variable type
nvm the list was just too long, the arrow keys helped me find it
ok, did that
Then on the Trigger graphs you just check if the other.gameobject.name is equal to the transform name
@flint urchin @worn atlas I wrote a guide on Player Collision in the Ask Forum. Its probably easier and better to do that then to have your own collider setup.
Building your own system around another system has error potential which is meh. Of course this is not optimal, but it reduces that.
This doesn't really have any potentials for errors though. If anything, that's the authors fault.
Well it does in the sense that your collider could be the wrong size or the wrong location (I dont know if there is any case where the player position would differ from the position you get in Update, but who knows). You could even accidentally delete it, but yeah thats on you then. Still.
The player position won't change for the world position. If it does, then VRChat made a mistake or you are doing some janky thing and should do something else that suits your system anyway.
The size of the collider is on the author. Same with what it collides with or if it collides with anything at all.
Your way is locked to player(s) only and require that layer for it to work. Mine gives you a bit more flexibility, by allowing you to check for other objects in the same graph.
It's just a matter of preference and the performance overhead for this is so small that it doesn't matter.
You can even use it as a custom collider for the world if you want to be able to crouch under something
Well you cant do the last thing unless you build a more sophisticated system, because the old Player collider will still collide with the wall.
Can we still have UI in screen space? I can't get it to render but it's taking my raycast
oh I see, I needed that same script from SDK2 , VRC UI Shape
Out of curiosity does anyone know what that script does?
Makes the event camera the player camera afaik. Maybe also some other stuff for the event system
u-oh... i restarted unity and all my udon behaviours seems to have broken... the program is replaced by a long string named file placed in a folder called "SerializedUdonPrograms"
what do?
Right click the graph asset and click reimport, then restart unity
got the udon behaviours working again @flint urchin thanks! most of them are empty tho >.< thankfully not all of them
Yeah, this can happen at a very rare occasion.
Just add the graphs back and it should have the same data still there
when i pout in the right program all the variables are back in as well
PHEW
better not put in the wrong one huh?
Yeah, probably best 😅
good thing i havent been frustrated and havent given them unreasonable names.. Im ready to pay for my sins xD
ÅH! backups
i have backups
whats a simple way to delay flow between nodes?
No simple way no, unfortunately
One method is to get the current time since level load (that will be in seconds, you can also get any other time whatever you think is best) add to it the amount of delay and then check every frame if the current time is bigger than that and only carry on after that is the case. There is also more sophisticated ways that are more generalized, but require more setup.
I got an idea how to make such a system.
What is the reason for wanting the delay between nodes? Does a timer not suffice?
That is the intended way to put space between events
What timer?
There is an input called timer
What do you mean?
It ticks at whatever rate you want
Do you mean a custom system?
I cant find it, might be because Im using an old SDK
It’s a custom event
Pretty sure youre talking about a custom system someone built then.
I think it was CyanLaser if I remember correctly
Oh, I didn’t know it wasn’t part of udon proper, I thought I was just modifying a setup
Oh is that a thing I need to check nodes
also as far as normal unity goes google says you just use invoke but I dont think we get such a node
yeah I dont see OnTimerEvent in mine
Thank you!
Actually now that Im thinking about it I can make it even simpler
Not by much, but at least something
@twilit breach Here's the better version. Sorry, I swear Im done now xD (This time I also included a Graph example)
God damn it, I just got an idea how to improve it again xD
Nothing crazy, just a way to support multiple UdonBehaviours on a GameObject. I will post that version on my GitHub some time then...
Quite the fast work flow you have ngl
Nah I just get these sudden moments of realization. Unfortunately only after I think Im done with something
how would one check if a player is the owner of an object in udonsharp?
@steel berry
ahh was looking at the wrong area, tyty
can the owner of an object ever be null or will it always default to the master? currently doing a null check, not sure if needed.
Always defaults to the master
would this work for setting the owner of a station to the player sitting in it?
@PhaxeNor @roket gamer I wrote a guide on Player Collision in the Ask Forum. Its probably easier and better to do that then to have your own collider setup.```
i found that and its so easy to make
now all i need to do is figure out how to make a list of objects to tie to the trigger, and enable/disable them when entering/exiting the trigger
question:
were there any news on Instantiate fixes coming up?
i tried to make a trigger culling system using TheHelpfulHelper's player collision guide, but it's not doing anything, did i do something wrong?
You are trying to set a GameObject active/not active. However youre passing in an Array of GameObjects.
if you want to toggle all of the objects in the array you will have to loop through the array.
alright, how do i do that?
using the For node. There should be examples on how to loop through an array somewhere.
i found a guide and did it, thanks for all your help
PLEASE! I need help. I can't get my world to upload. The upload button can pressed but it won't do anything! Does anyone know whats going on?
I'm using SDK 3 by the way
I even tried using SDK2. Still the same thing.
Upload button is enabled but nothing happens when pressed.
does input.getKey work for keyboard input or do you have to use input.getKeyDown?
Both work, but getkey is true for as long as you hold the key. Getkeydown is only true for a single frame when you first press it.
Similarly getkeyup is only true for a single frame after releasing
Quick question, does the VRC_Pickup fire events globally? Like say I wanted a gun to shoot and trigger a particle animation/muzzle flash. Would others be able to see it or would I have to send it globally via. the network nodes?
That only fires locally, so yeah it would be when a local player uses a pickup in their client, fire a network event that has everyone set the particle to play. The particle position would be synced with an udon behavior with position sync box checked
This also means the particle coming out of each players gun would be in different places based on lag
Lovely. Thank you very much for the information~
are you making a pvp gun world? or just want other players to see guns shooting at static stuff?
PvE. I usually make bullet hell worlds and decided, I'm finally going to do my Azur Lane bullet hell raid idea. I'm aware of the combat system not working/is not utilized currently as well if that was going to be the next point~
combat seems mostly there, just missing the graphic for damage. I was just curious cuz I've been working on a particle gun PvP world since Udon launched
OoooOO. I see I see. Yeah, I've yet to delve into the combat system. I spent like, nearly 48 hours learning everything and finally got my vehicle for my raids full working. Wanted to work on it more but seems like servers are still down or something's up with it.
Sounds like a cool world. I think it's possible with the current SDK. I've yet to add damage to my bullets but bats and stuff kill me so I'm sure particles would work
Mhm! I can finally make the world I had with an moving and responding boss into a legitimate threat with Udon too now. xD At the moment though, she's currently broken as it seems animation sync stopped working. Took the living soul out of me though trying to get these vehicles to rotate based on player rotation. x_x
All the wonderful help I've been getting though from here though really really helped~ Especially since like, I know little to nothing about coding to begin with and whatnot.
Yeah there are a lot of helpful people in this discord, I've learned a lot from several friendly users as well(some are really smart too). When you get ready for combat you can at me
@jade inlet you don't (devs not implemented it yet). You can maximize it tho.
How hard is it to make a jukebox or music player in udon? I can't use the old prefabs anymore
Can UDON calculate whether or not you're crouching, or moving slowly?
I'm sure the latter is possible, but crouching specifically
Why.......
How to change player's voice "talkDistance" ?
I want to change like VRC_PlayerAudioOverride voice parameters.
Update event seems to not run at all, if im correct its supposed to run once per frame right?
@nova parrot It's not supported/updated to function with Udon yet.
Waiting for it too, and it's the only thing left in the progress of a event world to go live with Udon
@kind knot Yes, check that there isn't any errors
https://pastebin.com/Ei4hyHG6 I dont see any errors
Ive actually never gotten update to work... no clue why
That's because you're fetching the player api from OnPlayerJoined
That won't work
Networking LocalPlayer is what you're after
That or
Set a VRCPlayerApi variable and use that
I connected it to the wrong spot
You also don't have a Text variable assigned to the Set Text
I got it fixed now
just got confused on connecting things due to it not allowing me to add multiple noodles to the update method
You can use a block
Well now its being really weird, the Update event runs once or twice, but then the position of the object just locks https://pastebin.com/UG5ZHLMf
Idk whats goin on with it now O.o
Its also not setting the text ever
but the Set active disables the object after the period
Which doesnt make sense...
whats udon
SO now it follows my head for a few seconds, then just stops text also wont set, and the object never disables
Im gonna take a break from this cause it just refuses to work https://pastebin.com/pCEZfXmT
How would you guys go about completely disregarding the vrc character controller and applying your own controls in a world?
Some things are off limits when using the character controller (eg. flipping the character around to walk on ceilings...)
So far I've tried every possible adjustment to spawn point orientation in hopes to realign everything differently on vrcplayerapi teleport.
Adding my own controls to a station and forcing every player into their own station would work. Any best practices when it comes to custom player controls in VRC?
How can I get the PlayerAPI that's currently holding the VRCPickup?
https://pastebin.com/Ka38saiB Im sure im doing something simple wrong here, but what im trying to do is get the position of a bone, check if that position is inside the bounds of a collider, and do something if it is ... But its just not doing anything
FIgured it out
question:
what does _GetBonePosition() require as a vrcplayerapi arg?
@vast granite are you using UdonSharp?
yeah
Use the instance method, instead of the static one. And ask those questions in the UdonSharp discord, this is meant for general Udon questions, or regarding the Graph/Assembly
@fiery yoke Finally got around to downloading Udon Sharp so I can try your fancy delay service. Trying to just do an interactable cube that sends the debug message from your example graph but no luck. Do I have to hit these compile buttons on Udon Sharp or am I just not using the right public variable I wonder
Yeah you have to compile the UdonSharp scripts after "installing" them. Thats just how it is
The "Compile all UdonSharp something something" button should do
UdonSharp is pretty stable with graphs and stuff right? I haven't touched it till this point
It just compiles C# code into UdonAssembly code
UdonSharp doesn’t generate graphs
I'm just worried I'll press the wrong thing and mess with some aspect that goofs everything
but that probably isnt even possible tho right
Code is code
Ehh if you do something weird, you might have to restart unity
If you type some random letter, yes it will break
UdonSharp does break occasionally, but usually only while editing things. Just having it in the project shouldnt do much harm.
If I just press compile all udonsharp programs in my asset folder would that do any compiling I'd need?
accurate.
But yeah Dinky just click that button once and you should be good.
On that example graph, the public variable I'm targeting is that the DS_Manager or the child DS_Handler for said graph?
You dont have to put anything in there. Just have the variable in the Graph. My system does the rest automatically.
Then youre set. You can now delay any event you want.
and now I use this handy little service to finish my dynamic destructibility and fading UI messages xD
Thank you very much 🙂
I could probably do some more optimisations to make it run even better...
It loops through the array, which is bad in Udon.
I will try to make it more performant
@twilit breach I actually just realized that I have a massive flaw in my code. I would recommend to get the newest verion of my delay service once I publish it.
It does work, but not as I intended it to. Sorry for the inconvenience. I will finish it someday xD
mmkay
alright so i just started using triggers and now im to understand they are not in udon? pretty new to unity and just built a project with sdk 3 and just now realized there are no trigger descriptors, so how do i set up something to teleport a player or where can I find this information?
Experiencing something odd,
I have the same udon script being used in 2 spots in the world, with different variables.
Enter the world, trigger first one, it gets stuck after that first toggle, the second one works flawlessly, doesnt matter which of the 2 get triggered first, first one always breaks
Including losing track of synced variables on reconnect
and now its working fine... odd
the magical world of programming, stuff works and then it doesn't and then it does
When the sdk3 allows Avatars. is that fancy for avatars will be allowed to use UDON?
Not necessarily
Most certainly not to the extent that it’s allowed in worlds, if at all. Least I heard, scripting will never be allowed on avatars. That was before Udon came around, but that’s all I’m going off of.
might be a world setting and a safety setting to enable/disable udon and obviously it will be a bit less powerful, you cant just have a character designed to fly around break maps or lag people.
Could always make a feature request. I don’t think it’s planned.
i dont think i will. Mainly cause that sounds like a nightmare to impliment.
albeit the possibilities would stretch endlessly.
like proper character-world interactions.
intercharacter interaction.
or even some nifty additions or gadgets to a character.
since udon is safe once the features are defined its basically impossible to abuse udon to frick people over.
I’d love it personally I just can’t imagine a way it could be done in a way that
1.) is constantly available in both private and public
2.) is not insanely abusable in public
actually i shouldnt go assuming how easy it is to break vrchat. ive never used udon
the easiest route would be to disable anything you definitely wont need in a character.
and heavily limit it
Artificial limits never work
but nothing really counters the whole spam the hell out of it until something breaks.
modded sdks ect exist if the devs want it or not.
personally i dont want a modded sdk
the limits exist because the servers arent like nasa pcs.
yo
What is the best way to make it so that a given object can only be controlled by player input when that player is seated on a given vrcstation?
Disable and enable it is one way.
Another way is to use a bool in the update where the inputs are.
that bool would indicate if the person is seated or not
with OnStationEntered / Exited?
Yeah, just make sure it's not run for the remote clients (if the actions are the same for both local and remote in the station settings)
thanks👍
Is the station controller thing still meant to be used or what?
it is yeah
not checked, but wouldn't really think that'd be used anymore
So in the old SDK/Unity version pickups collided pretty decent with walls. Now they phase through them very easily and get jittery till you drop em. Is there a setting to get them back to the nice collision?
Hello! I'm trying to make a super easy script, but for some reason I can't make it working in any way. So, I have a pickup object that has isKinematic active and after you pick it up for the first time I want the isKinematic to be disabled, and after some time it will respawn with the isKinematic enabled. I've already made the respawn thing working, but for some reason I can't make the isKinematic working, I tried to set it when you drop or pickup the object, but it doesn't work in any way
This is the setup I used
@dawn plover - your graph looks like it only ever sets isKinematic to false. You'd need a way to change the 'value' input on the Rigidbody.SetIsKinematic node
But that's the problem, even if it should set it to false the Kinematic is always true, I can't make it to false by dropping it. Anyway there's a part of the code when I set it back to true, I didn't show it in the screen because it doesn't fit all in one screen 😛
And I tried to change the onDrop with onMouseDown and try it in the editor, and everything is working fine
so does isKinematic never toggle for you, or does it work with mouse controls but not on drop/pickup?
It never toggle in VRChat, but in the editor is working with onMouseDown; So far in VRChat I've tried with onDrop, onPickup, onInteract and it doesn't give any error in the log
Now I've tried to remove the VRC_Pickup script and use the onInteract and it's working in VRChat, so I guess it has something to do with pickup objects or the onDrop/onPickup
there is this one I've been meaning to test myself for isKinematic https://feedback.vrchat.com/vrchat-udon-closed-alpha-bugs/p/rigidbodyiskinematic-not-toggleable-if-udonbehaviorsynchronizeposition-true
Actually, I already have. In my test world O.o
hey i need some help... im trying to make a gun shoot whenever the player click left mouse while holding the gun. I got a script to disable a gameobject that contains the sound+muzzleflash.
I tried 2 different methods - one with update() and one with OnMouseDown()
update() doesnt work at all
OnMouseDown() works only once when i pick up the gun. if i drop it and pick it up again it will shoot again.
but what im trying to do is make the gun shoot while the player is holding the gun (VRC_Pickup is set to equip) whenever he clicks left mouse.
im adding the scripts. any idea how to make that work? thanks!
Yup, I can confirm that after disabling the synchronize Position it's working as expected, I can pick it up and when I drop it the isKinematic is disabled, so I guess I'll have to wait to synchronize my pickups lol
There is another way to organize your synchronization, which is essentially outsourcing the synchronisation to the PlayerApi, and binding the GameObject to a certain bone or hand of the player. Essentially the object itself has a constant position on the Avatar, but the PlayerApi decides which Avatar its bound to. Its less flexible and only has a few actual use cases, but for a few things its actually pretty neat, when you want to avoid lagging objects. E.g. Accessories like hats, armbands etc. The positions will not match between clients, but it will always look right locally.
@torn quail You want to set the pickup to a gun and use the event on pickup use (which is clicking your mouse anyway)
you mean VRC_Pickup -> Orientation -> set to Gun?
and On Pickup in the udon script instead of the Update/OnMouseDown?
You dont have to set it to Gun to work. It only requires that AutoHold is true (which Gun would do, but you can also manually set it to true).
And the two events are called OnPickupUseDown and OnPickupUseUp
what is the command to make the player leave the vrcstation?
@twilit breach @fiery yoke working thank you guys!
How exactly are we suppose to setup custom sit animations for VRChairs in Udon? Upon playing the scene, it always seems to remove the controller.
https://i.imgur.com/jZzD01y.png
Never mind, I'm a pepega. I forgot to unprefab the chair. LOL. That's why the animators kept un-assigning itself.
What would be the node to attach a gameobject to the player or to detect controller inputs?
Is there a way to connect to an external server to pull something like a leaderboard for scores?
@fossil zenith nope, maybe through videoplayers, but atm they are not implemented, there's also no way to save(but methods for this exist, but do nothing)
anyone know how to get the local player in u#?
@nimble thunder Networking.LocalPlayer
At the bottom of https://ask.vrchat.com/t/vrc-triggers-udon/196/3 there is a blank space under SetComponentActive, is the version of that for Udon coming in a future release?
@torpid badge I think it might be slightly more difficult to disable generic components. Some components have an enabled property (like camera.enabled) and it only affects unity events like update/start and so on..
So if a component doesn't offer the enabled property by default or doesn't use any of these default unity calls it wouldn't even make a difference.
So you'll probably have to add extra bools to the components you want to enable/disable them manually if you can't resort to enabling/disabling gameobjects (which also only disables the unity default event functions)
could somebody tell me why this timer isnt working?
@topaz sentinel that's my fault. Forgot to add SetVariable in there (will fix 😬 )
Just add a SetVariable in the false flow and update the deltaTime
thx
It’s best two do both. Gun synced to the player API for visually holding the gun and tracking their movements smoothly, then a second invisible gun that is not synced to the player API for actually shooting bullets so the effects and travel trajectories are always synced regardless of players lagging behind
@flint urchin sry to say this but still not working for me D:
Look at your graph again, you're doing the custom event in the false statement
should it be on false?
It has to be on True if you want it to work
its on true
oh yeah, my bad, looked like it was on false
But you just got the true and false inverted then
False needs to update the deltaTime variable
while True resets it to zero
yeah
Well, they are both being deactivated, so not sure if that's the intended result
yea i want to deactivate 2 objects after 5 sec
Make sure it's compiling properly (manual compile)
i pressed the compile button mutlible times ut it didnt affected the result D:
Well, there is nothing wrong in the graph. Try add a Debug Log on the false statement (after the variable has been set) and print the float value to the editor console
If that doesn't show, then the graph is not running or not compiled properly
how can i print it to the editor console?
Using a Debug log node will do that when you test it in the editor
ok sry i have 3 braincells i still didnt get what i should do. i added a debug log to the false statment
and then click run in unity and activate the object or?
yeah
but if you got this disabled in the start when testing in game, it might not work. UdonBehaviours that aren't active from the beginning won't work properly atm
any way to see errors ingame?
like, is there a way to print the error log to a piece of text or something?
So, is the "public" flag on for example Game Object Set Active what was referred to "local" before, kinda? Can't test it right now, but I have problems with a mirror that triggers by Event_OnTriggerEnter... it turns on and off for everyone instead of just for you and obviously screws it up then. I'm using this:
I mean... in reverse then ofc... :P I've turned it off in this screenshot
Taken from PhaxeNor's sample I believe, but replaced Interact with the other triggers
Everything is local by default. However you have to remember that the position of players is synchronised. Depending on how you have it setup that can make something that seems local be actually synced/global.
Hmm, maybe a dumb question, but how would I check that?
Cause it does definitely, without fault, turn on and off for everyone else
The layer this object is on, decides what it collides with. On the default layer pretty much everything collides with it, so it will also collide with other players. To make something only trigger when the local player collides with it, you can follow my guide at: https://ask.vrchat.com/t/player-collision-in-udon/428
So if I stand in there and another person walks in, it turns off
Oh ok
I'll check that out then
Essentially you create a layer that only collides with the PlayerLocal layer
Ahh yeah yeah, I'll create a new layer and test again later, thanks :)
cuz i was thinking of buying them because u get 209% back
Hey I was wondering when vrchat is coming to psvr
Not the right place to ask and the answer is no
@fiery yoke You think this would work with the udon script I sent above? Or does it need the Networking Get Local Player node? Cause it seems to work with the layer and everything, but I can't confirm with more people atm. I'm just not entirely sure how to work in that node in "my" script.
No it should work. Youre toggling the Object locally, and youre only colliding with the local trigger.
👌 Cheers, I'll try it like this tomorrow then. Thanks for the help
Seems i am stuck again, i want to get a vector represented by a vector3 that shows heading from one object to the other, magnitude i can get separetely, but i cannot remember the term for it meaning i cannot find a Node to use, anyone know?
You want to get the direction from one object to another?
yup
Subtract the position vector of Target from Start. So (Start - Target). Get the magnitude to know how far away it is and/or normalize it
Well that will not work @fiery yoke , as soon as you subtract -5 - +1 you get -6 instead of -4 and if you use addition on 5+5 you get 10 instead of 0. I been stuck with this conundrum for basically a week now.
I already answered this for you on the forum
One sec
Ohh yeah sorry I mixed them up. You have to subtract Start from Target. So Target - Start.
if -5 is your target and 1 is your start you get -6 so you have to move -6 from 1 to get to -5.
Yea using delta normally does not fly in a 3D space as you need negative values.
What? A delta is a difference. it has no direction. Its meant for a different purpose.
is there any possibility we might get use of the playerprefs class, even if its limited use?
Your right @fiery yoke it seems to work fine, i am going to have to start using the "debug draw line" more to troubleshoot the issue.
A seperate problem i been having tho, is that if i apply a vector3 for a "rigidbody add torque" it behaves really odd, i used this on a ball using a vector3 that gives heading, but to make it work proper i have to do this.... What is going on here is this a actual bug?
When ya'll gonna fix the Udon exploits?
This might be a stupid question, but what data structure does Udon use for arrays? I wondering because I want to have a player list array. If I remove a player from index 1 from an array full of players, would I have to reseat all my elements into a new array so that all the players after index 1 will move over to fill up the empty index? Or would it dynamically shrink the array without having to move everything into a new array?
Also, is there documentation on what all the nodes do? Because currently I just spawn a node and try to infer what it does by looking at the input and output. When I see "GetSDKVRCPlayerLocalAPI", I'm not too sure if this is getting a local player in the server, or if it works for multiple people, etc. Sorry if this has been repeated before or I missed some documentation I can just look at, I just started learning Udon yesterday.
@topaz flower have they been reported?
@errant lichen There is a list of players node there, but can't do anything with it right now.
As for documentation, there is one in the Udon folder
hey guys i just updated my project and the seats are broken now. any way to fix it?
the sit outline is working but it wont teleport to the sit position
read the last post in #announcements
oh yeah didnt see that post. thanks 👍
Thank you!
@errant lichen also if you click on the small "?" on the Node it self, you will get the official unity documentation it is based on (not for all of them tho), it not perfect but it a good refference material in many cases and easy to lookup.
@green plinth Thank you so much, I didn't know that was a feature! That will help a lot.
Yw
how do i make avatar pedestals
There should be an example of an avatar pedestal in Asset/VRChat Examples.
I mean there is one but it doesn't really work proper
what you mean?
Taking a look into it right now. I imagine you'd just have to plug in the avatar ID.
I placed them in the world and added the IDs
Ok i am trying to use a UI slider set to call udonBehaviour.Interact but for some reason the interact event gets no calls, anyone know what is wrong?
I would never do that other than for debugging. Interact is meant for interacting via clicking on an object that has a collider. Make an event and call SendCustomEvent
@fiery yoke ok i tried that just now, nothing happens still.
Well theres multiple things that you could have done wrong. Without more information its hard to help you.
well @fiery yoke i just set the event to toggle the UI sliders game object off the slider should vanish as soon as i touch it's value, so it is clearly not Sending the custom event when "On Value Changed"
There is still multiple things that you could be doing wrong. Try SendCustomEvent in the Start block
well i placed the code in the start event, it sure toggeled the slider off so the main issue is that the event is not being called.
OnValueChanged does not get called when you change the slider in the inspector.
😢
You have to actually drag it in the Game view
I guess i am just gonna have to trust my programming skills more then and test once complete...
You can just go into play mode set the camera to the slider (Shift + Ctrl + F to set it to the Scene Camera pos) and drag it.
Oh yea
Well that works, thanks @fiery yoke sadly my code caused a 5 sec lag spike so it's no good. 😛
does udon also use 2018.4.20f1?
So how do we detect whether an user is doing a particular hand gesture?
That is the recomended one officially if im not wrong. @crimson flame
thanks
detecting hand gestures, that a interesting one.
that could be used a lot by the deaf community.
You know what guys i am gonna use a alternative solution, so my issue can wait.
Ok i found the issue my self so i am deleting it (me pepega lel). 😛 Used delta instead of fixed time....
Btw i found a way to synch values more accurately, mainly use a local variable and then use a synched one to check if it matches for a few sec during the network event and if wrong value during the check (timed while loop) then alter the local one to match/synch.
Damnit that exception error is back, and this time i did not even change the script....
Ok this is likely a bug....
I cant seem to getaxis "Oculus_CrossPlatform_PrimaryIndexTrigger"
if its included in the Udon program it would halt right there
I know that instantiation isnt networked, but what about destroying? I guess you have to network it yourself. Would make sense.
Is there any ways to sync VRCInstantiate?
I'm quite trouble with this thing for days, but I can't still figure out VRCInstantiate works
Or does UDON doesn't support spawning synced instances?
Udon doesn't yet support networked instantiation. People are using object pooling with a set of existing objects at the moment if they need objects that exist for everyone in the room.
Is it normal that Udon with the last update works so inconsistently? I mean, I've tested my world before changing anything with the new update and everything was working great, then I just opened a script without touching anything and now that script isn't working anymore as it should (for now it happened mostly on scripts with onTriggerEnter/onTriggerExit) and I don't understand why, maybe compiling a script made in the old version with the new version will break it?
What do I do for object sync now for Udon?
Does anybody know how to itterate over all players in a world (say to set everone's Jump Impulse to 5)? This is after they're all in there already, mind you. Not at Start.
so in Unity I got a Trigger that detects whena PlayerLocal has collided with it. It works fine. But in game, it does not indicate any type of collision.
@proud snow just add Udon behavior component and check the sync position box (this only updates for prefabs if you change the attached graph/asset)
@worn summit I imagine you could add everyone who joins to a list and then grab everyone from that list to apply jump impulse on whatever trigger happens mid game
@distant ore what type of thing happens when the player collides with it?
ah nevermind I got it working :3. for some reason i can compare a PlayerLocal layer to the int 10 just fine in Unity
but in VRC it does not
stumbled across a post that has a fix for it
https://ask.vrchat.com/t/player-collision-in-udon/428 from TheHelpfulhelper
If you want to make something happen when the player collides with a trigger, e.g. runs into an area or touches some object, you will have to detect that collision. This is the setup that I use: Create a new layer and call it something like “OnlyCollideLocal” In your P...
So I got an explosion particle system working with Udon through Prefab instantiation locally, but when I upload it to the server it doesn't work. Nothing happens?
Does an UDON-powered world come with the updated jumping? Or do you have to enable jumping, like before
@north lintel you have to enable it but it is easy
there is also a node called like legacy locomotion or something that I believe is the old system. haven't tried that one though
You don't have to create that graph yourself. Vrc includes on just for that
I think it gets recommended if you search player mods or similar when adding a component
@buoyant radish Network instantiation doesn't work atm so you would need to make the particle system a child of the object that will be at the location you want it to emit from. And said object needs to be in the hierarchy and instead of instantiated teleported or moved with physics
@twilit breach Thats painful, I think all the features on the explosion are set to trigger on instantiation. So the object should be in the empty gameobjects hierarcy disabled and then just enable it with the Udon trigger instead?
Theres probably an 'On Enabled' code that I could swap the on instantiation code out for.
create a dupe prefab and put it in an asset folder called "waiting for instantiation update"
then use any number of methods to play it
I personally went with udon behavior sync so all players have the same location
and a network sent custom event that plays particle system
Oh so use a custom network event. That could work. I did have the Udon Sync enabled on the explosion prefab. It just wasn't instantiating to be synced. Any thoughts on when the update is coming out? It would be pretty usefull.
no clue, my folder is waiting though xD
how is it currently set? like just a no mesh/collider game object with a particle system that on play does the stuff you need?
@twilit breach May as well ask since I've put the question up several times with no response, maybe due to its simplicity
How do I delete self?
as in destroy the object? or something else?
Yeah thats all it is. It triggers sounds and stuff on instantiation and removes all traces of itself after the explosion plays through.
I had an on Mouse Down set to destroy the cube when it's clicked
it worlds for stuff like rotate, but not destroy
got a screenshot?
Caz, yeah would might have a faster time just changing all the instantiation events to on enable and enabling to catch all of it
so my destroy node has a slot at the bottom to input a variable
and you do get variable node, dropdown set to your game object and drag that into destroy node
does mouse down event change it and auto target?
So my Object Destroy has no obj Unity Object
I can fix it by changing Object to Object,Float and back again, is it just a bug?
I dunno, but you can put the variable in now?
on your asset folder in the bottom left go to udon and then in the bottom middle hit the txt called version

