#udon-general

59 messages · Page 83 of 1

high mural
#

oh thanks

#

just to be sure, this would be the correct way, right?
Networking.SetOwner(Networking.LocalPlayer, transform.gameObject);

grand temple
#

yes, though transform.gameObject is not necessary. You can just do gameObject

high mural
#

cool, thanks

blissful shore
#

im going to upload and see what happens

#

A few things , well a few more than a few things: The ship is floating like a baloon, the flight stick flys away from the ship. Once you grab the flight stick the stick it self it truns to the right and it only controls in one direction also there is no thrust 😄

#

I made the flight stick a child of the space craft just to see what it does should be chaos...

dreamy gorge
#

Is there any way to play direct URLs to audio files in vrc?

unborn hornet
#

Just use any videoplayer like normal

dreamy gorge
#

like USharpVideoPlayer?

#

i tried but it wouldn't play audio files

unborn hornet
#

If it doesnt, the content of the link might be incompatible or would at least need looked into specifically (meaning providing the link to someone else to ensure it works) cause plain audio should 100% work if it's setup correctly.

edgy ingot
#

can you SendCustomNetworkEvent a private void method?
or do they HAVE to be public

grand temple
#

they have to be public

edgy ingot
#

is there a way to send a network event without it being public?
making it so you can't poke it from the outside (since most/all clients from what i hear just sniff for public methods)

grand temple
#

network event has to run through the same thing that clients would use

#

but you could use manual sync variables to determine what actions you want to do instead

edgy ingot
#

basically have something (IE a button on an admin panel) set and sync a value
then have the public method just update the objects to the value?

high mural
#

what would be the udon equivalent of

        if(other.tag == "Ball") {
            //Do the thing.
        }
    }```
grand temple
#

you can't really use tags, at least not custom ones

#

I would recommend checking by name instead

high mural
#

ok; what about the ontriggerenter part?

grand temple
#

that is the same in udon

high mural
#

throws errors when i try it

#

actually those errors might be coming from elsewhere... not sure yet

#

commented out all of my scripts and errors remained; closed and reopened the project and they're gone. fun.

#

would anyone be able to say why i might be getting an error from this?
curSpeed = Networking.LocalPlayer.GetRunSpeed();

grand temple
#

well what error are you getting?

high mural
#

Assets/Scripts/SpeedAdjust.cs(18,42): Udon runtime exception detected!
An exception occurred during EXTERN to 'VRCSDKBaseVRCPlayerApi.__GetRunSpeed__SystemSingle'.

grand temple
#

does this happen on update?

high mural
#

might it be because i'm doing it in Start?

#

not on update

grand temple
#

start should work, that's weird

#

what's the rest of the error?

#

that only says an exception occurred

#

it should also say why

high mural
#

aside from the parameter addresses that's all i got

grand temple
#

the line immediately after the bit that you just posted

high mural
#

A quality setting was changed resetting to the default quality: Ultra.

#

doesn't seem related

grand temple
#

that's not what I mean

high mural
#

Object reference not set to an instance of an object

grand temple
#

this

  An exception occurred during EXTERN to 'VRCSDKBaseVRCPlayerApi.GetRunSpeedSystemSingle'.```

is not the whole thing
#

ok thank you

high mural
#

my bad didn't see the last bit

grand temple
#

do this on startif (Utilities.IsValid(Networking.LocalPlayer)) { curSpeed = Networking.LocalPlayer.GetRunSpeed(); } else { Debug.Log("LocalPlayer was null on start!"); }

high mural
#

cool that worked thanks. and i totally just realized why it was happening. it only happened when i tried to upload the world, not on cyan emu; makes sense now. i just need to have null checks for localplayer stuff like that

blissful shore
#

It only rotates up and down and there is very little/almost no thrust and its backwards. @grand temple any Ideas?

grand temple
#

again, you're not actually using the slerp

#

you need to apply it with rigidbody moverotation

#

and it needs to be connected to the fixedupdate with the white lines

#

the white lines are called flow and that determines the order in which everything happens

#

and the slerp is still backwards

#

is... is this the exact same picture as last time?

blissful shore
#

yes your right

#

Thank you very much by the way PhaseDragon

grand temple
#

there was nothing wrong with the isactive branch wa

#

you just deleted like the one thing that was actually working

blissful shore
#

LOL my bad

#

II connected FixedUpdate to rigidbody MOveRotation then to branch

grand temple
#

do you know the purpose of the branch?

blissful shore
#

to set balue

#

value

#

If true this if iflse that

grand temple
#

branch doesn't set anything

#

it uses the value

#

and the isactive value comes from the onpickupusedown, right?

blissful shore
#

yes

grand temple
#

so the purpose of the branch is to make it so a bunch of code happens only while the pickup is held down

#

and since it's coming from fixedupdate, it happens over and over

blissful shore
#

ohhhhhhhh

#

I need it to be able to rotate weather or not the pick up is being held down. Thrust is the only thing I want to happen when the trigger is pulled

grand temple
#

right

#

now with the thrust, what exactly do you want it to do in plain text?

blissful shore
#

I really appreciate the knowledge!

#

I want it to push the craft forward as I hold down the trigger

grand temple
#

right, so you've got that first bit "as I hold down the trigger" that's what the branch does with fixedupdate

#

so to define "push" what exactly does that mean in the context of setvelocity? When you push, that means you are adding velocity to it right?

blissful shore
#

but I want the ship to pitch roll and yaw in the same manner as the controller holding the flight stick

grand temple
#

hang on a second, we're not there yet

#

let's focus on the push

blissful shore
#

word

grand temple
#

you need to add velocity to it

#

now you already have a vector3 addition, that's the operation you want

#

but what exactly should it be adding together?

#

it should be adding the current velocity and whatever force you want to push it by

#

so do you see a problem with how it's set up now?

blissful shore
#

no numbers in set velocity

grand temple
#

set velocity is not the problem

#

follow it back all the way to the addition, what is that doing?

blissful shore
#

its just getting the players current velocity

grand temple
#

now what if I told you when you're sitting in a station, your velocity is zero?

blissful shore
#

then I wouldn't be moving

grand temple
#

well, the playerapi's velocity is zero

#

but the rigidbody is the thing you're actually wanting to move

#

so what do you think you need to do?

blissful shore
#

yes!

#

I need to change get local player to get rigid body api

grand temple
#

right

blissful shore
#

Set fighter

grand temple
#

so have you done that?

blissful shore
#

trying to figure out how

grand temple
#

first you search for rigidbody

#

and then you go into that category

#

and search for getvelocity

#

or if you're not sure what category something is in you can always do tab to do a full search and just type out the whole thing

blissful shore
#

ok I got that

grand temple
#

now how does it look?

blissful shore
grand temple
#

ok cool

#

now you've got the moverotation and you've got the slerp, you just need to hook them up

blissful shore
#

trying to figure that out now

grand temple
#

plug the result of slerp into the moverotation

blissful shore
#

got it

grand temple
#

now just like the rigidbody set velocity, don't forget you need to specify which rigidbody this should affect

blissful shore
#

is that in there already?

grand temple
#

no, it's empty

#

the "instance" slot of moverotation

#

which rigidbody do you want to affect?

blissful shore
#

the fighter

grand temple
#

so plug it in

blissful shore
#

plugged!

grand temple
#

ok how does it look now?

blissful shore
grand temple
#

ok try that

#

wait I just noticed this

#

whyy?

#

that's just going to clear fighter

#

and break everything

blissful shore
#

oh how did that get there

#

should I take out set fighter

grand temple
#

yeah

blissful shore
#

ok what about set velocity player local and Get velocity on top should I delete that as well

grand temple
#

the flow is not connected so it won't do anything

#

it's unnecessary

blissful shore
#

uploading now

#

Still a bit wonkey but as far as up down left right its good still no noticeable acceleration

#

I need to clamp the rotation

grand temple
#

reduce the value in slerp

#

to something like 0.01

#

I think the velocity is probably just accelerating so fast and then getting clamped to 40. You could multiply the "transform get forward" by a small value too

#

keep in mind that this happens 90 times a second so if you add 1 to your speed you'll reach that in less than half a second

#

you can also use multiply by Time.FixedDeltaTime which is a float that is equal to 1/90th of a second or whatever your refresh rate is

blissful shore
#

how to I I multiplu the Transformget forward?

blissful shore
#

I must tstill be doing something wrong

blissful shore
#

@grand temple Im wondering why this isnt working properly. If I grab the flight stick the trigger does nothing and the only wo get it to move at all is to rais my hand up in the air. Its bizzare.

#

and I cant type today lol

civic birch
#

Can I call the pedestal command remotely with an event?

blissful shore
#

I wish I knew

#

do you mean like to toggle it ?

cunning mist
#

If so, instead of setting the velocity of the object they're holding, just go ahead and set the velocity of the player. Here's a basic breakdown of how to go about doing that if you want.
https://youtu.be/fiS-iMY1m5A

Want to fly in your VRChat world? Here's a basic way to get started! It will let you fly around your environment as you'd like while also having a speed limit, unless you want to learn what it's like to transcend reality itself. Not a bad idea.

00:00 - Intro
00:16 - Setting Up the Prefab
03:00 - Graph Scripting
07:00 - Infinite Acceleration
08:...

▶ Play video
vernal maple
#

Need just a quick udonsharp hand

#

Trying to make an interactable "grab point" style thingie for the player, think boneworks over the shoulders stuff.

#

I have a VRC_Pickup there already, and when I pick it up, I want to replace the object in that hand with another VRC_Pickup, for example, a fishing rod.

#

Just trying to figure out the code to force the player to pickup the item.

#

(LocalPlayer.SetPickupInHand() apparently isn't exposed, so confused there.)

blissful shore
cunning mist
#

In that case, just use an AddRelativeVelocity node with a 1 or whatever in the z value. Try getting it to actually accelerate first before adding in the rotation matching.

blissful shore
#

thanks . where do I add it in this mess I made ?

cunning mist
#

Uhh
I'd make a new one honestly
Duplicate the graph you have right now and just keep what you're doing with UseDown and Up, then in FixedUpdate add relative velocity after a branch that checked if you're pressing it.

blissful shore
#

I cant find relative velocity

#

@cunning mist Im going to remake the version in your tutorial and start there. I cant seem to make an "Add Relative Velocity" node

cunning mist
#

Uhhh
Rigidbody.AddRelativeForce actually

blissful shore
#

oh thanks !

#

@cunning mist im trying to recreate a spaceship that someone made for me in an SDK2 world. Basically it was a spaceship that had a joystick control It.

#

been in here all day with Phasedragon trying to figure it out . hasnt worked yst

jolly shale
#

I was just in 3 instances of Murder 4, 2 of which got attacked. I've been told that the thing the attackers use to give people seizures overloads Udon, causing the game to bug out. Is there a Udon fail safe system planned for future releases? I'm really worried about this because I've already seen about 6 people have a seizure due to this. Just a peace of mind question.

idle wasp
#

Hi everyone! I'm trying to make a custom Deck of Cards using Vowgan VR's Preset Deck of Cards. Looks like the limit is just 52 cards, I would like to know how to add more cards. Currently, there's a mesh for every section of the Atlas, but I don't know exactly how to specify the "areas" to add more cards. I tried to inspect the individial card meshes, and all of them are linked to the same Atlas (The Deck of Cards Material). Does anyone knows how it exactly works? How can I create a Mesh for just a small area of the Atlas? Thanks in advance !!! ❤️

#

(Sorry for my bad english btw)

cunning mist
idle wasp
#

Hey! It's you !!

#

Thank you so much for your work !!!

#

I'll try to find tutorials about UV, I really don't know how that works. I'm a total newbie

#

In fact, I didn't understand half of the things you said hahahaa

#

But thanks a lot for your help !!!!!!!!!

narrow cloak
#

Is SetVoiceGain 0 Default or Silent

cunning mist
narrow cloak
#

thanks :>

blissful bear
#

Anyone know how to make a music toggle?

#

Yknow so you can turn music off and on

indigo finch
# blissful bear Anyone know how to make a music toggle?

The easy way, is to just toggle on and off a empty gameObject with an audio source on it that is set to 'playOnAwake'

If you really want to avoid toggling the object for whatever reason, you can use a audiosource.play and an audiosource.stop node. Then add a audiosource.isPlaying node, grab the bool and plug it into a bool.unarynegation node, and put that into a branch node. Then you simply add an event Interact node, put its arrow into the branch node, and if its true it goes to the audiosource.play, and if its false it goes to the audiosource.stop node. Here's a vid tutorial on a simple play button to get you started: https://youtu.be/cQ3hWKY-NiA

A simple tutorial, covering how to make a button that plays a sound in udon. I've seen a couple of post asking about how to play a sound in udon, so hopefully this will give a good foothold to bounce off from.

If there is anything I missed, please leave a comment bellow!

▶ Play video
slate orchid
#

hia so my friend sent me some udon# but i do not really understand there code could someone explain it and or show me what it would look like as a graph

#

OnColliderEnter(Collider other)
{
if (other.gameObject.GetComponent<SomeComponentThatOnlyTheBarrelHas>() != null) ((Barrel)other.gameObject.GetComponent(typeof(UdonBehavior))).DecreaseHealth();
}

#

trying to make it so when a bullet hit a barrel it set off a custom event i have made

grand temple
#

if your friend sent you something you don't understand you should probably ask them to clarify

slate orchid
#

i ask that and he said if i understand the udon graph i should be able to fellow it

#

@grand temple could u explain it to me plz

#

idk if i am doing it right

grand temple
#

you need a getcomponent node

#

get the udonbehaviour on that object and then plug that into a sendcustomevent node

#

then send "DecreaseHealth"

#

and if the udonbehaviour on that object has a DecreaseHealth event, it will happen

slate orchid
grand temple
#

you can getcomponent from the gameobject

#

search for gameobject, go into that category, and then search for getcomponent

blissful bear
blissful shore
#

HI @grand temple ! how are you today? Thanks again for your help. I didnt get it to work yet .

slate orchid
#

@grand temple also what object do i out the script on the bullet or the Barrel

grand temple
#

I'm sorry guys, I need to take a break from answering questions, it's really draining

blissful bear
#

it doesnt seem to work

indigo finch
blissful bear
#

oh okay

#

i had to swap the stop and play nodes

#

thank you though

#

it works now

pure isle
#

Lol what ya trying to do

blissful bear
#

making a music toggle button for my world

pure isle
#

For music files for unity or no

blissful bear
#

well you can import music files into unity

#

so ig yes?

#

idk lol

pure isle
#

Lol I need help I’m trying to make a button for that where it toggles music from a file lol it’s pain

blissful bear
#

did you import the file into your assets?

slate orchid
#

@indigo finch could i get your help

#

with getting the bullet to collide with the Barrel i got told to uses this code but i still do not really understand could u explain it in the udon graph for me plz when u have some spare time

#

OnColliderEnter(Collider other)
{
if (other.gameObject.GetComponent<SomeComponentThatOnlyTheBarrelHas>() != null) ((Barrel)other.gameObject.GetComponent(typeof(UdonBehavior))).DecreaseHealth();
}

scarlet lake
#

So I recently started working on an avatar storage world, and I wanted to create a decorative sphere that rotates above the world.

when compiled in unity, I can see my script that I added to the sphere object working. However when I build from the SDK, the sphere doesn’t turn.

Using SDK3, Unity 2018.4.20f1 (64-bit)

Script for Rotation:

public class Rotate : MonoBehaviour
{
void Update()
{
transform.Rotate(new Vector3(0f, 2f, 0f) * Time.deltaTime);
}
}

indigo finch
indigo finch
scarlet lake
#

Is it possible to have the udon please?

high mural
#

can you pass a parameter to a public method through SendCustomNetworkEvent? if so how?

indigo finch
indigo finch
high mural
#

ok, was just hoping to avoid having multiple methods, make it more slick. but i can do it that way. i'm in udonsharp though, not graphs.

indigo finch
high mural
#

yeah, wanted to make it more efficient but i guess it's gotta be this way. oh well

indigo finch
#

it do be like that. at least we're no longer as restricted as we were with sdk2

high mural
#

i wasn't around for SDK2, but i'll take your word for it.

indigo finch
#

Neither, but I've seen the crazy workarounds. like making an object respawn by running an animation that sets its position, then stopping the animation so you can pick it up and move it

high mural
#

doesn't sound fun

indigo finch
blissful bear
#

How would i combine these two functions?

#

the top hides and shows a button and the bottom plays and stops music

#

i want it to show MUSICPLAY while the music is playing and hide MUSICSTOP

#

and vice versa

#

i want it to happen when you interact with the object but i can only make one interact event

#

in case the visual helps

indigo finch
#

You just need to change the objects states accordingly:

indigo finch
blissful bear
#

oh i didnt know you can use the value boxes in the nodes

#

thats smart

#

thank you

#

hmm it gets stuck on the musicplay and doesnt switch back

#

i set it up about the same

#

idk what went wrong

#

i recompiled and it worked?

#

okay

#

thanks for your help though

#

i really appreciate it

#

i just started a few days ago so i have no clue what im doing

#

🥲

indigo finch
#

you'll get there, don't worry

slate orchid
indigo finch
slate orchid
#

i mean for the graph node

indigo finch
#

huh... right click, get node, string, const string

slate orchid
#

ahhhh thank you

kind nexus
#

Hi, I am Trying to have the items that are in an object pool to appeared awake. Is there a way to do that?

slate orchid
vernal maple
#

Anyone here able to assist with a shoulder mounted inventory system? Specifically grab points over the shoulder to grab specific predetermined tools. Trying to find a convenient way to make the VRC_Pickup component able to be grabbed by grabbing over the shoulder.

vernal maple
#

I think I have a viable way to make this possible by moving the "center" property of the second collider over the player's shoulder, but not quite sure how I would translate the world to local space, and account for the rotation.

stable thicket
#

Out of curiosity, cause I'm working on a puzzle that needs the player to go one place and come back, is there a way to "change" the respawn location?

mossy crane
#

either assign a new value on element 0 or move the VRCworld thingy to the new respawn loc

stable thicket
#

Well that's the default but can I call that after they'd spawned into the world?
Like you had to say, jump platforms, then at the other a switch you hit changes it to the location you'd in that moment?

mossy crane
#

Hmm havent tested in SDK 3 but that vrcworld is always the spawn loc unless changed

#

so moving that gameobject should work

#

locally

stable thicket
#

Mmmm~ I'll have to give that a shot.

mossy crane
#

Testing it rq

#

confirmed, moving the vrcworld(or whatever your spawn is) after the server is made, spawns you at its new location anytime you fall -100 or press respawn

#

There is a failsafe im pretty sure where if you like remove the platform below a spawn, VRC kicks you to your home, so you cant endlessly fall and respawn

#

it checks for solid ground b4 respawning

stable thicket
#

Sweet~ Thank you very much! ^w^
I'll keep that failsafe in mind too in case I notice myself being auto-wraped.

prime fossil
blissful shore
#

I have a simple audio player in an udon world thatI built .. It was working fine an now its not working ... anyone else having this issue?

#

did they finally faze out audio source ? is there a new Udon equivalent to AUDIO source?

blissful shore
#

this is really Bizzarre Im using the same player in a different world and it works fine

blissful shore
#

Oddly enough all I had to do was hit compile again in Udon Graph .... Should have been the 1st thing I checked.

indigo finch
#

what's the best way to get key inputs in udon graph? I know with udon# you can import it as a float, but I can't seem to find that with graph. and this... spaghetti code doesn't seem to be working right.

distant prairie
#

quick question: can you use udon sharp on avatars? to make a one player game?

paper galleon
#

No, you can only use Udon (Sharp or graph) in worlds

left cedar
#

anyone got a problem fail to upload fole when upload udon?

indigo finch
left cedar
pure isle
#

Sent ya a friends request ask me if ya need help I’m learning still but yea I know a few

distant prairie
#

there goes the idea of making a game on an avatar and play it in different worlds

pure isle
#

K can I help ya

distant prairie
#

not at the moment

#

I just had this idea and wanted to know if it was possible

pure isle
#

K well it’s not possible but if ya need avatars ask me and I can send you a model I got a decent amount lol

#

Also I know a bit for udone so

sharp echo
#

how do i set a variable in a child with u#?

fiery yoke
mystic crag
#

Hello
I need help

#

i try make a portal

#

one work

#

second not

indigo finch
# mystic crag

There's nothing wrong with the code. double check that the second one that doesn't work actually has a target gameobject setup. Otherwise it will just teleports you to itself, which will look like it's not working

mystic crag
#

when I push the button , player teleport on this button

#

but not to target2

elder apex
#

Hello beautiful people 💜
Hope, I do it in right channel.
I was wondering, if it's possible to add custom filler image when video player can't load stream from playlist (YouTube and Twitch), because it's offline atm.. All players I tried just give you an error message.

round furnace
#

How do I do math? Like, multiply float variables by decimals so I don't need 3 different movement variables. i.e. 1 set as walk speed x1.5 for run speed x0.6 for strafe speed. Please ping.

indigo finch
indigo finch
#

though they don't have to be nodes going into it

round furnace
indigo finch
# round furnace Where do I find the nodes for it?

on the graph, right-click, got get node, float, and then you will see all the nodes for floats. in this case I used the multiplication node, but there is also the basic add, sub and divide nodes too.
if you are working with ints instead of floats, you would instead right-click, get node, int, and then whatever the node your after

wet oasis
#

someone help me get the golden brush skin

indigo finch
#

lol

#

Honestly, udon graph doesn't work for larger 'scripts', but it does work for in larger projects. If however, you were wanting to make, say a vehicle or something, you honestly can't really make it in graph. at least, not without a lot of extra dumping scripts to store bits of the code before finally combining it together, and that would only work for a simple vehicle. anything too large and the lag caused from udon graph compiling on every node change, the inability to create temporary values that you can store into, and the general instability of it for really large graphs just makes it unfeasible.
You can however, totally use udon graph scripts along side udon# scripts, and this is good for any small simple scripts; especially if you have a lot of them.

kind nexus
#

hi, I have an object pool set up for some items but i want the items to be spawned at the begining. is there a way to do that?

high mural
#

it seems like Bloom isn't accepted as a variable type by Udon, so I was wondering how do people go about adjusting bloom? activate/deactivate the gameobject? What if you wanted to be able to turn the bloom up and down?

indigo finch
# high mural it seems like Bloom isn't accepted as a variable type by Udon, so I was wonderin...

Here's a tutorial for a darkness slider. The process is the same, just with different post processing settings. Believe you can call the weight directly with udon now, though I have yet to get that to work. https://www.youtube.com/watch?v=r-3L2h0yDkc

Here's how you can make a world darkness slider in udon! For now at least, Udon doesn't allow for you to access any of the post processing variables, so it took me a while before I learnt how you could do it via animations. That being said, using this method could totally be used for other post processing effects like bloom or vignetting, not ju...

▶ Play video
pseudo pelican
scarlet lake
#

im trying something new for the first time like how would i go about making a gun for a world that works and makes players take damage

indigo finch
# scarlet lake im trying something new for the first time like how would i go about making a gu...

You'll definitely want to look at something like Toly's combat system:https://github.com/Toly65/UdonCombatSystem .
If your wanting to do it yourself, you will need to make an object for the gun to hit, with one attached to each player, if your doing it via ray cast. Otherwise, you could do a really long and skinny game object from the end of the gun, so you can call a 'onPlayerTriggerEnter' event when it hits, though you will have insane punch-though that you will need to account for

GitHub

A simple combat system designed for VRchat. Contribute to Toly65/UdonCombatSystem development by creating an account on GitHub.

scarlet lake
indigo finch
# scarlet lake whats the death bot for tho it doesnt explain it lol

It's a prefab, and not all prefabs have the same level of explanations. Look to see if there is an example scene, remove parts and see what breaks, to see what exactly is needed and what is quality-of-life fluff, and/ or look through the code to see what it is doing.
If that's too much, perhaps you should look through some base unity tutorials and try it in base unity, and then try and port it over to vrchat.
Unfortunately it isn't the easiest thing right now to make a shooter. Perhaps making your own gun, and add player hitboxes with phaseDragons object pool asset might be a better approach.
This is just some jumping off points, and by no means a guide or tutorial

wraith gate
#

I'm trying to make a dnd world and everything work except my spawned objects they spawn in for everyone but only the owner can pick it up and no one can see them moving https://ask.vrchat.com/t/object-spawn-set-to-world-owner-only/8346

indigo finch
wraith gate
indigo finch
#

.

#

So, I'm trying to get the difference between two rotations (hand and seat obj), and change that to a vector3 that I can put into a rigidbody.AddRelativeTorque. That being said, I think I'm messing up my quaternion math. Anyone know how it's wrong?

fading cipher
#
//This is formatted text
mystic crag
#

@indigo finch I found problem, I dont change transform, now it's all fine, thanks

indigo finch
#
Vector3 _torqueInput = Vector3.zero;

Quaternion _transRot = vehicleTransform.rotation;
Quaternion _handRot = new Quaternion(0, 0, 0, 0);

if (leftHandHolding)
{
    _handRot = _localPlayer.GetTrackingData(VRCPlayerApi.TrackingDataType.LeftHand).rotation;
}
else
{
    _handRot = _localPlayer.GetTrackingData(VRCPlayerApi.TrackingDataType.RightHand).rotation;
}

_transRot = Quaternion.identity * Quaternion.Inverse(_transRot);
_handRot = Quaternion.identity * Quaternion.Inverse(_handRot);

Quaternion _rotDif = _handRot * Quaternion.Inverse(_transRot);

_torqueInput = _rotDif.eulerAngles * vrRotScale;
_torqueInput = new Vector3(Mathf.Clamp(_torqueInput.x, -1, 1), Mathf.Clamp(_torqueInput.y, -1, 1), Mathf.Clamp(_torqueInput.z, -1, 1));
indigo finch
wraith gate
jaunty dagger
#

Hi, I got a quick question: Is there any way to sync the toggles of a panel in VRChat?

#

Attaching a VRC Object Sync to the checkmarks of the toggle seems to only sync rotation and position but not appearance (checkmark or no checkmark).

night viper
# jaunty dagger Hi, I got a quick question: Is there any way to sync the toggles of a panel in V...

Syncing is different with Udon (sdk3) You would need to use synced variables or a network event. You can learn more about it here. https://docs.vrchat.com/docs/udon-networking Also the SDK3 has an example scene with a synced UI example

frosty mason
#

By locking the inspector panel one can drag many different files into an array like this to populate it, so you could easily have an array filled with an absurd number of assets without having to drag them one at a time

#

but i can't do it with a public variable array in an udon script

#

is there any way around this?

jaunty dagger
night viper
#

Only the owner of the udon behaviour can make changed to that synced boolean, you then need to serialize the synced variable with others either automatically or manually

compact sable
#

I want to make a Board that moves back and forth so that the Player standing on it can move with it. I do this by setting the position to move back and forth. But that doesn't make the player follow the move. Is there any way to achieve what I want? (I used google translate, the grammar may be a bit strange)

frosty mason
compact sable
#

Thanks, got the effect I wanted

topaz jetty
#

is there any way to detect if the instance is private or public?

jaunty dagger
#

Without it, everything (besides the sync of the UI toggle) works fine.

night viper
#

How do you have it set up? can you post a pic?

jaunty dagger
#

Yup, one second please

#

Don't mind the inspector. It says "none" at Toggle, but when I tried it before, I had it all set up. I just deleted it in the meanwhile and quickly recreated it so you can see what I had done.

night viper
#

Is the "state" bool starting false or true? Because it will always return to its original value (let me try to explain on the picture)

jaunty dagger
#

Its starting true

night viper
#

(3rd text Unary* not unaty)

jaunty dagger
#

Ohhh, you might be on to something here. Let me try mess with the start value

#

Thank you!

wind atlas
#

Instead of unary negation, try taking the value of the toggle isOn value directly. I feel like that is cleaner.

jaunty dagger
#

I'll try 🙂

wind atlas
#

And cleaner usually means easier to read and less unintended bugs.

jaunty dagger
#

Ah I thnk that wont work, as I need the state boolean to register a state change

wind atlas
jaunty dagger
#

Or I could try and set the State value, but still using the isOn of the toggle as reference

#

right

frosty schooner
#

so i'm trying to get a mirror toggle to work in my first world and im having some trouble. for some reason when i open udon graph and go to add the gameobject.setactive node, it's not there when i search for it. the object im using as a toggle is just a cube. what could be causing this?

#

OH nvm i figured it out lmao

jaunty dagger
wind atlas
# jaunty dagger right

Oh yeah, I also just realized you are doing set isOn in the Interact. The thing is, the toggle automatically sets isOn for you. (hope I'm not wrong lol)

jaunty dagger
wind atlas
jaunty dagger
#

Let me quickly try that approach

#

Seems not to sync the button

#

Because I am a moron and forgot to set the toggle...

#

brb

#

Hm, now the instance that uses the toggle crashes Oo

wind atlas
# jaunty dagger

I don't know why it crashes, but you are still using unary negation, you don't need it since toggle automatically does that.

jaunty dagger
#

ah forgot. right

wind atlas
#

I tested it myself, this works for me:

jaunty dagger
#

in your example, is there a reason you didnt check "sendChange" ?

wind atlas
jaunty dagger
#

Thank you!

#

I quickly try it again without the unary

#

God bless you, it works!

frosty schooner
#

ok, still having problems with my mirror toggle. i followed the udon graph of the tutorial im using exactly, but for some reason when i test the world it doesn't toggle the mirror, it toggles itself instead? when i interact with it, it just disappears. am i doing something wrong?

#

here's the udon behavior component and udon graph im using:

jaunty dagger
#

Is the VRCMirror Gameobject setup properly in the Inspector of the udonbehaviour?

#

It says "Self"

#

I assume your UdonBehaviour is attached to the toggle and not the mirror, is that correct?
In that case you need to drag and drop the mirror gameObject into VRCMirror

frosty schooner
#

ah i see now

#

the toggle works now! thank u!

#

one small thing tho, is there any way i can make it so the mirror starts as inactive when the player first spawns in?

jaunty dagger
#

Yes, you can set the gameOb ject inactive

#

the little toggle checkmark in the inspector on the very top

frosty schooner
#

awesome! it worked!

jaunty dagger
#

I also got a quick question to whoever can help me with this:

I have a lamp model with 4 lights attached that should get turned on and off when a user interacts with the lamp.

#

It sounds quite simple but somehow I keep getting the error that the lights were not found and the udonBehaviour got shut down because of this.

#

But as you can see, the Lights are all attached

#

I even added the "IsValid" to make sure there are no bad apples

#

The top part of the UdonGraph is turning the light on and off and the middle part is responsible for swapping the light bulb material.
Since the error message in the log says Light not found, I expect the problem to be sitting somewhere in the top half.

wind atlas
#

The actual error message might be useful, usually it tells which part is failing.

#

I'm assuming the get value of the Light array does, because you don't input any instance into it.

jaunty dagger
#

Aaaaah you are right!

#

Thank you!

#

facepalm its always the obvious things I am missing

cedar iron
#

is there a way to count how many times someone presses a set of buttons? i'm looking to make it so that if the user presses 50 buttons, there's a material change

wraith gate
#

I got a new question how would I set up my udon and object pools so i can have 27 buttons to spawn in each item
https://ask.vrchat.com/t/how-to-set-up-object-pool-to-spawn-27-different-objects/8375

wind atlas
cedar iron
wind atlas
cedar iron
#

Yes.

wind atlas
#

If you do, then you pretty much have all the ingredients.

cedar iron
#

right, but how does that increase a counter that is public across multiple buttons?

wind atlas
#

Are we talking about a canvas button here?

cedar iron
#

no, physical buttons that send a custom _OnPress trigger that outputs a public script

#

i'm using Markcreator's ImpressiveButtons

wind atlas
wind atlas
wraith gate
wind atlas
#

Maybe it's better if you could describe what those objects are.

wraith gate
#

they are creature tokens for D&D and each button needs to spawn a certain creature

wind atlas
#

The way a pool works is that you can recycle the same object, for example a projectile from a gun. It will be returned to a pool after a certain distance so you can spawn it again from the pool.

#

Alright, so you have a thing "creature" that can have different attributes and appearance. And there 27 different kinds of creatures. What is the number 8 you mentioned in the post?

wraith gate
#

i have the spawn buttons in groups of 8 to fit in the world

wind atlas
#

Are you spawning creatures (3D model and stuff) or just the buttons for those creatures?

wraith gate
#

im spawning models

wind atlas
#

I'm still not sure if you even want a pool. How many creatures do you want to have in the world at the same time maximum?

#

You could just create those 27 tokens yourself without a pool.

wraith gate
#

there would be more than 27 for example there is a scene where you need about 10 goblin tokens

wind atlas
#

I think I'm starting to understand. I think the best way to handle it is to have a bunch generic creature tokens in a pool. Then you can modify and give them 3D models and attributes at runtime. That can become a bit complex to implement though.

wraith gate
#

what if I had 27 object pools for each creature and in the pool itself it was fill with duplicates

wind atlas
#

I was about to mention that, if you are just starting out with pools, then that might be better. Just have to manually create them and it's not really efficient.

#

Might work though.

#

Is your question mostly about how to use pools?

wraith gate
#

ok I can try that I just need to change my trash can from a destroy to a reset on collision

wind atlas
wraith gate
#

how do I check the owner to anyone can do it

wind atlas
#

I think just calling SetOwner to local right before you do TryToSpawn is enough.

wraith gate
#

ok thank you

wraith gate
wind atlas
wraith gate
#

This look right

wind atlas
wraith gate
#

ok I'll try it out

cedar iron
#

Can a trigger start two udon scripts at the same time?

wraith gate
#

yes it can just put two udon behaviors on your trigger

blissful shore
#

ooo that gave me an idea . Im going to make a short audio loop that sounds like a rocket... that plays/loops while the trigger is down.

blissful shore
#

Some time ago, I saw a Quest/Pc compatible Video player with a keyboard attached to it that had a working Youtube search bar. any Ideas on how one would make that? also does it go against VRCHAT policy because I cant find that world and Im pretty sure I favorited it

stuck sentinel
#

I need some serious help with an udon script that wont work right

#

please i need help from someone

blissful shore
stuck sentinel
#

so this

#

is supposed to look like

#

but it wont extend

blissful shore
#

hmmmm

stuck sentinel
#

obvi im going off a tutorial so like ignore that

#

in the video it just did that but it doesnt say how to get that

blissful shore
#

did you compile it?

stuck sentinel
#

what

blissful shore
#

did you hit compile all UdonSharp Programs

stuck sentinel
#

oh yeah ofc

blissful shore
#

save your work close and open unity

#

hold tight some one will read this and have the fix for it

stuck sentinel
#

ty chuck ❤️

blissful shore
#

Yw. Unity is glitchy like that

stuck sentinel
#

omg right?

indigo finch
#

Yea, try restarting unity (can glitch sometimes). if not, mind posting some of the code?

blissful shore
#

I had an audio script that all of a sudden stopped working . I went crazy trying to figure out what happened. for some reason I had to recompile it.

stuck sentinel
#

actually could i better yet call someone? its hard for me to explain my problem

#

now its giving me an error after restarting unity

blissful shore
#

im not the best at these things but yea some one in here with answers will be cool enough to take a discord call

indigo finch
#

post error. btw, windows key + shift + s is a super easy way to screenshot parts of a screen

distant vessel
#

Hello, I have some trouble with a world I imported from booth. it's on SDK3 but the jumping isnt enabled. I,ve never used Udon so I have no idea what to change. The graph is this :

indigo finch
#

huh... have you changed the name of the file?

blissful shore
#

go back in the Udon Graph and hit compile in there and see if that works

indigo finch
blissful shore
#

Player knows wassup

distant vessel
indigo finch
indigo finch
indigo finch
stuck sentinel
stuck sentinel
blissful shore
indigo finch
distant vessel
blissful shore
#

Must remember : window shift s , must not forget

stuck sentinel
indigo finch
distant vessel
#

oh okay wait a sec

indigo finch
stuck sentinel
#

er wait

indigo finch
distant vessel
stuck sentinel
indigo finch
stuck sentinel
#

bet

#

here?

#

or can i dm you

indigo finch
stuck sentinel
indigo finch
distant vessel
#

uhm the first image with the two udon scripts is not the same as the 2 with the code
it's like :

VRCWorld (where the two udon scripts are) -> VRCWorld Variant -> VRCWorld (where the udon code is)

I think I added the 2 scripts at some point trying to solve the jumping

indigo finch
stuck sentinel
#

well

#

:/

blissful shore
#

Does anyone know if its against VRCHAT policy to have a search bar on a Youtube video player?

stuck sentinel
#

never heard of it ^

distant vessel
blissful shore
#

I saw one what was both PC/and oculus compatible tHAT WORKED PERFECTLY

#

woosp caps

distant vessel
#

where did you find it? asking for a friend

indigo finch
stuck sentinel
indigo finch
indigo finch
# distant vessel ?

huh... normally on any udon behaviour script, there is a button to open it up in udon graph. but you don't seem to have it there... is this a sdk2.0 legacy script perhaps? I was never around when sdk2 was a thing, so I wouldn't know. It's just.... weird

distant vessel
#

yeah it's weird

indigo finch
#

what does the 'join master' even do?

indigo finch
distant vessel
#

I am confusion O.o

#

yeah let me just find it

#

セットアップ済みのワールドパッケージデータ「10x10x10m」です。ある程度、家具やミラーなどのギミック、ライティングがセットアップされたシーンと建物のみのシーンが用意されています。 各オブジェクトはCubeを並べただけなので、カフェやバーみたいにしたり、区切って部屋を作ったりしてもいいかもしれません。 【ダウンロードファイル】 ・10x10x10m-3.0.zip -- Unity2019 VRCSDK3向け ・10x10x10m_2018_b.zip -- Unity2018と2019 VRCSDK2向け 【サンプルワールド】

#

I downloaded this one

indigo finch
#

weird. So this seems like it is just a simple hangout world with some scripts for lights, mirror and the likes. Why all the extra scripts and what not is what's confusing me. I wonder if its using cyan triggers or something...

distant vessel
indigo finch
#

Trigger2to3 is new to me. sorry, can't give much help, but it would explain a lot

distant vessel
#

I'll try that, and if it doesnt work, well, no jumping I guess XD

#

thank you for your help

indigo finch
indigo finch
indigo finch
blissful shore
#

This is why im wondering if it goes agains VRCHAT policy

distant vessel
#

damn 😦

distant vessel
blissful shore
#

Just found out that It was possible but VRC patched it because it opened up some insecurities in the game 😦

#

they should fix that

#

A band camp or spotify player would be awesome . thisd way I could save like 80 MB

#

does anyone know how I would make a sound loop as long as I hold the trigger down?

turbid relic
#

It is possible with Udon to get if a user is PC/Quest?

covert dragon
#

Anyone know why my Const Quaternion keeps resetting back to 0,0,0,0?

ivory willow
#

I've been wanting to add a panel with buttons so each player changes their own movement speed, only tutorial I've found, I think is outdated? Because when looking for things in the udon graph I can't seem to find the same ones as the tutorial, any ideas or anyone with a tutorial at hand on how to do that?

indigo finch
# turbid relic It is possible with Udon to get if a user is PC/Quest?

Are you after this to be global or local? if it's just local, you can have a public bool that you turn on when you build the quest version. if your after it to a global thing, using something like phasedragon's object pool to assign an object to each player, you could have a synced bool value that the local player sets

indigo finch
ivory willow
#

If you don't mind, that would be very much appreciated it!

indigo finch
ivory willow
#

Thank you very much! I'll take a look at it and hopefully can learn how to do my own with this as an example!

indigo finch
scarlet lake
#

so i have a problem with vrcsdk not letting me log into and build test it and i have looked and done what the article said twice and it still wont let me log in

scarlet lake
#

yes

#

it is on there

indigo finch
#

hmmm... as a sanity check, have you tried reinstalling the sdk?

scarlet lake
#

not the udon sharp

indigo finch
#

everything vrchat related (sdk + udon#)

scarlet lake
#

no i will that

indigo finch
#

if your sdk is too far out (or glitched for whatever reason), it can stop it from uploading. reinstalling it fixes that

scarlet lake
#

it didnt work

scarlet lake
junior path
#

I have an array of AudioSource's, how would I check if isPlaying is false for all of them, or true for one of them? Currently I have a for loop that goes through and gets isPlaying, but I'm lost on how I'd get if they're all false

indigo finch
junior path
#

I'll try that, I want it so that once a song ends, it continues to the next, but I need to check to make sure another one isn't already playing from being changed

junior path
#

is AudioSource Get time the audios length, or current time? I cant seem to find a length for AudioSource, and it seems like Get time is giving the current time, not length

indigo finch
junior path
#

ah that makes sense, thank you

indigo finch
#

np ^^

junior path
#

got it working! Thanks for the help

magic smelt
#

yo guys im getting my vr tomorrow and if anybody can please give me some really relaxing worlds or something with really nice views for my mom I would really appreciate it

junior path
# indigo finch np ^^

In my array I have 7 audios, and in my for loops for it when logging it only logs 6 times, I'm not sure if the for loop skips 0 or what, tried setting it to 0-7 in my loop but it didnt change anything

wind atlas
#

I think the for loop is designed in a way, where you use the array.Length for the end input.

narrow prism
#

is there any good way to deal with players leaving a game that's team based. I've been trying to use the OnPlayerLeft event, but I always get an error whenever I try to access the player data. Also I don't know if this has any significance to problem I am mostly using Udon sharp.

tall vault
#

You can still compare the vrcplayer reference in OnPlayerLeft against an array of vrcplayer objects you built up for the team to see who left

#

And build another array with the player displaynames or playerids that have the same corresponding indices as the vrcplayer array

wind atlas
#

You have to basically call the playerId of that player so it caches properly, or whatever it does in the background.

narrow prism
wind atlas
narrow prism
tall vault
#
[UdonSynced] public int[] teamPlayerIds;
private VRCPlayerApi[] teamPlayers;

public override void OnDeserialization() => _UpdateTeamPlayers();

private void _UpdateTeamPlayers() {
    teamPlayers = new VRCPlayerApi[teamPlayerIds.Length];
    for(int i = 0; i < teamPlayerIds.Length; ++i) {
        teamPlayers[i] = VRCPlayerApi.GetPlayerById(teamPlayerIds[i]);
    }
}

public override void OnPlayerLeft(VRCPlayerApi player) {
    for(int i = 0; i < teamPlayers.Length; ++i) {
        if(teamPlayers[i] == player) Debug.Log("Player ID " + teamPlayerIds[i] + " has left the world.");
    }
}
#

Then you can remove the player from the teamPlayerIds list and do whatever other cleanup you need

narrow prism
indigo finch
# junior path In my array I have 7 audios, and in my for loops for it when logging it only log...

When you changed it to 0-7, you probably forgot to hit compile. Udon only compiles when you add/ remove a node, or connect a node. It doesn't compile if you just change a value. This helps avoid lag spikes.
As for arrays, here's some reference: https://youtu.be/s3mZ7SLfmzI

Here's a tutorial that goes over calling all game objects inside a game object array. This same method would work for any arrays, be it colliders, pickups or audio sources arrays.
I made this tutorial, as it's a little confusing not being able to directly plug a game object array into a set active node, and going from a simple toggle script, to ...

▶ Play video
frosty mason
#

any way to populate a public array variable in an udon script with many items (in my case asset files) without having to drag and drop them all one by one? locking the inspector and dragging them into the name of the array like with a normal unity script doesn't seem to work, i guess because there's something different about the way udon variables are shown in the inspector panel

wind atlas
frosty mason
#

looks like using udonsharp works around my issue

indigo finch
steel lava
#

Quick question this may sound a little weird but can I get guns on pc?

indigo finch
steel lava
#

Thank you

supple root
#

Is there any way for me to store a position/transform in a variable that can sync(since transform variables aren't synced)?

fiery yoke
indigo finch
supple root
fiery yoke
indigo finch
#

^ Or a vector3 and vector 4 for the quaterntion

fiery yoke
#

Its just not good, when operating on it.

#

Im pretty sure its the best representation data wise

indigo finch
#

Fair, but figured it would be more direct when it came to setting it. Just plug it straight in. Doesn't sound like he's wanting to view the output at all

fiery yoke
#

Ohh well yeah, but then youre "wasting" 4 bytes. But I guess Im just hypersensitive when it comes to bandwidth, because of how quickly you are limited by VRChat. (understandbly so, but still)

indigo finch
#

Now that's a good point

supple root
#

Thanks a bunch

tacit pasture
#

@wanton palm did you just find it by any chance?

wanton palm
#

yeah

tacit pasture
#

all good

wanton palm
#

now I cant click on the url input text but that's another issue

tacit pasture
#

lmao

#

@fiery yoke before i start on this project in mind, is it possible; 1. to read player forces acting onto an object, 2. apply said forces to player

fiery yoke
tacit pasture
#

simply put, i push an object with my hand, apply its reaction force back onto the player, assuming there is no gravity the player moves in the direction opposite to the force applied

#

the object being pushed cannot be moved*

#

so like your pushing yourself off a wall in zero g

tacit pasture
fiery yoke
#

Yes. But youre assuming a lot of things there. For any kind of physics to happen, Unity requires colliders. The best collider would be a mesh collider, as it resembles the mesh as close as possible. However since avatars are usually Skinned Meshes (meaning that the mesh itself changes shape) the collider would need to be recalculated pretty much every frame. Thats incredibly performance intensive. So mesh colliders are not available for skinned meshes.
The next best thing is to use a lot of small colliders to assemble a multi-collider which resembles the avatars shape. VRChat does not do this automatically.
You would have to do that yourself. However its quite difficult to do, since you dont have all the necessary information to do it perfectly. You can make a few assumptions and approximate it.
And even then you would still need to handle some parts of the physics stuff. So yeah. Its complex.

tacit pasture
stuck sentinel
#

I had a problem yesterday that i still need help with. I can't find the right code for a keypad asset :/

junior path
junior path
civic birch
#

My pedestal pictures aren't facing the same way as the pedestals themselves???

#

How do I fix this?

mossy crane
#

How do you execute based off a GetKeyDown in Udon?

#

On true I imagine but is this costly to always test in a update loop?

fiery yoke
mossy crane
#

Hmm how do people do Ui menus and stuff on button presses

#

like B or something

fiery yoke
#

Like that.

mossy crane
#

x_x

fiery yoke
#

Yeah. Surprised me too. Unity overhauled the Input System in 2020 I think

mossy crane
#

1 update loop checking for a menu spawn press cant destroy a world right?

fiery yoke
#

Not at all

#

Its really not that insanely expensive :P

indigo finch
mossy crane
#

oof thats exactly how I imagined a series of key presses being tested would end up looking like lol

#

Update > Branch for key > false > branch for key ect

#

its getting laggy im gunna be forced to conform to the U# meta lol

grand temple
#

if you're trying to get directional input, don't poll for A and D as buttons. Just use the InputMoveHorizontal/InputMoveVertical events

mossy crane
#

Oh neat, didnt know those were a thing

#

Whats the best way to have a Interact event on a object, and upon clicking, set the int of a different udonbehavior except keep the int change local?

indigo finch
mossy crane
#

only the clicker changes the number

mossy crane
#

seems to make it so everyone sees the int as "1"

#

instead of 0 for everyone but clicker

grand temple
#

I don't see anything about that that should sync

mossy crane
#

hmm if i serialize and deserialize before checking that int

#

would it update everyone?

grand temple
#

if it's not synced, serializing shouldn't do anything

mossy crane
#

k, ill dig deeper

#

tyty

indigo finch
# grand temple so use buttons for those

The thing was that the part of the script I showed wasn't working... I ended up moving over to Udon# and everything became a whole lot easier ^^. was testing if a vehicle was even possible to script in graph though, so it ultimately was a fail

#

though I messed up somewhere with my quaternion math. Haven't quite figured that part out yet

mossy crane
#

Would a Interact event show up in the shift ` 3 window?

indigo finch
mossy crane
#

never seen that in graph form.. like this?

indigo finch
#

yup. super useful for debugging code

mossy crane
#

ty!

indigo finch
#

np ^^

indigo finch
indigo finch
mossy crane
#

Hmm why would both cubes send the same Variable set to 2 message

stuck sentinel
indigo finch
indigo finch
indigo finch
indigo finch
#

and did you change any?

stuck sentinel
#

nope

indigo finch
#

so the 'keycode' script that you put on the keypad, was that one provided by the asset or one you made?

stuck sentinel
#

in the video at the start, it shows the prefab already has the code on it when dragging it into the scene

#

its supposed to have the code all tied with it but it didnt

indigo finch
stuck sentinel
#

no

indigo finch
stuck sentinel
#

the script for the keypad and that was it

indigo finch
#

and as for the script for the keypad, was that the blank one you showed before?

stuck sentinel
#

umm no

indigo finch
#

if you put the keypad script that came with it, does it give you all the inputs that you were initially expecting?

stuck sentinel
#

nope

indigo finch
#

mind posting that provided script's .cs file?

stuck sentinel
indigo finch
#

well, if that script is used on an udonbehavour, it will have all the input fields that you were expecting to see

stuck sentinel
#

thats a good idea. but it's not working

indigo finch
#

mind posting an image of your project window where the file is stored? windows key + shift + s

stuck sentinel
#

all of it?

#

like the window or screen

indigo finch
#

just the project window where all the files are

#

i feel like something might be up with the naming

stuck sentinel
indigo finch
#

mind click on the udon# file, and showing what the inspector says?

stuck sentinel
#

like this

#

?

indigo finch
#

sorry, i meant the udon# file, not the .cs one

stuck sentinel
#

It wont open

indigo finch
#

sorry, just realised I wouldn't get what I was after anyways... this is weird

stuck sentinel
#

mmm

indigo finch
# stuck sentinel mmm

Gonna brute force this a bit. Make a new udon# script, and call it something like keypad2 (anythings fine, just no spaces)

stuck sentinel
#

bet whats next

indigo finch
#

open up the .cs file

#

also open up the original keypad .cs file too

#

then, on the new script, I want you to create a couple of empty line bellow everything. then copy everything from the original script and paste it there

stuck sentinel
#

like the original creator told me to just delete all files and reimport

#

:/

indigo finch
#

... I mean, I figured you would have done that already. yea. my bad. try that first

stuck sentinel
#

:/

#

XD

#

i did

indigo finch
#

so... should I continue with my explanation or you wanna give it another go?

stuck sentinel
#

sorry continue

indigo finch
#

where did you get up to?

stuck sentinel
#

it got fixed :0

indigo finch
#

nice ^^

civic birch
stuck sentinel
cedar iron
#

how do you teleport everyone at once with a trigger?

civic birch
prisma fjord
#

Ok here's an odd one, I set up a Udon script to work with some shaders in my world. It worked just fine then I attempted to add some extra bits on the end. They didn't work so I reverted back to the original code. Now nothing I do seems to work at all despite being identical.

zenith solar
#

At a glance anyone seeing what I did wrong here? Goal is a basic button that activates/deactivates a mirror

night viper
zenith solar
#

AH DUH

#

ok let me test that

#

hmm didnt work

night viper
#

Did you compile after adding the event?

zenith solar
#

Yep, let me save, compile again, and then reattempt

night viper
#

Oh wait, you are using a mesh collider with no mesh assigned. And no mesh filter or mesh renderer. You should use a box collider instead.

zenith solar
#

Oh weird, i wonder why they did that in the prefab

#

let me change that

#

yeah still not working

#

button animation broke when changed to a box too

mighty fjord
#

The graph looks normal, so I'm wondering if it's failing to compile or if there are missing references in the inspector

#

Another thing worth checking is if you changed the shader it used to make sure the internal property name is "saturation"

prisma fjord
#

i found it unity did some strange crap that led to me being confused

stuck sentinel
#

so uh i need help again 😅 how do you make something clickable?

tepid salmon
#

@stuck sentinel look uper what squall sayet

stuck sentinel
#

oh im dumb- OMG im dumb

tepid salmon
#

Np dont worry be happy 😋

stuck sentinel
#

i am now :3

tepid salmon
#

👍

stuck sentinel
#

so i forgot how to get that cool graph stuff up

stuck sentinel
#

oh uh now when i try to use the code, the buttons disappear and its not doing what it's supposed to do-

winter swan
#

when I import the latest sdk3 worlds I get compiler errors by default

#

Am I doing something wrong or is it a faulty release

#

It's a completely new project

halcyon frost
#

Please what is this error

#
  • unity console *
scarlet lake
#

Would anyone know how to make a text read a player's username like it was an ID?

broken bear
#

I have a series of pickups with an animator, I use an UB to set values on that animator. Works fine, but if I disable the pickup, then enable the pickup, the values set by the UB don't save and it reverts back to the default animator values. I plan to call the UB event again but I'm not sure why I have to, does an animator not save its values if the game object is disabled then enabled?

wanton palm
#

Is there much of a performance difference having multiple vs one single bulky script? I hear udonsharp it's slow

Like, if I have 10 features I want to implement would it be better to have 10 different udonsharp scripts or just one single script that implements all 10 features (despite breaking single responsibility principles)

cedar iron
#

Is there a way to trigger something when an item is picked up?

broken bear
#

there's an OnPickup event

cedar iron
#

Brilliant! Thank you so much!

#

And there's a drop event too right?

indigo finch
indigo finch
wanton palm
#

aight ty

cedar iron
#

An animation turns a rigidbody off kinematic so it can be used for a pickup, but it can never be picked up even if is kinematic is off. Can I get some help?

junior path
dreamy gorge
#

Can someone help me fix my unity camera?

#

i dont know how to revert this, i clicked some button and now the scene view camera is at a weird perspective

#

I just want the normal WASD

junior path
#

click the little text to set it back

dreamy gorge
#

ooo thgank u

indigo finch
#

you probably miss-click and hit the cube in the middle. does the same thing

indigo finch
dreamy gorge
#

where is the control panel!!?!??! wtf

indigo finch
#

save and restart unity. might need to reinstall the sdk. unity can bug out from time to time

dreamy gorge
#

i think ill have to reimport the SDK

#

god damnit

indigo finch
#

at least restart unity first (if you haven't already)

dreamy gorge
#

i did :(

#

i hope this wont break my udon shit

cedar iron
indigo finch
dreamy gorge
#

what about VRCPrefabs?

indigo finch
#

not part of the sdk

indigo finch
cedar iron
indigo finch
dreamy gorge
#

ah thank you, i got the control panel back

indigo finch
cedar iron
indigo finch
cedar iron
#

Is there a way to incriment through a counter using events? and if so, how?

scarlet lake
#

i still need help

#

please ping me if you have a clue or need more info

brazen epoch
#

Does Udon support real time reflection probe baking calls by scripting

dreamy gorge
#

How do you check if an object is null with udon graphs?

cedar iron
#

Is there a way to incriment through a counter using events? and if so, how?

empty mantle
#

Is there a way to make an event on whre you walk up to a npc and make it talk

indigo finch
mossy crane
#

How to test if a int is == a number with graphs?

indigo finch
mossy crane
#

Ahh the other tab, thank you!

thorn jewel
#

Does anyone know how soundcloud sources work with the Udon video player? In the editor it just always fails to load.

unborn hornet
# thorn jewel Does anyone know how soundcloud sources work with the Udon video player? In the ...

You generally have to run build and test for soundcloud/youtube/video/twitch/etc to work, unless you are using USharpVideo or ProTV (that I know of). Any major media hosting provider like those I mentioned all have to "resolve" the url from the common website form, to one that is actually a video. VRChat makes use of a tool called YTDL in order to accomplish this for desktop users (technical reasons prevent it for quest).
USharpVideo and ProTV make use of a special editor script to hook into YTDL during playmode which enables testing any links using the UnityVideoPlayer option (AVPro isn't supported for other reasons).

TL;DR it's easier to just run Build&Test for checking media on a videoplayer.

scarlet lake
#

how do i make toggle to change the skybox

thorn jewel
unborn hornet
timber mortar
#

I'm trying to make it so when i click a button for music in the world the entire world can hear the song when one person clicks the toggle. I was able to do it before when i was using sdk2 but this udon stuff is new to me

unborn hornet
thorn jewel
unborn hornet
#

🤷 make a canny?

#

lmao

scarlet lake
#

is there any videos on it?

scarlet lake
#

i found one

unborn hornet
timber mortar
#

Okay thank you i will try that

cedar iron
#

I need some help.
So I have an empty that holds all the rooms in a multi-level world.
The empty has an animator that has sequential transitions between each of the rooms, with animations activating the preceding, current, and next rooms.
As someone goes into a room, a trigger activates, causing a predefined integer (labeled in the udon behavior) to activate, allowing the animator to move to the next activation set.
The Udon Graph is a "OnPlayerTriggerEnter" connected to a "SetInteger" with public variables for the big animator, and the integer.
The name used for the "SetInteger" is the same as the integer parameter being edited in the animator.

Unfortunately, live scene triggers by manually changing the parameter in the animator fails to move the sequence along, and I don't know why. Can anyone help?
Also, the transitions between each activation set have no transition time, and do not have exit time.

timber mortar
# timber mortar Okay thank you i will try that

Yeah im sorry i dont exactly understand how i would set it to play the audio, like i have an "event interact" and then the "sendcustomnetworkevent" but i dont understand what i would do to set the audio source from off to on (if thats even how you do it like this, sorry im very new to udon anything)

scarlet lake
#

i did this for the skybox but it didnt work

cedar iron
#

Did you follow the tutorial?

scarlet lake
#

yeah

#

see

cedar iron
#

hmm. not really sure then...

thorn jewel
unborn hornet
#

Not that I know of. Currently it requires self-hosting something like qroxy, which is just a fancy website wrapper around ytdl. I do not know of any publicly deployed version though. Just the jinnai thing.

indigo finch
scarlet lake
#

Nvm I fixed it works

indigo finch
indigo finch
# timber mortar Yeah im sorry i dont exactly understand how i would set it to play the audio, li...

Here's what he means with using a custom networked event:
https://www.youtube.com/watch?v=OYjW5FGTxIo

Here's a quick addition to my audio button video. I completely forgot to add this into the video, so this was recorded later. The audio was pretty scuff though, but I've fixed the worst of it.

If there is anything I missed, please leave a comment bellow!

▶ Play video
timber mortar
#

Okay thanks, il check this out tomorrow

empty mantle
#

Is there a way to make an event on whre you walk up to a npc and make it talk

scarlet lake
#

fuck sdk3 and fuck udon

mighty fjord
indigo finch
# empty mantle Is there a way to make an event on whre you walk up to a npc and make it talk

You can do a 'on player trigger enter' and put that into a 'animator.set trigger' node (or similar) to fire a trigger on an animator, to play an animation. An animation can have sound and visuals. If however you wanted a dialogue tree/ options, it becomes too much of a loaded question to explain here. So, if you just want the player to say 'welcome' it's easy, but if you want more than that, you'll need to look up base unity tutorials and port it over. Do check vrcPlayerPrefabs to see if anyone's made anything first though

empty mantle
#

Im just looking for a is just when you walk up to an npc and they say a line

indigo finch
fierce verge
#

How do I make it that only the "world owner" / first instance can use the teleport button?

fierce verge
#

thanks!

fierce verge
indigo finch
#

there's no need to check if the player is valid. If the local player is playing the node, then it is valid. As for why it doesn't work while testing... dunno. Here's from the documentation:

fierce verge
#

nvm I had to use a branch instead of Is Valid

#

xD

#

now it works 🙂

#

still thank you!

indigo finch
#

cool ^^

empty mantle
#

So wait what will i need to replace cause i got a aduio clip i wanna play when you walk up to an npc

wise quarry
#

hello, i have a question, i want to make ui mirrors toggle with udon, how i can make this? I know to make it with an object to click on this an there is a mirror, but idk how to make it on an ui, ive created an ui but how to import them?

fierce verge
#

So you have the OnClick on the right, you put the object with the Udon Graph on it in there. And then use Udonbehaviour.SendCustomEvent to send a custom event. and then you use a CustomEvent node in the Graph

wise quarry
fierce verge
#

yeah so instead of interact

#

use the Event Custom node

wise quarry
#

from custom event

fierce verge
#

just a command

#

call it trigger, or push or whatever

wise quarry
#

else or only this?

fierce verge
#

and

#

on the button

#

the Onclick

#

set that to Udonbehaviour.SendCustomEvent

#

also put the object with the udon graph in that little box

wise quarry
#

i dont understand what should i put there

fierce verge
#

did you put this graph on an object yet?

#

or is it just a graph in your assets?

wise quarry
#

its just a graph in the assets because before it was on a object but idk that i need this for ui too

fierce verge
#

so on your button

#

add a component

#

udon behaviour

#

and put the graph in there

wise quarry
#

okay

#

done

fierce verge
#

that way the graph is connected to the button

fierce verge
#

that way it knows what graph to use, since its connected to that object

wise quarry
fierce verge
#

yes

#

and now change NoFunction to Udonbehaviour.SendCustomEvent

#

its a bit down

wise quarry
fierce verge
#

and then put the same text in that box as in your graph CustomEvent

#

yess

#

now it will toggle for you alone, do you want to toggle it for everybody?

wise quarry
#

No, only local

fierce verge
#

should work now

#

dont forget to hit compile tho

wise quarry
#

on this?

fierce verge
#

yes

#

otherwise it can happen that your test or build will still use the old graph

#

happend to me a few times

#

and it looks like it uses the new one, so it causes confusion

wise quarry
#

aah before i press complie there was the problem, that my button dissappear and the mirror was not on

#

and now it works how it should

#

thank you very much

fierce verge
#

every time you edit a graph you should compile, just to be sure 🙂

#

no problem!

wise quarry
#

i have another question

fierce verge
#

the customevent is very usefull

fierce verge
wise quarry
#

is it possible to see if the mirror is disabled, that the buttions are grey and after it it, it stays white?

fierce verge
#

ehmmrrr

#

one sec

#

This is my setup for that

#

so the Gameobject>Get activeSelf sees if the object is active

#

and the branch is a simple yes or no

wise quarry
#

do i need "branch"?

fierce verge
#

so wait you want the buttons to be grey when the mirror is of right?

wise quarry
#

oh lol

#

yess

wise quarry
#

or?

fierce verge
#

yes

#

so if its false the togglebutton in the middle wil change its color to green

#

and when true it will change to red

#

and you can just set any color

wise quarry
#

how to make the button "Set color"?

fierce verge
#

you need an Image > setcolor

#

so first search image

#

click Image

#

and then SetColor

wise quarry
#

? which one

fierce verge
#

UIImage

wise quarry
fierce verge
#

no wait

wise quarry
#

Ahh im stupid

#

i found it

fierce verge
#

hahaha 🙂

#

yesss

#

also make sure to set the alpha, otherwise it wont show anything

#

I believe by default its at 0

wise quarry
#

is it not possible to use this? or is this not the same?

fierce verge
#

no that is what it is by default I believe

wise quarry
#

i think "pressed color" is working because if i click on the button it is grey

fierce verge
#

pressed only turn grey when pressing and not when you release I believe

wise quarry
fierce verge
#

and then you can drag it into the graph

indigo finch
# empty mantle So wait what will i need to replace cause i got a aduio clip i wanna play when y...

If its just to play a sound, follow this tutorial (https://youtu.be/cQ3hWKY-NiA), but instead of an interact node, you want to use a 'on player trigger enter' node like my proximity mirror tutorial.
If you want to do this as an animation... Well, I have yet to find a good tutorial covering calling the animator. I did call the animator on my world darkness slider tutorial, so you might be able to figure it out with that one... but it might be too far removed

A simple tutorial, covering how to make a button that plays a sound in udon. I've seen a couple of post asking about how to play a sound in udon, so hopefully this will give a good foothold to bounce off from.

If there is anything I missed, please leave a comment bellow!

▶ Play video
fierce verge
#

quick question inbetween: is there a way to decrease the length of your reach to a UI panel? because you can reach button you shouldnt be able to reach, I tried blocking them with a box collider but that doesnt work

#

do I need to set this in the scene descriptor?

indigo finch
#

I might be wrong, but I think the blocking object just has to be lower in the Hierarchy...

fierce verge
#

let me try that

fierce verge
indigo finch
#

Ah, kk

fierce verge
#

so how do I fix this

#

should I make a mesh with a transparent texture blocking it?

fierce verge
wise quarry
fierce verge
#

because your branch is not setup to do anything

#

theres no line going into that arrow

wise quarry
#

and what i i should connecting?

fierce verge
#

hmmm is this the same graph that toggles the mirror?

wise quarry
#

yes

#

i try "SetActive"