#udon-general

59 messages · Page 19 of 1

forest mist
#

I'm confused what you mean Adeon, I'm not sure how it relates to this

pallid mango
#

No worries then

forest mist
#

There are multiple events in play

digital orbit
#

@digital orbit It's Update
@forest mist So your flow looks like this

#

Update (every frame)
-> get player variable -> null, null, null, null

User picks up item and presses button, it finally sets player variable

Update -> get player variable (works)

#

If you use Start, it'll set it before Update runs

forest mist
#

Well that's the thing, it doesn't do that

Once the user picks up the item and presses it, nothing happens. The theory is that the script crashes because it's trying to set the position of an object to a player's bone's position.... but there is no player

digital orbit
#

Because once you get an exception, Udon stops processing. That's probably what's happening. All kind of weird things happen once it crashes

forest mist
#

Yeah, so I'm going to have to throw in a check for null values on the Update segment

digital orbit
#

Right. If player != null, then run that code

forest mist
#

Yeah!

#

That's the plan anyway

digital orbit
#

Why are you setting player like that though? Should not Start suffice?

forest mist
#

No, because the player should be determined by who "Uses" the item

It's meant to be an object you stick to your body

digital orbit
#

player is a local variable

forest mist
#

If I use Start then it will just stick to you as soon as you walk in

digital orbit
#

It'll always refer to the current user

#

By who uses the item, hmm

forest mist
#

Is there a good way for me to determine the player holding the object when it is used?

fiery yoke
#

Yes

#

VRC_Pickup.currentLocalPlayer

#

or something like that

forest mist
#

I have to plug in a VRC_Pickup input into that though

Will it suffice for me to just make an empty public variable of type VRC_Pickup, since it will reference itself by default?

digital orbit
#

What you're probably wanting is to set the owner of the object, then you can get the owner of the object later too

#

Obviously, there can only be one owner. So, set the owner once someone picks it up. If anyone else wanted to know who's holding it, just check who's the owner of it. And if you wanted to know if the same player is the owner of it, set player variable in Start, and check if the player variable == getowner(gameobject), or you could just do a local boolean check and tie it to onpickup and ondrop

fiery yoke
#

VRC_Pickup will not auto-reference. You can do gameObject.GetComponent(VRC_Pickup) in nodes that looks a little bit weird

forest mist
#

I will see about doing that. Thank you both

#

By the way, I figured out what connected to that tt node from yesterday. It connects to HumanBodyBones, or HumanBones

#

Also @fiery yoke I found a few nodes that might be able to find the current player, though I don't know what the difference is between them

fiery yoke
#

Ohh

#

uhh

#

no idea.

#

I would say currentLocalPlayer

forest mist
#

Does Udon.... occasionally have trouble loading scripts?

I have 2 scripts which are basically identical. One works, and the other does not. I heard from someone that I might have to do some weird copy-paste thing?

Edit: That seems to have worked, strangely enough

digital orbit
#

Are you using the graph?

#

It stops working occasionally, even if there's nothing wrong with the script. I heard you can fix it by duplicating it

forest mist
#

Yup, duplicated the graph script and assigned the duplicate to the udon behavior and it worked. Crazy

fiery yoke
#

Graph Compilation sometimes breaks when doing certain actions. Its been a long standing bug.

#

Reloading the C# assemblies by entering/exiting playmode then compiling it again should also fix it

forest mist
#

Ah, I will try that next time, thank you

forest mist
fiery yoke
#

Show nodes

tropic canyon
#

I'm pretty sure you can null check vrcplayerapi

fiery yoke
#

Uhhh

#

Can you try UnityEngine.Object Equals?

forest mist
#

@tropic canyon I'm unable to find a node under VRCPlayerAPI that would be able to do this

fiery yoke
#

Can you try to log the variable?

forest mist
#

I'm not sure what you mean by that in this instance

fiery yoke
#

Can you also try Object.ReferenceEquals

tropic canyon
#

In u# just player == null

fiery yoke
#

just do Debug.Log with the variable as input

tropic canyon
#

and it works

forest mist
fiery yoke
#

Huh

#

That is. Indeed strange

#

What SDK version are you on?

#

Most recent?

forest mist
#

2020.05.06.12.14

#

I updated it a couple of days ago

fiery yoke
#

Welp thats indeed strange

forest mist
#

Can you also try Object.ReferenceEquals
@fiery yoke
Well, that kinda works... it gets past that block but then errors because it attempts to find the bone of the player that doesn't exist. My guess is that SystemVoid is not the same as null and therefore technically passes the null check when using Object.ReferenceEquals?

fiery yoke
#

SystemVoid means that a method doesnt return anything

#

Thats not how that works

#

I have honestly no idea whats happening there.

forest mist
#

Damn

#

Welp, I'll have to keep playing around with it

tropic canyon
#

just get u#

fiery yoke
#

lul

rose arrow
#

@forest mist Don't use Equals use "=="

forest mist
#

?

fiery yoke
#

That is reference equals

#

I dont know if VRCPlayerAPI reference equals exists

rose arrow
#

I think it's op equality

fiery yoke
#

Ahh right

#

Why is everything so weirdly named

rose arrow
#

It's automatically generated

fiery yoke
#

From what?

rose arrow
#

C# reflection

forest mist
#

just get u#
@tropic canyon I was hoping to avoid U# since it's very unfamiliar to me, but I might have to in the end...

rose arrow
#

Adding friendly names and aliases is planned though

tropic canyon
#

I'd argue it is as unfamiliar as the node graph

fiery yoke
#

I agree with that.

#

However @rose arrow it has been done with VRChatPlayerApi.Equals in the past successfully iirc

#

Ohh no wait

rose arrow
#

That won't work for null checks

fiery yoke
#

Yeah I just remembered

#

.Equals is an instance method

rose arrow
#

It ends up being null.Equals(null) if the instance is null

fiery yoke
#

Yeah op_equality is the right one

forest mist
#

There's 2

fiery yoke
#

What is the other one?

rose arrow
forest mist
#

Alright, I'll try that one

fiery yoke
#

Its easy to rememeber:

#

Equals means "I equals something else?" Equality means "The equality between two objects"

#

Equals is instance-focused, Equality is not

forest mist
#

Ah, gotcha!

rose arrow
#

The node is clearer

fiery yoke
#

That is not much clearer to a non-programmer

rose arrow
#

It doesn't have an instance property

fiery yoke
#

== means nothing

#

Ahh that is correct indeed

rose arrow
#

If instance is null you'll get a null reference exception.

fiery yoke
#

But again, to a non programmer that doesnt mean much

rose arrow
#

That's fair, the graph is still very much a WIP

fiery yoke
#

Most likely people who use graphs have no idea about the difference between instance and static methods

rose arrow
#

There's a new graph UI coming soon.

forest mist
#

I've programmed before, I'm familiar with == vs. .Equals

#

But in this case, it's not under the name "=="

rose arrow
#

Yeah, there's three separate names shown there so far

#

Object.Equality, UnityEngine.Object.op_Equality, and ==

fiery yoke
#

Some abstractions there might help

rose arrow
#

Better search is planned for some time after the graph UI

forest mist
#

So, progress!

#

Just a nullPointerException on the Bone node now
Which means it's passing through but I'm not sure how

fiery yoke
#

You have it on true

#

If player is null

#

do

#

You want if player is null, dont do

forest mist
#

It's on false

fiery yoke
#

Ohh mis-remembered

#

Hmmm...thats odd.

tropic canyon
#

if(player == null) return; masterrace

fiery yoke
#

Thats kinda what theyre doing

forest mist
#

Logging the bool variable that comes out of the == shows it's returning true

#

Uh, false alarm

Looked like it was another compilation error. No more exceptions now after

fiery yoke
#

Yeah thats one of the most annoying problems

#

and the reason why most people use U#

#

its just more reliable.

forest mist
#

if(player == null) return; masterrace
@tropic canyon Trust me, my heart is crying out for some normal code right now

#

@fiery yoke I'll switch eventually
Maybe even tomorrow

#

By the way, is there any way for me to log what's going on in-game?

fiery yoke
#

There is an in-game console

#

Im tired of explaining how to open it

#

xD

#

Youll find someone who can help you with that

forest mist
#

Got it

#

Right Shift + [Backtick] + 3 from what I can see.
Big black console.

tropic canyon
#

where's the backtick on a swiss keyboard?

#

´

forest mist
#

Excellent question
For UK and UKX (QWERTY), it's to the left of the number 1

tropic canyon
#

lemme show you what's left of 1

#

§

forest mist
#

It will be next to your Question mark key I believe

At the end of the number row

tropic canyon
#

'

#

^

forest mist
#

Wow, that is a pretty crazy keyboard. And it's QWERTZ

tropic canyon
#

´

#

~

#

`

forest mist
#

`

#

`
@tropic canyon There it is!

tropic canyon
#

so shift plus left to backspace

fiery yoke
#

I dont think thats how that works.

forest mist
#

Yup, end of the number row

fiery yoke
#

The Unity Key Combo system is a little weird

#

especially with backticks

forest mist
deep salmon
#

what is udon

fiery yoke
#

We really need a bot for this

deep salmon
#

yeah lol

fiery yoke
#

There is an #udon-info channel. All relevant info is in there.

deep salmon
#

o ok

#

whanks

#

thanks*

silk marsh
#

It will be next to your Question mark key I believe

At the end of the number row
@forest mist makes me wonder if the VRC team is swiss...always thought "Right Shift + Backtick + literally anything" is the most annoying keyboard combination ever

forest mist
#

It’s still incredibly annoying on the Swiss keyboard

hushed gazelle
#

is there a way to move an object relative to its parent during runtime? All the set/get for transforms seem to be relative to the world.

silk marsh
#

is there a way to move an object relative to its parent during runtime? All the set/get for transforms seem to be relative to the world.
@hushed gazelle should be the localPosition property. I can't remember if it's exposed on GameObject or if it's just on the Transform component but that's what you're looking for

hushed gazelle
#

Cheers.

scarlet lake
#

if i make a world with udon sdk can i upload it to live vrchat or no?

restive dust
#

Yes.

hushed gazelle
#

Is anyone else unable to make new udon scripts with the new build? It'll create and serialize them, but doesn't give me the option to open the Udon Graph.

flint urchin
#

reimport scripts and restart, dont save

hushed gazelle
#

Yeah, might have to.

chilly aspen
#

Is it possible for an UdonSync variable to appear differently between players when OnDeserialization() fires? For instance, an UdonSync variable has the following properties in a class by a game object's owner who resides in Australia.

[UdonSynced(UdonSyncMode.None)] public int syncVariable;
void Start() { syncVariable = 0; }
void Update() { syncVariable = syncVariable + 1; }

Other players who live in various regions around the world have OnDeserialization() execute. Is it possible that, at an exact moment in time, a player in the UK could see the UdonSync variable as a different integer value than that of a player in, say Singapore?

For example, at a specific moment in time, the Australian game object owner would see syncVariable = 100 since he's in perfect sync with the variable. Singapore may see syncVariable = 92 upon OnDeserialization() execution. Could UK also see syncVariable = 92 upon OnDeserialization() execution? Or does UK see a different syncVariable integer value?

rotund thunder
#

what the fuck is udon

#

aint that a noodle

raven peak
#

@chilly aspen onpreserialization is the event fired before a owner of the synced object sends the synced data to everyone else. Ondeserialization is the event fired when the other users receives that data. From what I’ve tested these events get fired before any unity event like Update. And the rate they usually get sent and received is 0.2 seconds for synced variables.

#

For sending the synced variables you could have it counting up by one during Update. But if you have it set to -1 or something else onpreserialization that is what will be sent to the other users.

delicate cipher
#

What version of unity do i use for the new Udon SDK3

#

ah nvm

chilly aspen
#

@raven peak Ah, I didn't realize OnPreSerialization() was a thing. In that case, I think I have an idea on how to restructure networking. Thanks

marble lark
#

Probably a stupid question - when you add an "Interact" and/or "Mouse Down" event to an object, does that automatically make it into a clickable button in VR and/or Desktop, or is there something else I have to do as well?

formal urchin
#

How do I fix the Rotating screen problem in VR CHAT, whenever I plug my controller it rotates my screen automatically please help

gray marlin
#

Is it possible to use Udon to read the color of a pixel on a texture?

#

or on a video screen or on a camera view

#

Actually @gleaming fractal described up above exactly what i was thinking

#

Did you ever figure anything out laser?

fiery yoke
#

You currently cant do that. What happens in GPU land stays in GPU land.

gray marlin
#

dont do me like this helpful 😭

fiery yoke
#

I wish just as much that it would be possible xD

gray marlin
#

that could allow so much cool stuff with having a video or a stream control the world

fiery yoke
#

You dont know how much that would enable

#

Going from GPU to CPU is always really complicated because of how different their architectures are

mighty fjord
#

Possibly doing some shader stuff for flashy effects but that's about it

fiery yoke
#

Nonono

#

Going from GPU to CPU is really crazy

#

Especially since udon is so slow

#

You could have massive async calculations being done

mighty fjord
#

Nothing like that, was just thinking render textures

#

Which isnt really UDON though

fiery yoke
#

Yeah exactly thats the point

#

Because staying in Udon limits you by a lot

severe dirge
gray marlin
#

How about reading audio...?

#

but would have to have something stupid expensive listening for a specific trigger tone or whatever

#

probably

#

if even possible

mighty fjord
#

Actually come to think of it, do video players even work rn?

gray marlin
#

no

#

or atleast im under the impression that they dont

mighty fjord
#

I've seen people mention that doing audio-reactive effects would be possible once it's brought back, but I havent looked into it that too much yet, hopefully someone else knows cause I'd also like to do something with it at some point

gray marlin
#

I did see uhh like a visualizer in a world before pre-udon

#

like a bar visualizer

fiery yoke
#

Pre-rendered?

#

Or realtime

gray marlin
#

realtime but only for a specific frequency i think

#

not like a full visualizer

fiery yoke
#

If you mean the one by SCRN

#

then thats driven by video

gray marlin
#

no idea it was some club world a year ago lol

fiery yoke
#

Ohh

gray marlin
#

^^

#

it certainly looked realtime

fiery yoke
#

Well maybe it was possible but its much easier now

#

A realtime audio visualizer was pretty much the first thing I made

#

Have a look if you want

gray marlin
#

oh yeah this is way more impressive than the one i was referring to

#

i think what i was referring to just listened to some range of frequencies and just displayed their average volume basically

#

not like a visual analyzer like this

topaz olive
#

What is udon compared to quest?

fiery yoke
#

Udon is VRChats in-house programming language for worlds. Oculus Quest is a VR Headset System. They arent comparable.

gray marlin
#

haha

topaz olive
#

Wait

#

Udon is not some new head set?

fiery yoke
#

No

topaz olive
#

Im an idoit

#

Bye now XD

gray marlin
#

aww

digital orbit
#

Probably a stupid question - when you add an "Interact" and/or "Mouse Down" event to an object, does that automatically make it into a clickable button in VR and/or Desktop, or is there something else I have to do as well?
@marble lark Interact makes it clickable in VR and Desktop. Mouse Down makes it clickable ONLY on Desktop. Yes, that automatically makes it clickable.

marble lark
#

Ok, cool! Was wondering since it takes forever to build the world, and I'd rather not go through the whole thing just for the simple button clicks to not work.

gleaming fractal
#

@gray marlin i did not

#

i hope something else comes into place to trigger

#

but it has to be something within the range that streaming platforms support.. supporting any weird other data poses a huge security risk which i doubt vrchat staff will undertake

#

for example another way would be if audio on streams would support a third audio channel which could be used for data like timecode ^^
But sadly i dont know a streaming platform supporting more then stereo

#

the last option would be a midi trigger to be supported among instances and the audio and performance work is already pre build into the world... its not great but that .. "could" be one

#

video with no audio track.

worthy beacon
#

does udon break if you try to vrcinstantiate an object in an occluded area?

tropic canyon
#

wdym by that?

flint urchin
#

No it doesn't. But current live has a bug with it. (Which will be fixed on the next update)

worthy beacon
#

ah ok

#

@tropic canyon basicly i have an object which is inactive that i use as my base to spawn. I just added occlusion culling to my map and noticed its in the area that gets occlued. The code was breaking and it breaks right around when it tried to spawn the brick

#

so i was thinking since the object was occluded (which it shouldnt of been) for some reason VRCInstantiate might of bugged the program

tropic canyon
#

scripts aren't able to be occluded

worthy beacon
#

its not occluding the scripts, its occluding the object which its attempting to instantiate

#

its probly not the issue, but i was assking if there was some bug, which accroding to phaxexNor there is

flint urchin
#

Occlusion only hides the mesh / disables specific things set to do so. The gameObject will still be there

uncut furnace
#

Yeah, yesterday's update broke VRCInstantiate in udon. Was working fine before the update and when I updated the SDK, couldnt spawn anything and logs showed the error: [UdonBehaviour] An exception occurred during Udon execution, this UdonBehaviour will be halted.
VRC.Udon.VM.UdonVMException: An exception occurred in an UdonVM, execution will be halted. ---> System.NotSupportedException: External module 'VRCInstantiate' is not supported.

worthy beacon
#

ah..great XD

#

guess ill hang up my development till its patched

floral dove
#

All fixed now @worthy beacon

worthy beacon
#

nice!

#

will test in a bit

digital orbit
#

guess ill hang up my development till its patched
Fixed :3

#

Your development gets hung up by only 4 hours

worthy beacon
#

yay it works now 😄

#

ya, i pretty much ate and opened 24 card packs in the time it took it to get patched XD

fiery yoke
#

Well it was broken since yesterday

#

Soooo...actually took round and about 24 hours

feral elk
#

Hey quick question: is there an easy way to delay execution of an udon node? I'd like a trigger to teleport the player a few seconds after it is activated, but there doesn't seem to be any sort of delay or sleep node.

fiery yoke
#

That is a common question...I should really write a guide on it

#

Actually. I will

#

Give me a few minutes

feral elk
#

Ok wow thank you so much!

fiery yoke
feral elk
#

Alright, I'll give that a try! Thank you again for helping me figure this out

fiery yoke
#

It looks like much. And it is. But unfortunately there isnt really a much easier way

#

btw that whole graph looks like this in code:

float delayedTime;
bool isDelayActive;

void Interact()
{
   delayedTime = Time.time + 5f;
   isDelayActive = true;
}

void Update()
{
    if (isDelayActive && Time.time > delayedTime)
    {
        DelayedEvent();
        isDelayActive = false;
    }
}

void DelayedEvent()
{
    Debug.Log("Hello World!");
}
hushed gazelle
#

I'm trying to just check a float value based on its local transform, but it does not want to trigger at either threshold (I've checked that it is indeed exceeding them with debug.log) Am I missing something obvious in the check here?

#

And the code it goes to for reference. Basically if it's too far back, it should stop the plunger at the threshold.

timber lion
#

Has anyone seen this type of error before? Can't find any info on it.
2020.06.19 01:40:06 Error - Failed to ready Doors because waiting for Door to ready
Where Doors is a parent gameobject with no udonbehavior and Door is a child with one.

#

Seems to break unrelated udonbehaviors in the world too I think

digital orbit
#

Is it a blank UdonBehavior?

timber lion
#

This happens with a "blank" udonbehavior on the child as well

#

I think it might have something to do with an Animator component. With the animator removed this does not happen, but I really need an animator on it. If I put the animator on a child of Door, it still happens though. About to try where the Udonbehavior is on Door but the actual door animator is on a sibling of Door

#

I'll also try where door has no parent in the scene, but that's really super not ideal

vague agate
#

Hello, if anyone knows how to use enum variable in udon, can you help me?

timber lion
#

Starting to suspect my issue has to do with disabling game objects with udonbehaviors on them which I forgot was a no no

#

even if it's in an animation

digital orbit
#

I've disabled UdonBehavior objects plenty of times with no problems

timber lion
#

Okay can confirm... the problems seems to have been with an animation enabling/disabling a gameobject with an udonbehavior on it. Note that the udonbehavior being disabled still worked when enabled/disabled via animation, and the log message didn't even say which objects were the culprit, just the name of some object above the animator in the hierarchy. This also disabled the Start() and Update() functions from being called by unity in unrelated udonbehaviors (other methods and network events still seemed to work and Start() and Update() coudl still be called manually)

#

I think a workaround could maybe be to set the scene gameobjects enabled by default and make sure the default mecanim state has them enabled as well but I'm not sure. already refactored my animation to enable and disable collider components instead of gameobjects to avoid this completely

digital orbit
#

Strange. I wonder if it's related to this in any way

timber lion
#

well it would be nice to enabled and disable an udonbehavior to change whether or not it is "OnInteract"-able and/or its Update loop happening

#

but I'm not sure its related. I think this is just some scene-readying issue

digital orbit
#

I wonder if you can reproduce it in a blank project with the same steps

timber lion
#

Probably and I could make a canny

digital orbit
#

That would certainly prove that's the culprit

timber lion
#

That's a great idea

shrewd bluff
#

helpful helper, i require help...

#

or more like an answer

#

how much faster has udon become :o

#

they say that the performance has been boosted, but can we iterate over 100k elements in an array without lag

timber lion
#

Personally I eagerly await faster or configurable variable sync

#

or at least custom network event params

trim barn
#

How to sync a Rigidbody Component? Could it?

fiery yoke
#

@shrewd bluff No idea. I doubt that it has become as fast as straight C#, but maybe significantly faster than it was before.

azure tinsel
#

What are the things you cannot do with udon? I've seen that you can't use UnityWebServices. I need more examples like these to see how limited I am

scarlet lake
#

So I'm making my VRC world and I'm just asking if anyone knows a good video to teach me how to make a custom background for my world

zenith river
#

one word, very

proper oar
#

its still client side

fiery yoke
#

Instantiation was completely broken. Thats what the fix refers to. Its still not supposed to be networked.

proper oar
#

oof

celest shuttle
#

Hey.. quick question how do I enable the Debug.log (in the SDKV3) The builder launches the client but I cant see anywhere to add the debug options --enable-debug-gui ?

#

No problem.. sussed it... (edit the batch file in the Vrchat launcher) thanks

forest mist
#

@celest shuttle You can also do Right Shift + [Backtick] + 3 to launch the debug console

forest mist
#

So... turns out I'm still having issues with Equality of all things. Even after using the "==" node, I'm getting errors not when the object is null, but when the object is anything but null. So, as soon as I interact with the object

flint urchin
#

What’s the actual output log exception?

forest mist
#

@flint urchin I'm unable to find out, I don't know how to get that information in the VRChat game console, only in the Unity console

serene moat
#

You can look at your output log for the error, but the issue is probably that you're using UnityEngine.Object Equality instead of System.Object Equality

flint urchin
#

You can find the output log in this folder %userprofile%\appdata\locallow\vrchat\vrchat (Open Run and paste this)

forest mist
#

@serene moat I'll try using the System one instead

serene moat
#

it's difficult to find in the node search but the correct node should look like the bottom node, where there aren't any names on the input pins

forest mist
#

For something this specific I don't even bother using the search, I went through the menus manually

#

Holy fuck it worked, thank you so much @serene moat and also @flint urchin

I've been struggling with this new project for days but now it finally feels as though I've made a breakthrough for once :D

serene moat
#

👍

forest mist
#

Is there any way to force the dropping of an object? I tried VRCPickup Drop node but it doesn't seem to do what I want

#

Could I just set Pickupable to False and then True again? Would that work?

visual surge
#

i want to teleport my gameobject to its own position -12 units in the x axis, however vector3 subtraction is replacing the value for -12 0 0 instead of subtracting it from the object's position, am i doing something wrong?

swift cape
#

Simple question... how do I actually add tooltips to my interact and use objects? Does this have something to do with it?

fiery yoke
#

No dont touch that. Go into the Debug Inspector (google Unity Debug Inspector if you dont know how to) while inspecting the object with the Udon Behaviour. Then it should say "Interaction Text" somewhere in there

swift cape
#

affirmative

coral bay
#

im trying to make a lock for a door how would i go about doing that is there some sort of variable where i can turn the script off on a different object or am i missing something and have the wrong idea haha if you can help me at all feel free to @ me or pm me ty 🙂

digital orbit
#

You mean like a keypad?

coral bay
#

like a private room where you can press a button and it stops people coming into the room through the other teleport button

digital orbit
#

That's simple

coral bay
#

lol im not the smartest with coding haha

digital orbit
#

Place a boolean on the other teleport button to disable it if true

#

Then, on the other button to lock it, SetProgramVariable to the other script

coral bay
#

ah ok ty

digital orbit
#

Obviously, just flip it

#

To turn it off and on

coral bay
#

yeah ty

digital orbit
#

To use SetProgramVariable, you'll need to put a public UdonBehavior on the lock button

#

Then drag the other teleport script into the slot on the lock button

#

In the inspector

#

Then you just SetProgramVariable on that public variable in the lock script

wide gyro
#

Hey guys, if I wanted to make it so that sound is heard by everyone in the room, how would I go about doing so with this script?

digital orbit
#

SendCustomNetworkEvent, and make a new custom event for it to go to, then play the sound in that event

wide gyro
#

Nice, thanks @digital orbit

digital orbit
#

And you can just duplicate the part where the audio plays so it'll be normal for the owner. OR, if you want the whole actiions to play for everybody, then just throw everything into the custom event (don't worry, it'll play for the owner too)

wide gyro
#

I'm trying to wrap my head around what that's gonna look like

digital orbit
#

CustomEvent foo

#

Then, route all those 3 nodes, Interact, onmousedown, oncollision enter, into a SendCustomNetworkEvent (name: foo)

#

Then, on the foo CustomEvent, throw everything you have into it

#

If you only want the sound playing for others, then keep it as it is, and just add the sendcustomnetworkevent in between the audio source play and rigidbody move rotation nodes, and make the new customevent, attach it to a new (but similar) audio source play

#

Just remember one thing: All custom network events play for the owner too. So, the owner will hear double sounds if you do that. Which means you need to filter out whether the customnetworkevent was fired on the owner or another person

wide gyro
#

oh god,.. do you happen to have twitch? I am streaming right now

#

and I wouldn't mind the help if you can see if what I'm doing is in the right direction

digital orbit
#

Add a new custom event, name it whatever. Put audio source play into it

#

It depends on whether you want ALL those nodes to execute , or JUST the audio

trail turtle
#

Tip: You can also do a Discord call and just screen share, and you don't need a Twitch account to watch a stream

digital orbit
#

Ok, just the audio

#

Easy enough

#

Custom event, put audio play on it

#

Duplicate audio source play node, attach it to the custom event

#

THere you go.

#

Yes

#

RLIke that

#

Now , plug the audo source isntance to it like normal

#

Same place as the other one

#

Right

#

Ok, make a new node, sendcustomnetworkevent

visual surge
#

sooo when instantiating a pickupable prefab its working fine in vr but in desktop the instantiated object is not pickupable. what am i doing wrong?

visual surge
#

also sometimes it instantiates two objects instead of one

chilly aspen
#

i want to teleport my gameobject to its own position -12 units in the x axis, however vector3 subtraction is replacing the value for -12 0 0 instead of subtracting it from the object's position, am i doing something wrong?
@visual surge To teleport a game object to its own position -12 units on the x-axis, it'll be either of the following lines of code (one long and one short):

this.gameObject.transform.position = this.gameObject.transform.position + new Vector3(-12f, 0f, 0f);

transform.position += new Vector3(-12f, 0f, 0f);

The graph posted looks syntax-correct. Maybe try pulling the game object and vectors from it's own node not being used elsewhere. I've had complier issues where I'm pulling multiple noodles from one node, and the assembly code wasn't structured correctly.

chilly aspen
#

'

also sometimes it instantiates two objects instead of one
@visual surge Instantiate for Udon Graphs is not working correctly, I believe. Works fine for UdonSharp though.

visual surge
#

thanks, i managed to make the teleport work properly

#

i guess i should look into using udonsharp then if it works better

flint urchin
#

@visual surge What's the current set up for your instantiate? (graph screenshot)

#

Because instantiate in graphs works just fine

visual surge
#

basically after passing through a few branches it instantiates an upgraded version of the object at the same rotation and positon(with an offset of -12 x ) and then destroys itself

#

it seems to work fine however sometimes it spawns multiple objects and sometimes only one

#

and also the prefab has a pickup component but it seems to not be pickupable by some people and work normally for others

#

i thought it could have been because the collider was set as a trigger but changing that did nothing different

flint urchin
#

Make sure the prefab is in the scene descriptor prefab list. (shouldn't matter, but better safe than sorry)
For self, you don't need to do a public variable, just use the This node
Use SetPositionAndRotation (performance reasons)

Does each player spawn their own object then I take it? (as in spawns are triggered via a custom network event)

visual surge
#

there is also one of each in the scene already

#

the behaviour is completely local nothing is synced

#

each player starts with a set number already spawned in the scene and then can upgrade it

#

not a network event just a simple ontriggerenter, since its suposed to be local anyway

flint urchin
#

Are the collision matrix set up properly then? So it doesn't collide with the player

visual surge
#

positive

#

the objects dont collide with anything but another layer where the trigger is on so they can detect each other

flint urchin
#

As for why it's not pickup able for some I don't know. If the cards are inside other trigger areas, that could be why desktop can't pick them up. Since raycast is blocked by the trigger, unless it's on the mirror reflection layer (this would be for other triggers than the cards)

visual surge
#

what about the double spawning? any clue?

flint urchin
#

That could be as much as them clicking it twice

visual surge
#

no clicking involved

#

they place the object in a box wich has an animation for moving the collider within it making contact with the object and activating ontriggerenter

#

the animation also has a cooldown time

#

cannot be played twice until its finished

flint urchin
#

Well, it's triggered twice somewhere 👀

#

Add a branch in the beginning to check if it's already being processed, then as the next jump you set the bool value to true.
So if it does trigger again it will be True and not do anything again

visual surge
#

Alright, will do

#

Thanks a lot for the help guys

vagrant coral
#

Is the "Version.txt" ever updated in the unity pack? I updated my files and it says its an old version. when checking for update it refers me to one made 2019 vrcThinking

#

or sdk pack i should say

fiery yoke
#

Yeah...

#

¯_(ツ)_/¯

vagrant coral
#

i take that as its not updated xD

#

the txt i mean

fiery yoke
#

Not really very consistently

vagrant coral
#

coolio

sinful slate
#

I want to change the texture on an object's material via Udon. In start, I fnd and assign the game object in question to a variable. Then on button press, I get the MeshRenderer component from the game object, get the material from the mesh renderer and call "Set Main Texture". Everything but the last call seem to work. When calling Set Main Texture (where I dragged a different texture into the value field), unity throws a null error (I assume it can't find the texture?)

fiery yoke
#

Texture Variables are not yet implemented. I dont even understand how you got to that step at all

sinful slate
#

Beats me 🙂

fiery yoke
#

Ohh thats interesting. Didnt know there was a specific method for SetMainTexture

sinful slate
#

Okay, so basically what I want to do: I have a plane where I want to dispaly randomized cards on button press. That's why I want to exchange the texture

#

Would material swap work instead?

fiery yoke
#

I guess. But all of that is pretty expensive

#

Funnily enough Im working on a Card system as well right now 😅

sinful slate
#

haha

fiery yoke
sinful slate
#

what's your approach?

fiery yoke
#

Using a custom Shader with a property that decides which part of the Texture is being used

#

Dont need to switch textures, materials, or even gameobjects

sinful slate
#

ah well, i use pretty large textures, since my cards are about 2 meters tall 🙂

#

so well… gonna try out if material swap works

#

hm, so apparently to set a custom material, you have to call Resources.load()… but there is no such thing in udon >_>

fiery yoke
#

No you dont

sinful slate
#

enlighten me 🙂

fiery yoke
#

Just put a material in a Material Variable

sinful slate
#

how to put it in? 🙂

fiery yoke
#

In the inspector. Make it public.

sinful slate
#

ah! 🙂

#

btw, what do the different colored lines mean in the udon graph?

fiery yoke
#

They are supposed to indicate which type its using

#

however...that doesnt quite work because of boxing

sinful slate
#

ah

#

you see anything wrong with the graph?

#

nevermind, suddently it's working

swift cape
#

So I have 3 toggle interactables for mirrors around my room. It seems randomly desktop can't click some of them, or they become really finicky to actually interact with, or VR can't interact with them. I remember someone asking a similar question but I can't find it. Is there some trick to getting these interactables to be more reliable?

#

this is the script that all the interactables use

flint urchin
#

Do you have any triggers (colliders) near/on where these interaction points are?

sinful slate
#

is it just me or is the udon graph editor getting really slow once a lot of nodes got added?

fiery yoke
#

It shouldnt get to a crawl, but it does slow down the more it has to draw yes

#

The graph is currently being reworked, so maybe it will be better after the update.

sinful slate
#

fingers crossed

#

to be fair, it isn't super fast here either when it's empty 😉

swift cape
#

@flint urchin actually yes. I have a big bounding box trigger that turns off the mirror when people get too far.

fiery yoke
#

Put it on the MirrorReflection layer

flint urchin
#

👆

swift cape
#

upvoted

#

Ok, but wait. I have it set up so that it's on a localCollision layer such that it will only fire when the local player exits. Do I just need to do this in a different way?

fiery yoke
#

Ahh yes thats a problem

#

At that point you only have "offset colliders" left

swift cape
#

I'm guessing the other worlds that do this successfully just have trigger boxes in doorways and such

fiery yoke
#

Ohh well there is another way

#

just make it be really flat

#

and on like hip height

swift cape
#

Right, that might be weird for my grabbable mirror

fiery yoke
#

Yeah its an annoying problem that been around forever

swift cape
#

What if I use like an update loop that just keeps checking the proximity of a player to all the mirrors in the room and disabling the ones that are too far?

fiery yoke
#

That would work I guess

swift cape
#

I have absolutely zero intuition on performance right now, but I think I'm going to give that a try. My world is all hilly, too, so using that thin collider method would be finicky even for the stationary mirrors.

#

but, as I understand it, the issue arises when there's a collider around the interact object, so I could perhaps just stick the interactable just outside of the bounding box somehow. Maybe right on the ground.

fiery yoke
#

Well if a raycast starts inside a collider it wont collide with the "inside walls"

#

Basically Colliders are Backculled. Just not in terms of rendering, but collision detections.

swift cape
#

ew

#

hmm...

#

alright, this is useful insight.

swift cape
#

Alright, I'm not sure what I'm doing wrong here. I verified that plugging the debug output directly to the Update event does print to the console, but how it's configured here does not fire at all.

fiery yoke
#

Dont know why youre using Object[]

#

you should probably be using GameObject[]

swift cape
#

Hmm, I didn't see that in the options. Oops.

#

.<

fiery yoke
#

That alone probably wont fix your problem tho

swift cape
#

Yeah, I also tried just plugging in a value directly into the end of the for loop and it also didn't output. Is there a place that shows udon compilation errors?

#

or runtime errors with more detail?

fiery yoke
#

Not really

swift cape
#

cool cool

fiery yoke
#

If the graph is behaving weird

#

I recommend to:

  1. Go into playmode
  2. Exit playmode
  3. Recompile Graph
#

I literally do that every time I work on the graph

swift cape
#

this is giving me a lot of appreciation for Rec Room circuits which is something I didn't think was possible given all of their weirdness 😛

fiery yoke
#

All I can say is that theyre working on improving user experience with the graph.

swift cape
#

Yeah, I'm not bashing at all. I know what I signed up for. Alright, going through those steps didn't seem to resolve the issue. Here's my whole graph

#

just checking when you say "Recompile Graph" you're referring to clicking the "manual Compile" button?

fiery yoke
#

iterating over an array on Update has had performance issues in the past. They have supposedly been improved, but if youre having frame issues then thats probably why.

#

Yes

swift cape
#

What I'm expecting is the debug log to output in the console like it does if I plug Update directly into the debug node.

#

This script is supposed to be disabling the mirrors when the player gets too far away from them, but it's not working, so I'm trying to trace the problem.

#

Once I figure out how to get this to work, I could probably replace that Update event with something less frequent, like a check every 5 seconds or something.

#

Oh wait... Get Position doesn't like that there's no local player

#

that's the issue.

#

yay it works!

barren plover
#

is there a wall of people who have been banned from this server and how do i get on it

zenith river
#

doesn't seem to be a udon related question, but the answer is no, there is no wall

fiery yoke
#

@zenith river Dont even give those trolls attention

swift cape
#

Is there some obvious reason why my logic for resetting the position of my grabbable object isn't working?

#

I've confirmed that the ResetMirror event is firing

fiery yoke
#

Yes

#

is it synced?

swift cape
#

It's not synced, no.

fiery yoke
#

Hmm then no

#

Ohh xD

#

Actually yes

#

You put a Transform into a Vector3 and Quaternion

#

Use Transform Get Position and Transform Get Rotation

swift cape
#

hek, so I have to extract that. Oops

#

I should have known

#

for some reason I was putting faith that if it allowed me to make the connection then it was being smart about resolving that information, but in this case I should have known better.

fiery yoke
#

Yeah imo Transform.SetPositionAndRotation should have an overload for Transforms

swift cape
#

Does udon have a concept of like... custom nodes?

fiery yoke
#

Not yet

#

Soon™️

swift cape
#

affirmative

tropic canyon
#

what like a custom expression node like amplify?

#

where it's literally normal code

#

or just a bigger picture of a bunch of nodes

swift cape
#

Like, if I wanted to encapsulate a bunch of logic that might be used a lot into a single node that's easier to reuse. For instance, these nodes might be nice to get put into a custom node with just a Transform input, instance input, and control flow input.

#

so you could open it up and see these three nodes, or leave it closed such that it's a single node.

#

encapsulation

#

Ok, huh. It's still not working. Hmm...

fiery yoke
#

Yeah thats planned

vagrant coral
#

ive ran into some wierd issue now... when i make a new udon program i cant edit it... like the "Open Udon Graph" does not show up...

#

oh it turns into a "assembly program asset" rather than a "udon graph program asset"

#

oh there is a drop down menu thingie... No more confusion! 😄

swift cape
#

Just checking, there's nothing bad about using multiple Udon Behoviours on one object, right?

fiery yoke
#

It can only confuse other VRC stuff like Pickups and Stations

swift cape
#

how so? I do have this pickupable mirror with VRC Pickup script and I wanted to add both a ResetMirror script and a ResetPosition script; should I instead combine them into one?

fiery yoke
#

Im not entirely sure either

#

Just try it lul

swift cape
#

I'm just still having problems with this resetting position script and I'm trying to figure out why. There's something I'm not understanding.

tropic canyon
#

did you sync position?

swift cape
#

I did not

tropic canyon
#

try to Rigidbody.MovePosition

#

with the rigidbody of the pickup

#

I'm unsure if you can edit the position while it's held too

#

I'd make sure to VRC_Pickup.Drop()

#

then try and set the position

swift cape
#

Alright, the issue came back to a misunderstanding with custom events. Turns out they can only be sent to one Udon Behavior component per object.

flint urchin
#

If it's a event that is on the same behaviour, you don't need to do that.
It's also better to just directly have a public udonbehaviour variable and use that (unless it's a trigger/collider)

fiery yoke
#

Welcome to the Udon-club. We have Aspirins and tissues.

#

If you want to send custom events to multiple behaviours, use an array and loop through it

swift cape
#

I'm trying to iterate over a list of game objects, but it seems like I couldn't just set an UdonBehaviour[] public variable

fiery yoke
#

No

#

UdonBehaviours have no arrays

#

for whatever reason

#

Youre right. Welp

#

As I said. Aspirins and tissues*

swift cape
#

And also this method seems to only pick the first UdonBehaviour component, so using multiple UdonBehaviours on a single object is not an option

fiery yoke
#

Yes

#

Thats another issue

#

you can get All Components

#

as a Component array

#

and in U# its easy to go from Component to UdonBehaviour

swift cape
#

Oh, and then filter by UdonBehaviour type?

fiery yoke
#

Yeah

#

However that gives you a Component array

#

I suppose as long as theyre the right components you can just assume that it will work

swift cape
#

ok. I know of U# but I'm actually trying to use noodles to get ready for Rec Room's circuits v2 which is basically the same thing

#

the good news is that all of my udon goals for today are working ^.^

#

now for extra

fair beacon
#

Woo

idle kite
#

hey so i recently added respawn buttons to a few dice in my world using this Udon graph, but for some reason when i try to respawn the dice it sometimes bugs out and the dice don't return, but they instead start to flicker if you keep clicking the button, anyone know a way to fix this?

fiery yoke
#

Are they position synced?

idle kite
#

yeah synchronize position is ticked

fiery yoke
#

Then you have to send a networked event to the owner and tell them to reset the position

#

Also if it has a Rigidbody dont forget to also set Velocity and AngularVelocity to 0

flint urchin
#

There is also no way to disable lerp on synced objects at the moment, so everyone except the owner will see the object float towards it's destination

idle kite
#

ahh i see, okay thank you

visual surge
#

is it possible that udon instantiate or vrcpickup change depending on hardware? i have an instantiated pickupable object in my world that i cant pick up but my friend can, later i found that he has an amd processor and i have an intel one, additionaly i tested with a few other friends and all the ones who have intel processors were not able to pick up the objects. Objects that were already in the world are pickupable by anyone but the instantiated ones only seem to be pickupable by whoever has AMD cpu. Has anyone else encountered anything similar?

visual surge
#

after more testing: people with nvidia + intel cant pick up, people with nvidia + amd cpu can, people with amd gpu + intel can

#

so im completely lost on why its happening or how to fix it, the only way around i can see is giving up on instantiating and using a pooling system instead

flint urchin
#

I have nvidia + intel and can pickup items after instantiation

visual surge
#

on the current update?

#

then i have no idea what else would cause it lol

#

back to the drawing board

hoary ocean
#

how would I do a simple if statement?

#

I could try while, but it hasn't seemed to work so far

flint urchin
#

branch is if else

hoary ocean
#

awesome

#

thanks bunch

#

Another question. I keep getting 0 errors, yet when I start testing, it doesn't load my new program. I make sure to manually compile each graph.

tropic canyon
#

Did you put the programasset into the udonbehaviour property?

hoary ocean
#

yeah, it seems to be an issue with my unity, it's not saving any changes to anything

hoary ocean
#

I think I have it handled now

visual surge
#

is there anything different between a local testing build and a published one? when testing my build locally i am able to grab my instantiated pickups normally while in the published one i am not

visual surge
#

so i finally managed too make all my pickupables work normally

#

turns out addding them to the dynamiic prefabs list is acctually what broke them

#

as soon as i removed every prefab from the list they all started working normally again

digital orbit
#

As far as I know, that's automatically generated and you shouldn't be messing with it

#

No difference between local and published. Except nobody else can join a local one obviously. And you don't have to upload it

sinful slate
#

I'd like to disable collision between specific pickups, while maintaining collision with the rest of the world. I've seen small board games doing that – any idea how to achieve that?

Also side question: Rarely when putting a pickup down (or them respawning), I see them all suddently glitching/flying all over the place, anyone knows the source of that issue?

zinc thicket
#

@sinful slate That's a physics layer (Vanilla Unity) thing. You can set certain layers to not interact with each other.

#

It's under Project Settings > Physics and then use the matrix (triangle) to pick which layers can interact with each other and which ones can't.

#

Then just set the layer or whichever object you want the special properties. Careful not to change or clash with existing layer numbers if you use multiple layer "hacks"...

scarlet lake
#

Does anyone know how to make a object move with out it following your head, and I'm trying to make the object move as well.

swift cape
#

I have a door with an animator that I want to open whenever someone is nearby, this is what I have with a box collider surrounding the door on the default layer. It doesn't seem to be triggering the animation and I just want a sanity check that the problem doesn't exist in my udon

#

the script is counting the number of people inside of the box trigger and keeping the door open as long as there is at least one person nearby

#

I don't think I need to synchronize anything; each client should be able to keep track of this on their own afaik

long rune
#

Is this global? I tried doing something like this but did not succeed.

fiery yoke
#

It depends on which layer you have the trigger on

long rune
#

what layer would you suggest?

swift cape
#

I'm not sure what that means

#

what does it mean for something to be global?

#

I've set the trigger to be on the Default layer.

long rune
#

Where both you and another can both the the animation when it triggers.

swift cape
#

Yeah, that's what I want the trigger to be affected by both local and remote players.

fiery yoke
#

@swift cape If its on the default layer it will also count stuff like pickups, the players camera. Basically everything. Not just players

swift cape
#

Oooh

#

so should I make a new layer then?

#

or can I use the Player layer?

#

That seems like it might do what I want

fiery yoke
#

Player also collides with a lot of other stuff

#

you would need a layer that just collides with Player and PlayerLocal

swift cape
#

Alright, so I'll just make a new layer, then.

long rune
#

I have a simple trigger setup for an animation(a door) on the default but I tested it and only I see the animation.

#

I do need to make a new layer as well, I'll send a screen of my simple setup here in a few.

tropic canyon
#

well

#

yes

#

was thinking of the wrong trigger

swift cape
#

oooooh, I figured out the problem with my script at least. Like a doofus I forgot to plug in the animator variable into the Animator Set Bool node >.<

long rune
#

I need to update the sdk real fast then I'll share what I have :)

swift cape
#

now to figure out this layer stuff.

#

ok! thank you ^.^

long rune
#

lemme know if you get that working as intended @swift cape I also want to have a door open automictically vrcAevSlap

tropic canyon
#

can also sendcustomnetworkevent to open and close the door

fiery yoke
#

Unneccessary

tropic canyon
#

¯_(ツ)_/¯

long rune
#

I am still working my head around this Udon ¯_(ツ)_/¯

swift cape
#

small successes

tropic canyon
#

it's the unity library and some of the system library but missing a ton of stuff from them

swift cape
#

I think I should be able to avoid networking

#

like, each client knows where all the other players are, so they should be able to keep track of if there is anybody near the door, right?

tropic canyon
#

sure

swift cape
#

I need to figure out how to test multiple clients locally

tropic canyon
#

do the multiple client local testing.. it should be fixed afaik

swift cape
#

@.@

flint urchin
#

It is. Make sure the path is correct and set the number of clients (max 8)

swift cape
#

Oh wow, that JustWorked(tm)

#

was not expecting that

fiery yoke
#

Is the max enforced by VRChat because more than 8 would cause some sort of problems, or is it just an arbitrary max so you dont spawn in a hundred clients

tropic canyon
#

¯_(ツ)_/¯

swift cape
#

no networking required

long rune
#

all ya did was make a new layer with only player and localplayer?

swift cape
#

so yeah, @long rune it was enough to create a new layer that just collides with Player and localPlayer and then I used this Udon to toggle the door's animator.

#

Yup

long rune
#

My toggle is like 3 nodes lol

#

but I use a object to activate the animation

swift cape
#

I'm keeping count of how many people are near the door

long rune
#

I just would also like this option on which you have provided :)

swift cape
#

if you just toggle, you'll end up with the door shutting in your face when anyone walks out of the doorzone

#

really you want the door to be open as long as there is >= 1 person near it

long rune
#

Makes sense.

fiery yoke
#

= 1 is same as > 0. Just saying :P (For Integers)

long rune
#

The problem I have with my toggle, the animation is client side.

#

So I will see if the layer is my problem

swift cape
#

all clients know about the animation, so you just need to arrange it so that all clients can detect the trigger to activate the animation.

long rune
#

Still waiting on unity vrcAevSlap

scarlet lake
#

still need help on how to make a object stay still while i move around

fiery yoke
#

@scarlet lake If youre talking about avatars then this is the wrong channel. #avatars-2-general

scarlet lake
#

avatars channel right?

long rune
#

Looks like I just need to up the client number

tropic canyon
#

interact is locally called

#

so if someone presses it it's only for them

#

as everything in udon

long rune
#

Oh, I see. How do I go about making it global?

tropic canyon
#

either have a synced variable or sendCustomNetworkEvent

#

so on interact branch with a bool

#

calling 2 new events

#

and I guess in the event set the bool

long rune
#

branch node after interact then two events?

tropic canyon
#

😳

#

I guess

long rune
#

iris that's what I am doing right now, guessing.

tropic canyon
#

Interact -> check bool -> sendCustomEvent to opposite value

#

customevent -> set bool -> do animations etc

#

oh no

#

it won't sync when a new player joins tho

#

they will see the initial value until someone interacts with it

#

also some people could spam interact it

long rune
#

Yes

#

spam

#

a delay can be added

tropic canyon
#

:/

long rune
#

¯_(ツ)_/¯

#

sync will be needed tho.

tropic canyon
#

a synced bool could be used

#

but then you get the issue of ownership

fiery yoke
#

You can sync with events

#

OnPlayerJoined -> Ask master what the current status is -> Master Broadcasts status

#

Wrong channel

long rune
#

Yeah, I'm not sure what I'm doing now vrcAevSlap

cedar cove
#

Quick question, if a synced variable is assigned the same value it already has, does it actually sync? (and fire the serialization methods)

fiery yoke
#

Good question. Not sure but my intuition would say no

long rune
#

I've always wondered, I use Unity's UI elements a lot, I have set a toggle with the transition being animation, mind you that I have a toggle group for multiple toggles. I play the editor, hover my mouse and it plays the animation, I insert the VRC UI shape then upload the world(using UDON). The animations do not work now but still function as a toggle. Any clue why this is?

#

Is this just a Udon thing with UI elements?

hasty zenith
#

So my in game name is as spelled in discord.
Scarecrow.exe
Pretty sure you cant use the period anymore when creating a username but i got mine before that was changed so i'm grandfathered in and realyl like my name.
Seems to be messing up Udon string values though and we're tryna figure out how to fix that. Would simple quotation marks work? like "Scarecrow.exe"

tropic canyon
#

remove the period

#

it's a bug that periods and special characters behave weirdly

hasty zenith
#

Again, asking for workarounds first, but we figured as much

#

Is this a known thing that they'll try to fix on the udon/vrc side?

raven lark
#

What do I do? My avatar is broken. I can only move to the right and left. I do not know what do to. HELP ME!

fiery yoke
#

@hasty zenith Best solution I can think of is converting the string to Base64

long rune
#

the multiple client local testing working for you guys?

raven lark
#

And I can't click anything!

fiery yoke
#

@long rune yes

raven lark
#

...

#

Which one?

long rune
#

Mine seems to not work? One client spawn into my world with the updated world but the other at default home.

raven lark
#

It doens't work! A random avatar thing gave me this avatar.

long rune
#

You're in the wrong channel my guy...

raven lark
#

...

#

then where am I going for bugs and glitches and help???

long rune
raven lark
#

It worked!

#

I just pressed \ after the alt and right shift

safe spoke
#

Yo guys, having issue with "Check whether your pc has working internet connection and restart VRChat" any fixes? Sorry if wrong section

tropic canyon
#

:notlikethis:

long rune
#

Nice one.

#

So how does multiple local client suppose to behave? My questions go unanswered.

tropic canyon
#

like normal

long rune
#

Wow, an answer that totally helps me out. Thanks a lot!

fiery yoke
#

Well...thats it tho

#

the only "difference" is that all clients have the same user/display name

#

Other than thats its like having multiple accounts on the same pc

long rune
#

do both clients spawn in the same world together?

fiery yoke
#

They should yes

long rune
#

That's all I needed to know. Mine seems to not be working even tho I have the latest sdk.

tropic canyon
#

oh point the executable path to the executable in steam

#

or oculus I guess

long rune
#

I do have it set to an .exe

tropic canyon
#

I didn't do it..

fiery yoke
#

You do

tropic canyon
fiery yoke
#

It doesnt work with the bat

tropic canyon
#

😎

long rune
#

Even after so, it still behaved the same. I want to use this feature so I don't have to rely on someone to help me test out my systems.

fiery yoke
#

The SDK uses a path saved in the registry by default. That however points to the batch file, which for whatever reason fails to launch local clients correctly.

long rune
#

Hopefully I get it to work, anyways thanks.

copper gale
#

umm anyone know how i can change to my favourite avatars in a different world on pc?

scarlet lake
#

I know

hushed gazelle
#

Is there any reason why this wouldn't be destroying a detected spawned prefab object? I know it's detecting the ball entering the box as it sends the udon command afterwards, but it wont destroy the existing ball

fiery yoke
#

Destroy Immediate is meant for "In Editor" destroying

#

use "Destroy" instead

hushed gazelle
#

I tried that, didn't seem to work either.

#

All it seems to do is strip the sphere collider from it rather than kill the whole object.

fiery yoke
#

Ohh

#

yeah ofcourse

#

other returns the collider

#

do Collider.Get GameObject

hushed gazelle
#

Ahh, cheers!

#

I did do a search to see if there was a get object node, but the search function's... not great.

#

That worked. No more errant pinballs falling away into the ether.

worthy beacon
#

has anyone experienced increased lag on their udon maps after the resent updates? My map didn't do this before, but if enough people are playing, the lag will start to hit hard enough to cause people to disconnect

forest mist
#

Does anyone know anything about mechanics of rotating objects? I need to be able to adjust the position of something based on its rotation and relation to an object. For instance: this hat that rotates as the head does, but does not change position to account for the rotation.

tropic canyon
#

do you want to learn about quaternions or do you want an easy solution?

forest mist
#

Both are good

#

Whichever you have time for

tropic canyon
#

easy solution is parenting

#

move the parent of it to the head bone

#

and move the hat under it to the right position

#

and just rotate the parent

fiery yoke
#

You can also use a Parent Constraint afaik

forest mist
#

The hat currently has no parents. So, I'm creating an empty GameObject around the hat?

#

@fiery yoke What do you mean?

tropic canyon
#

parent constraints are weird..

#

just making an empty is a lot easier

#

if you can reparent the parent constraint is useless

forest mist
#

Hopefully I can keep it all in the same Udon script... I don't want to be throwing custom events around

fiery yoke
#

I like the parent constraint because it doesnt mess with your hierarchy

#

But whichever you prefer-

forest mist
#

There is also a mathematical method using Quaternions?
Though I assume that's much more complex

tropic canyon
#

eh

#

it's simulating parenting

zenith river
#

Hm, why not have an empty following the exact head rotation and location, then parent the hat to that empty, no need for the complex maff than

fiery yoke
#

Quaternions are 4-part complex numbers. They are mathematical constructs that are hard to grasp.

tropic canyon
#
                Quaternion rotation = currentPlayer.GetBoneRotation(bone);

                position += rotation * offsetPosition;
                rotation *= offsetRotation;

                visual.SetPositionAndRotation(position, rotation);

                rb.MovePosition(position);
                rb.MoveRotation(rotation);```
#

wait wtf is that indent..

zenith river
#

Aah math!

fiery yoke
#

@zenith river That is exactly what @tropic canyon was proposing

#

Parenting is the easier solution

zenith river
#

Ah right

forest mist
#

I've had to slightly touch on quaternions in order to even get the hat to follow the correct rotation. But yeah, I don't really get them

tropic canyon
#

quaternion * quaternion is like adding

forest mist
#

Yeah :D

And quaternion * (inverse)quaternion is like subtraction

tropic canyon
#

and quaternion * vector3 rotates that vector3

forest mist
#

Ahh, I gotcha

tropic canyon
#

though

#

they aren't commutative I think it's called

forest mist
#

I was trying all sorts of quaternion * Vector3 stuff to try to get it to work!!

I guess I just didn't have the right combination

tropic canyon
#

so quaternion1 * quaternion2 != quaternion2 * quaternion1

forest mist
#

Yus

#

That was a pain in my ass because it goes against everything I learned in school xD

tropic canyon
#

matrices aren't commutative

fiery yoke
#

Maths is hard.

tropic canyon
#

matrix 1x3 * matrix 3x1 != matrix 3x1 * matrix 1x3

forest mist
#

I'm not entirely confident I know what "matrix" means in this context

fiery yoke
#

A Matrix is just a "grid" of numbers

tropic canyon
#

matrix is a multidimensional array of floats

zenith river
#

Oh wait, so just think of them as matrix?😲

fiery yoke
#

Quaternions arent Matrices

#

They are unrelated

tropic canyon
#

😳

zenith river
#

Uh oh, well back in the dunce cave I go

tropic canyon
#

everything in math is somehow related

fiery yoke
#

Quaternions are described as "the quotient of two vectors". They are generally represented as "a +bi + cj + dk" where ijk are imaginary and abcd are real

tropic canyon
#

I made the thing you're making already, arty

forest mist
#

Well yeah, I know people have made it before :<

I wanted to challenge myself with this one. And I’m making it for a friend

tropic canyon
#

k

#

have fun

forest mist
#

position += rotation * offsetPosition;
I’m out right now but I’ll try this as soon as I have the opportunity. Can’t believe I was so close but had the wrong numbers.

Thank you for the help @tropic canyon

celest shuttle
#

Anyone got the syntax to play an AudioSource (locally) on an object ?

#

for UDON sharp...

digital orbit
#
public void Start() { foo.Play(); }
forest mist
#

I'm double mad now, I had the note written down for next time, literally the next thing I was going to try

Oh well, the important part is mostly works

digital orbit
#

@celest shuttle

warped river
#

So what’s the current situation with YouTube Live videos. I’m in Volt and I need to stream in a youtube live video tomorrow. I see lots of chatter about this topic but most of it is old.

worthy beacon
#

So i take it no one knows of any current issues with the last update that could be causing network lag to the point of disconnection related to udon?

fiery yoke
#

Thats quite vague

worthy beacon
#

the spesific is did the last update introduce a bug that increased lag related to use of udon XD

#

my bomberman map has never done this before, but after the last update it starts to get more and more laggy, then eventually disconnects people

#

and i didnt touch anything related to the code in the last few updates, only added map optimizations like light baking and occular occlusion

#

like was there a new memory leak or somthing?

fiery yoke
#

Hmm...there were some significant changes yes

worthy beacon
#

the disconnect also causes the person when they rejoin to desync with everyone else in the world, havnt isolated spesific causes but basicly people wont show up for others, avatar and all

#

i suppose ill do more to try and debug it and report the bug

forest mist
#

@tropic canyon Following up on the code you wrote earlier, it worked great, but it's introduced this strange issue where on first activation, the hat does not place correctly. Do you have any idea why?

tropic canyon
#

oh

#

it might be you not calculating the positions correctly

#

it's..

#

a little indepth

forest mist
#

It's strange that it positions it fine before I added the Quaternion*Vector3 node though...

tropic canyon
#
Vector3 tempPos = tempPlayer.GetBonePosition(tempBone);
Quaternion tempRot = tempPlayer.GetBoneRotation(tempBone);

tempRot = Quaternion.Inverse(tempRot);

offsetPosition = tempRot * (transform.position - tempPos);
offsetRotation = tempRot * transform.rotation;
#

this is the code to get the offsetposition and rotation

#

you need the local position of the object

#

you can't just give it the global one

#

as goes for rotation

forest mist
#

Won't the global and local position be the same, considering that the hat has no parents?

#

Or does it work differently than that?

tropic canyon
#

the quaternion code I sent operates like local positions

#

like the head was the parent

forest mist
#

Ah, I see

tropic canyon
#

so offsetPosition and offsetRotation

#

would be like the localposition and rotation

forest mist
#

Interesting, I see!

#

I also have my own code for figuring out the offsets, though my variables are called "differential"

I will compare my formula to yours and alter it as soon as I'm able to

#

Thanks a lot!

tropic canyon
#

you need to do that code

#

onDrop

#

when you want to attach it

forest mist
#

I have it on onPickupUseDown

#

So you "click" or "use" the hat on yourself to attach it

tropic canyon
#

sure

warped herald
#

Hello, will udon support Gradient in the future ?

swift cape
#

Someone showed me an avatar that breaks all box triggers in my room. I'm not really sure what the avatar is doing but I'd like to know if a mitigation exists to make box triggers more reliable.

What I think is happening is that when they equip the avatar, it makes all the box triggers fire an onEnter event, but then there's no onExit event fired for some reason, which throws off the count of players inside the volume.

zenith river
#

maybe they are using an occlusion cube and forgot to remove the collider 🤔

swift cape
#

in my case, it's with the doors in my room. As soon as they equipped the avatar, all the doors opened, but they remained open after they unequipped the avatar.

tropic canyon
#

can't account for all avatars sadly..

fiery yoke
#

If people use avatars that break stuff its their problem. Unless its the majority.

tropic canyon
#

only way to mitigate would be if the layers were setup differently

#

like player layer only being the pills

#

not every collider on the avatar aswell

#

that would also fix the auto mirrors

swift cape
#

that seems reasonable for the doors at least.

tropic canyon
#

which turned off when you setactive false'd a vrc station

#

on your avatar

spring forge
#

can someone remind me what the debug shortcut is in game?

fiery yoke
#

Shift + ` + 3

spring forge
#

Thank you 😄

fiery yoke
#

Not sure if left or right shift

swift cape
#

oh, does that allow you to see log output in game?

spring forge
#

I'll try middle shift if I have to

fiery yoke
#

Yes

tropic canyon
#

Right shift

sinful slate
#

when having two pickups with gravity and such – can you disable collision between those pickups?

uncut furnace
#

Have them on a layer that cant interact with its own layer (Exemple: objects on the "player" layer cant collide with other objects on the "player" layer)

sinful slate
#

i see – gotta read into how to setup layers, thanks 🙂

fiery yoke
#

Is there a way to get which player is sitting in a station?

mighty fjord
#

What I did was to just set the owner, but I wish there was a way to retrieve an array of players on a station

fiery yoke
#

Each station can only have one player in it tho?

mighty fjord
#

They can have multiple if you time it right

#

And maybe if you force others onto it

fiery yoke
#

Really? That ruins my whole idea 😭

#

I dont think Ive ever seen that happen tho

mighty fjord
#

Theres probably some way to work around that issue now though

hoary ocean
#

Heya

#

I am attempting to do collision events as per layer, as was the case with vrc_trigger

#

any advice on how to do this?

fiery yoke
#

You get the collider from OnEnterTrigger, then get the gameObject, then the layer it is on, and compare it to a LayerMask. However be aware that when colliding with protected objects such as the player, it will return null. So you have to make some null checks.

hoary ocean
#

that's a big step up from 2 buttons lol

#

I'll see what I can do

grand temple
#

Are you using graphs or udonsharp?

hoary ocean
#

graphs

#

I would use U# but then I'd have to convert everything.

grand temple
#

I'm not sure if layer masks and bit shifting can be done properly on graphs, so I would recommend just having an int that represents the layer you want to check for. Then just check if gameobject.layer is the same as the layer you want to check for

hoary ocean
#

I feels very strange compared to how it was with just triggers, but I think it might be workable enough. I appreciate the advice. would some more advanced stuff be better with U#?

grand temple
#

Yeah it's easier to deal with U# when things get big or complex

hoary ocean
#

another question. if I am trying to move another object, would I refer to its transform then do a set transform with a get variable?

#

let me show you. in theory, this would move an object to the first point of collision, yeah?

grand temple
#

Correct, but two things: you need to check if collision.collider != Null before doing anything else, and also are you aware that oncollisionenter refers to two objects bumping into each other, not a trigger collider entering into another collider?

hoary ocean
#

I am really just trying to make a block move to when I collide an object with anything, and show me first point of contact. it's more for the learning aspect. my issue comes into play when the block simply doesn't move.

#

(it is added to the external references)

grand temple
#

That's probably because the behaviour is crashing when it encounters a protected object

#

That's why you need the null check

hoary ocean
#

I see.

grand temple
#

Looks ok

hoary ocean
#

well, I have a trail that follows the item based on its angular velocity, that's not stopping on collision anymore. so it isn't crashing, but the other object seems to not be moving still

#

I had ghost noodles, which bugs me. definitely moving to U#

hoary ocean
#

I'm actually almost kindof mad at how easy that was to do in U# lol

scarlet lake
#

it says in vrchat sdk said that i need to get a vrc avatar descriptor but i already e

#

enabled it

hushed gazelle
hushed gazelle
#

How do I trigger a hinge joint with Udon? I know how to change the force and velocity with an animation, but I can't seem to be able to get at those values with Udon.

tropic canyon
#

they are part of the rigidbody

#

afaik

#

so rigidbody.velocity and rigidbody.angularvelocity

hushed gazelle
#

Ahh, cheers.

#

I can't see how to actually set a HingeJoint's motor. I can GET the JointMotor, but I can't assign anything to except the Type.

tropic canyon
#

it might not be exposed you gotta check

#

with some things you got to store it in a var before accessing the settings like the particle system emission

warped herald
#

is there a way to zoom in/out in udon editor ?

tropic canyon
#

in the new one yes in the current one no

digital orbit
#

is there a way to zoom in/out in udon editor ?
I estimate it'll come soon, it's still in testing right now to work out any issues

warped herald
#

i hope gradient support will come:)

visual surge
#

is there any way to override one of the player inputs, like replacing the ability to jump for something else?

fiery yoke
#

@visual surge The short answer to that is no.

zenith river
#

long answer: no, but you can listen for the key event and trigger an action that way

tropic canyon
#

You can take away the ability to move

zenith river
#

ill take away your ability to move vrcXiexeBlush

tropic canyon
#

Emma.Immobilize()

#

😳

flint urchin
#

Can also not enable jump in the world 👀

fiery yoke
#

Why use VRCPlayerApi.Immobilize when you can force Player into a Station they cant exit :^)

zenith river
#

actually, how do you put a player in a station with udon 🤔

fiery yoke
#

Station.UseStation(VRCPlayerApi)

chilly aspen
#

I have a question. Imagine the following code executed by a master player where boolVariable equals false:

SendCustomNetworkEvent(VRC.Udon.Common.Interfaces.NetworkEventTarget.All, "SetBoolVariableTrue"); // Function that sets boolVariable = true;
if (boolVariable) MethodA();

In this scenario, is it possible for there to be a delay in setting boolVariable to true, preventing MethodA() from being called for the master player?

fiery yoke
#

Alright sorry. Reread it a few times

fiery yoke
#

@chilly aspen Yes ofcourse there is network delay. When you "SendCustomNetworkEvent" it will take network time until the message has arrived.

indigo shuttle
#

How would I make triggers work with one object only?
E.g. making a trigger only work if a player enters the trigger, like a collectable can only be picked up by players

#

I know in C# you'd usually use other.tag == "Player" but I don't see the ability of using that anywhere in udon

marble lark
#

OK, I'm having a dumb problem - I can't get Interact events to work. Gimme a sec, and I'll get the Udon Nodes and Inspector View for it...

#

One of the buttons - they're all the same, minus some object differences.

fiery yoke
#

You need a Collider.

marble lark
#

Oh.

#

Bugger.

#

So I presume both a Collider AND a Mesh Renderer?

fiery yoke
#

The Collider is for Collision detection. The Mesh Renderer for Rendering.

#

If you want to see your object, then a mesh renderer would be quite neat :P

marble lark
#

Nah, the buttons themselves are textures on a pad, I just need separate interact boxes for each one. I think I tried earlier with a collider and no mesh renderer though, and afair that didn't work either. Hang on, Imma try it again.

marble lark
#

Nope, that didn't work either. Does it have to be a Trigger?

digital orbit
#

Make sure to click the convex option if it's a mesh collider

marble lark
#

Figured it out - turns out you can't use buttons inside other colliders...

#

Should have realised that one, it's kinda obvious thinking about it...

digital orbit
#

Any idea why I can't pickup objects that have a pickup script on them?

#

I can pick them up, but sometimes they fall in a certain place, suddenly I can't pick it up anymore

fiery yoke
#

Most likely other colliders blocking them