#udon-general

59 messages · Page 37 of 1

compact stirrup
#

I have a fixed update that moves a platform, but I only want to move it OnPlayerTriggerEnter, I have a bool variable but I can't find anything to set it

#

oh, let me see if I can find them

unborn hornet
#

Drag tha variable name onto the graph for the get node

compact stirrup
#

right

#

oh I see! when dragging with ctrl it's a setter

unborn hornet
#

Indeed

compact stirrup
#

thanks!

livid beacon
#

I'm having a really weird problem

#
  An exception occurred during EXTERN to 'SystemInt32.__op_LessThan__SystemInt32_SystemInt32__SystemBoolean'.
      Parameter Addresses: 0x00000036, 0x0000001D, 0x0000001B
  
  Cannot retrieve heap variable of type 'String' as type 'Int32'
#

I have no idea why the heck this would possibly cause an error

compact stirrup
#

Are you trying to store a string of an int into slice somewhere?

livid beacon
#

No

#

No strings

#

It is set by two things

pure harness
#

Is there any kind of drawback to using Udon Sharp rather than using the graph?

mighty fjord
#

@livid beacon Have you tried adding a constant integer and connecting it to the 'Set slice_counter' node instead of having the '0' be directly in it?

livid beacon
#

WTF

#

That worked

#

Why does that even matter?

bleak widget
#

Udon bugs work in mysterious ways

#

After a while, you start getting used to a lot of them

livid beacon
#

Are there any other bugs I should know about?

unborn hornet
#

Yes.

livid beacon
#

so uh question

#

are uh

#

are while loops broken too?

#

It's getting in an infinite loop somehow

#

and I've made sure to actually confirm that the condition does eventually become false

#

through the power of debug,log

wheat rover
#

You using U#?

livid beacon
#

no

wheat rover
#

Well, try sharing your noodles.

#

(Screenshot 'em)

livid beacon
#

noodles is a fitting name

void ridge
#

(udon is a type of noodle)

wheat rover
#

How about the part that, presumably, increments slice_counter? There any conditionals for it or anything?

livid beacon
#

like I said, noodles is a fitting name

#

the purpose is to set exactly 3 random items in a boolean array to true

#

I've tried adding a debug.log at the end and confirmed that the slice_counter does in fact go up to 8

mighty fjord
#

Been having issues with while loops aswell, so I decided to pass on them for now

bleak widget
#

Those aren't noodles. That is spaghetti

livid beacon
#

yeah

#

spaghetti code

#

it really is a fitting name

wheat rover
#

It goes all the way up to 8 even though it's supposed to end after 3...? Yeah, that's weird.

livid beacon
#

exactly

#

alright time to write some real shitcode

#

well

#

noodle

#

welp

#

so my solution was a for loop that loops a billion times with an if statement to only run the body if the number is less than 3

#

is it shitcode?

#

yes

mighty fjord
#

Try checking ever loop to see if the int is less than 3, then assigning a boolean if it isnt, and then also use that bool for the while loop.

livid beacon
#

but does it work?

#

also yes

wheat rover
#

Yeah, what Nestor suggested may work better.
Alternatively you could set what ever the for loop is reading from/incrementing to the end value when the check fails as well

celest olive
#

Uh question. How would I go about making interactions trigger a specific animation in udon?

#

The animator for that object is set up like this. Transitions are actually empty, but I have no idea how to properly work with those from code..

#

(also the top Set isOpen is obviously on false. No idea why it set itself back to true..)

fickle swift
#

You would need a transition going the other way from idle and have a animation trigger that you tell UDON to make happen.

celest olive
#

Mhm. What function is that actually? I guess I can access the animator's variables through code somehow..

#

And then just have it natively react to that as by transition rules

fickle swift
#

I think it’s SetAnimationTrigger

celest olive
#

Mhm. I'll look into that! Thanks c:

fickle swift
#

You have to select animatior first

fiery yoke
#

Animator.SetTrigger(string name)

fickle swift
#

Yep

#

That

#

If your doing UDON# that is.

fiery yoke
#

Well there is no good notation for Nodes

fickle swift
#

True

fiery yoke
#

Animator -> SetTrigger
Expects:
string

#

That maybe

fickle swift
#

Na. The other way it probably how I’m going to do it from now on.

fiery yoke
#

But all of that information is bascially in
Animator.SetTrigger(string name)
as well

fickle swift
#

The this -> that way sucks

pseudo parrot
#

Is there a working Panorama script for UDON yet?
Kinda wanted to add some Event posters in my world.

livid beacon
#

aaaa why is udon so goddamn buggy

dapper lion
#

its is a new technology

livid beacon
#

I'm gonna try this u# stuff

fickle swift
#

That’s the best idea XD

dapper lion
#

good plan

pliant spade
#

Can some one help me with triggering a model animation

#

Please

jagged crow
#

when a user joins an instance will they be sent all the synced variables?

#

or do I need to code that in manually

wheat rover
unborn hornet
#

Synced variables are transferred automatically.

jagged crow
#

no way to trigger a sync "early"?

unborn hornet
#

Nope.

jagged crow
#

mk, that simplifies things I guess

unborn hornet
#

You can detect or read synced variables changes (the 5-10 times/second) using the OnDeserialization event.

#

That runs for every non-owner of an object each time they receive a "sync update"

jagged crow
#

ooh

#

that would probably be better than doing it on update

unborn hornet
#

And anytime an owner is sending a "sync update", the OnPreSerialization event runs.

pseudo parrot
#

Is there a working Panorama script for UDON yet?

fickle swift
#

Only if you want to make it!

keen imp
#

When will TextMeshProUGUI be added this should have come with the introduction of TextMeshPro there is no reason for it to not be there its identical

fickle swift
#

Anyone happen to know how that among us game routes the voice chat to the lobby?

keen imp
#

Ask Jar

fickle swift
#

👍🏼

pliant spade
#

Can i make it so when the animation is done it sets the bool back to false?

rancid cedar
#

So in SDK3 has udon replaced stuff like "VRC_Trigger"? Im following a simple tutorial and got to the step about making a toggle mirror and am missing components that he uses

scarlet lake
# rancid cedar So in SDK3 has udon replaced stuff like "VRC_Trigger"? Im following a simple tut...

follow this tutorial, sdk3 don't have VRC_Trigger so yeah
https://youtu.be/ibDu0dCeUE8

With the recent Udon updates, some of the basics have changed, so here's my most basic tutorial redone with the new editor, and not recorded at 2am! If I get enough requests, I'll redo my "Contextual Buttons" video as well, which will give me an excuse to just rename them "Event Buttons" which actually makes sense.

00:00 - Intro
00:20 - Udon Gr...

▶ Play video
rancid cedar
#

okay cool

pliant spade
#

I made a button that plays a animation in my world but it keeps looping the animation, can someone please help me

mighty fjord
#

You can turn off animation looping on the animation clip itself through your assets

pliant spade
#

I know that but i want the bool to go false when the animation is done

mighty fjord
#

I wonder if it's possible and viable to do animation events in Udon...

rancid cedar
#

So Udon seem pretty straight forward coming from UE4, but I'm having an issue where my public variables look like this and i can't assign anything to them

mighty fjord
#

Have you put that script on a game object PottedFox?

rancid cedar
#

i have, should i do it after?

#

oh i got it

#

yeah i didn't assign the right one lol

pliant spade
#

It loops

#

I don't know how to fix that

rancid cedar
#

I've not messed with animations enough Ocublox, ill be interested in what the fix is though

mighty fjord
#

Could possibly set up a small timer that keeps the bool parameter on for a bit, and then the animator state goes to the animation and then goes back when it's done

rancid cedar
#

Whats a good number of batches to have in a world?

serene shale
#

do the player audio mute/unmute cubes not work in the UdonExampleScene?

#

spun it up in a local build instance with 2 clients, and nothing happens with the voice audio when I try to click them

scarlet lake
#

sorry for tagging but any update on this? im packing data in my program into synced strings currently, and sometimes it produces invalid utf16 sequence which causes the utf8 encoder to restore incorrect values once its gets synced (replaces chars with 0xFFFD). im at a loss to try and prevent this on my own

fickle swift
pliant spade
#

k

rancid cedar
#

is there a node to set the position of a game object? struggling to find what it might be called

#

yeah totally lost on this one, cant really find much info

mighty fjord
#

It's under 'Transform'

rancid cedar
#

figured it out

#

ty though ❤️

cunning mist
#

@pliant spade Have you figured out the looping yet? The animation file itself has a bool you can check in the Inspector that toggles it's ability to loop.

fickle swift
#

Then I have a transition that happens on TryUse

cunning mist
#

I highly recommend using Snipping Tool in order to get clear screenshots 👍

fickle swift
#

Yea. My PC doesn’t have discord on it right now.

#

That’s a task for later today XD

cunning mist
#

Unfortunate haha

rancid cedar
#

both variables are set to public

fiery yoke
#

But have you also populated the variables with objects in the Inspector? :P

rancid cedar
#

no because it won't compile and give me the fields to fill lol

#

do you have to set them before you continue with the graph?

fiery yoke
#

The graph compiling and udon running are two completely different things

#

You should be able to compile any graph at all times without any errors

rancid cedar
#

Well that's the issue im having, hitting compile on the graph throws an error

fickle swift
#

I see nothing wrong with it.

#

Can you show us the full graph screen?

rancid cedar
#

well thats no good

#

sure ill take a gif because the error icon is strobing now lol

cunning mist
#

So here's what you do
Delete your graph and remake if from this screenshot
🤷

rancid cedar
#

dab

cunning mist
#

As well, you can just use public Transform variables instead of gameobjects, then you don't need to be grabbing the transform variable everytime

rancid cedar
#

alright ill try to remake it lol

#

remaking the graph and just using transforms worked

#

who knows lol

raven peak
#

Curious if the get transform from gameobject is bugged. Would be something to write a canny about.

mighty fjord
#

Hey, is it possible to make custom Udon nodes, like functions I might use somewhat often?

raven peak
#

Custom event node.

mighty fjord
#

As in setting up an object with said custom function on it and then sending a custom event and information to it whenever I want to use it?

raven peak
#

no udon doesn’t natively support that yet. If you use udonsharp there are some work arounds to do that though. You can also use nonpublic variables to set the values before you call the event.

#

Then use those values during the event.

mighty fjord
#

Yeah, but my main point is to clean up my graph a bit.
Does anyone happen to know if sub-graphs are still supported?
https://ask.vrchat.com/t/subgraphs-nested-graphs/214

cunning mist
#

They dropped it a while back while redoing things, it will be coming back just not at present.

mighty fjord
#

Ah, thank you for letting me know. ^^

raven peak
#

I just want the udon network update 🥺. It looks so nice so far.

cunning mist
#

Same, is big nice, though Dan's entirely redoing ownership, so it may be a couple more months...

raven peak
#

Personal estimations would be first quarter 2021.

pliant spade
#

No @cunning mist

mighty fjord
#

Oh hey, that sounds intriguing, where could one find information regarding it?

pliant spade
#

Why

cunning mist
#

Did unchecking loop work?

pliant spade
#

No

cunning mist
#

Unfortunate

pliant spade
#

I need to make it so the bool gets set to false

#

or it loops

#

STOP

cunning mist
#

You should be safe just using a trigger instead

pliant spade
#

JUST LEAVE

cunning mist
#

Literally none of us are mods, do this in General

#

That usually works

pliant spade
#

Just leave the server

#

wtf

cunning mist
pliant spade
#

...

raven peak
#

That was fun.

pliant spade
#

NO

cunning mist
#

Dammit Helper

pliant spade
#

Not helpful

fiery yoke
#

Sorry but this is just toxic. Slightly amusing yes. But mostly just toxic.

#

Thanks. I guess

pliant spade
#

😠

#

@cunning mist How do i get up a trigger

raven peak
pliant spade
#

I just want a button that plays a animation in my world

cunning mist
#

Use a Trigger variable instead of a Bool, than instead of SetBool use SetTrigger. Have an idle state you go out if using the trigger, than a transition out when the animation ends.

pliant spade
cunning mist
#

Yeah Jet that was on a previous conversation

#

Ooo Linux

pliant spade
#

|: |

cunning mist
#

What are you running?

#

Nah for linux, recent build or just something you're used to?

fiery yoke
#

Aww

pliant spade
#

omg

limber shard
#

Hmm.

cunning mist
#

The world may never know

fiery yoke
#

I was just starting to enjoy that shitshow

#

Guess they got what they wanted

cunning mist
#

Anyway yeah do the trigger thing

raven peak
#

I wanted him to be kicked instead. Rip.

fiery yoke
#

so win-win

fickle swift
#

Darn

void ridge
#

Figuring out teleporting players around. Seems like the essential node is Vrcplayer Api Teleport To, but I can't create that in my graph. Where did I go wrong?

mighty fjord
#

Is it not under PlayerApi > Teleport To?

void ridge
#

Hmm ok, that found it. I typed "api" to find that. But typing "tele" found nothing 🤔 I guess the search feature is more fiddly than I thought. Will have to get used to it. Thank you

fierce verge
#

Hello, Im trying to make a large video screen but even when using the prefab the video quality is really bad. How do I fix this??

#

also tried @cunning mist 's video but still the quality is quite bad even when set to 2160 or 4K

cunning mist
#

I haven't been able to make anything above 1080p work personally, I have no idea how to enforce a higher resolution. It seems to be dependent on your internet connection.

fierce verge
#

I have quite a solid internet connection, but small plane or big plane, 1080p or 2160p its al quite bad 😦

serene moat
#

YTDL maxes out at 720 usually, you can't really get around that if you're using YouTube since YouTube doesn't serve formats compatible with VRC that go above that most of the time. If you host your own 4K video it might work, though you might start lagging people out if the decoder needs to work for it.

fierce verge
#

hmmm, Im trying to make a screen like in the VOLT club, how would I do that then if only 720 works

serene moat
#

VOLT uses YouTube so it has the same resolution limitations

fierce verge
#

hmmmm

#

thanks 🙂

dapper lion
#

try using off shore links such as streamable or vimeo to go over the youtube plugin limitations ( assuming thats what you mean) @fierce verge

fierce verge
#

I will try, thanks!

mighty fjord
#

@pliant spade I believe found a solution to your problem. Though I still firmly believe the best alternative would be to use an animation event.

#

(Had to use LateUpdate since I was already using Update for a thing)

#

Animator setup is just Entry to an Idle state, then if the PlayAnim bool is true, it proceeds to the animation, and then if that bool is false, it just goes back

cunning mist
#

What in the

jaunty schooner
#

Can anyone tell me why this trigger doesn't seem to be respawning the player?

#

The trigger is in the sky and is huge and thick enough that any player hitting it ought to trigger it.

#

And the respawn point is VRCWorld's transform, which is right here:

#

But the script doesn't seem to work at all.

floral dove
#

You've got to double check your variables when dragging and dropping to create them.

jaunty schooner
#

What is Self then? I just assumed Self meant Self.Transform of the VRCWorld object.

void ridge
#

I think they mean this bit?

jaunty schooner
#

Yes, but I meant, what is that Self object? What's it referencing? I click it but it doesn't highlight anything in the heirarchy.

void ridge
#

"Self" in this context is your SkyTrigger object, if I understand correctly

floral dove
#

@jaunty schooner - you want to set that to be the VRC World transform.

#

Right now, your graph will teleport the player to the position and rotation of the Trigger Collider

raven peak
#

By default transform properties in udon will reference the gameobject transform the udonbehaviour is attached to.

jaunty schooner
#

So the skytrigger was teleporting players to the skytrigger? Hmm well, I suppose that location would be hard to tell if it was actually doing anything...

#

@floral dove How about their velocity? This trigger is because the world has the player yeet script. They will be moving fast. Should I instead teleport them below the ground or will the teleport zero their velocity? Or is there a way for me to zero the velocity myself?

raven peak
#

That depends on the player yeet script. If it stops when the player touches the floor it should be ok.

jaunty schooner
#

I have no idea what it does, but I would have just assumed it adds velocity to them and then lets the wind take them where it will.

#

So you're saying a teleport will not zero the velocity for me. So I should probably zero that.

raven peak
#

The script can continuously set the players velocity. If it doesn’t that then setting it to zero will do nothing. Teleporting should set velocity to zero.

jaunty schooner
#

Yeah but I see no reason for it to function that way. If they did that they'd have to like simulate gravity and such, and it would just be so much easier to set their velocity on release.

#

But just in case, since I don't wanna re-upload the world again cause it takes forever, I set it to zero anyway:

void ridge
#

nothin' wrong with a little redundant code once in a while 😛

#

But it sounds to me like this still misses jetdog's point. If you're setting velocity to 0 on that event, the velocity might still get updated (on the next frame?) if the script is still running

#

The only way to be sure what will happen is to know what the script is doing. However, it does sound like a pretty fair guess that it wouldn't be updating velocity continually

jaunty schooner
#

Sure, and I understand that. If the players behave weirdly, I'll check that in that case.

unborn hornet
serene moat
#

Yes other services work for that, but they also cost money to be reliable or store more than a few GB of video.

#

YouTube splits the streams into two different ones for audio and video when you get above 720 and you need to mux them together to have it work, which the video players can't do easily

raven peak
#

There are some youtube videos that send below 720p videos. Not sure what dictates those situations.

#

With avpro you can grab the texture resolution to make sure what it is.

jaunty schooner
#

It just occurred to me that the player velocity couldn't be being reset when I use teleportto, because if it were, then I would not have seen the players hit the collider above the trigger (failsafe) and then continue to slide along it and off into oblivion for a minute or two. So either Jetdog is correct about the yeet script controlling the velocity, or he's incorrect about it resetting the velocity when you teleport a player. I'm kinda inclined to think it's the latter cause it doesn't make a lot of sense for the yeet script to bother simulating movement when setting one variable would do, and it would sort of make sense for VRChat not to reset a player's velocity when they're teleported because there's many cases where you would want that velocity to be retained, like if you were emulating Portal.

#

Anyway I just uploaded a new version of Big City which is the world I have this stuff in, so I guess I'll find out if the teleporter works later this evening when I hop on!

raven peak
#

Im sadly currently away from my pc so i cant check at the moment.

scarlet lake
#

What is udon?

raven peak
serene shale
#

are the mute player cubes working in the UdonExampleScene? testing with multiple clients and the voice falloff doesn't change, fresh scene.

hardy fog
#

Can the master of a world teleport another player if they have that player's id? Or does a player have to teleport themselves?

fiery yoke
#

A player has to teleport themselves

hardy fog
#

Thanks

fiery yoke
#

but you can always send a custom network event to tell them to teleport themselves

hardy fog
#

I only know how to send custom network events to all or master

fiery yoke
#

Yeah that is pretty much the problem

hardy fog
#

I could sent it to all, and then only actually do it if it's the right person.

#

send*

fiery yoke
#

But how do you locally determine the "right" person? :P

hardy fog
#

Lol

#

[Udon_synced]

#

I have an idea, I'll come back if it works/breaks

fiery yoke
#

well mixing synced vars and network events is usually a pretty bad idea...but good luck

hardy fog
#

I ended up sorting a player list from low player id to high, then using the fact that all clients will have the same players at the same indexes of their versions of that list to send players. I generate a random number from 0 to the number of players in lobby, then teleport the host if the host is the client, and the one we're sending. If we are sending the one who is clicking the even I have them teleport themselves. If we are sending a player who is not the client, we broadcast a message to all called send+index of target player in playerList which means we have 12 functions with only a different number at the end of their names. Each function checks if this client's localplayer id is the player id opf the corresponding player in that index of playerlist, then if ithat is true they teleport themselves.

fiery yoke
#

The first part is true until you realize that while sending an event another player could join. An edge case, but it might happen, depending on the frequency.

hardy fog
#

If another player joined while the event was sent, I think it would just add them to the end of the array, and not change the order of the other players

fiery yoke
#

Ohh

#

I meant leave

#

sorry

hardy fog
#

Yes

#

That would break it

#

hahaha

fiery yoke
#

Yeah there is no way to make anything perfect currently. And generally in Networking you have to accept certain uncertainties

hardy fog
#

We could put a counter, and if it is unresolved after trying twelve players, have it generate a new random player

#

Because would it break if they left? I guess it would try to send a message to have them teleport.

#

But they wouldn't get it

fiery yoke
#

No if a player leaves then your ordering gets messed up

hardy fog
#

I'm only calling a function on a player if they hear an event

#

So if they are missing, they just don't hear it

fiery yoke
#

Thats not what Im talking about
Players A B and C are number 1 2 and 3
You want to send a message to player B
So you send message to player 2
Player A disconnects
Now player B is 1 and C is 2
C receives the message because they are player two.
And suddenly you teleported the wrong player.

hardy fog
#

Okay

#

I'll have to think about that error

fiery yoke
#

I have

#

for a while

#

and you cant solve it I think

#

At least not with events alone

hardy fog
#

Well

#

My check is based on the playerId, not their index in the array

#

So they wouldn't have a match with the player we were trying to teleport

fiery yoke
#

Then you need an event for every single id that might ever exist :P

hardy fog
#

Yes

#

Yes

#

Yes

#

Yes

#

12 times

fiery yoke
#

That could potentially go into the hundreds

hardy fog
#

Well no

fiery yoke
#

at least if you want your stuff to not break

hardy fog
#

Because I reference it through the index of the array

#

so I cut it back down to only 12

fiery yoke
#

But thats exactly the problem

#

if you have an index to an array then you need to guarantee that the array locally looks exactly the same from when you send it to the remote when they receive it

#

and that simply isnt possible

hardy fog
#

The random number is array index, but it only resolves if the playerId's match

fiery yoke
#

match to what?

hardy fog
#

Yeah I just sorted it from low to high

#

so it always matchs

fiery yoke
#

Do I have to repeat myself?
If one player leaves in-between sending and receiving the message...then you get a problem

hardy fog
#

I remember that, and I'll watch out for it

#

It might be something I have to live with for now, if it even happens with my system which I don't think it does because no two players should ever have the same playerId

#

I think if someone left and another player was sorted into their element in playerList, the if statement would return false, and nothing would happen. Which would mean I teleport no one.

#

People are having matching player Id's on my local tests. Please tell me that's not true on published worlds lol

fiery yoke
#

Every client that connects should increment the player id

#

maybe that doesnt happen locally not sure

hardy fog
#

On master it works as expected, but on all other clients it lists playerId 1 as playerId 2

#

I'll test on a published version to be sure.

hardy fog
#

It works for all but the first and second players who have the same playerId for some reason.

wooden turtle
#

Anyone know why I can’t create avatar it says no asset bundle has been set

open lion
#

you'll want to ask that in avartars 3.0 gabe

hardy fog
#

To fix the edge case of a player being teleported while they quit, I'll have the master wait for a confirmation from the player that they teleported themselves, then teleport another random player.

fickle swift
wheat rover
#

The only way I found that was consistent was object ownership

sand anchor
#

Does anyone here know the link to the DalekHQ discord server

hardy fog
wheat rover
#

The way I have it is an array of objects that the master will give to players as they join.
To mark them as used I would use a bool array...but we know arrays aren't synced, so I use an int with bitwise operators to encode bools as a bit in the int instead.

#

But, object ownership resets before onleave so clearing it is hard...
my method wound up involving also tracking the ids of the players who own them, locally un-synced, to use to figure out who left.

#

Networking with Udon is hell.

unborn hornet
#

Does OnPlayerJoined run before, after or indeterminately of the player receiving buffered events like ownership updates?

grand temple
#

@wheat rover no, player ID is absolutely consistent between clients. I have complex systems that rely on this.

#

Every player that joins will get a new playerID. It starts at 1 and just keeps going up. It never reuses numbers if someone leaves and rejoins

wheat rover
#

Huh. Well then.

grand temple
#

You can try it out, it's at vrcprefabs.com/browse in the udon section, "simple object pool" it assigns a unique object to every player in the instance

wheat rover
#

Guess my battle is somewhere else with networking then.

grand temple
#

By default, it will give ownership to the player it is assigned to. But there's a much cheaper mode that doesn't transfer ownership if you don't plan to use synced variables. It's great if you need some way to identify players, put them into groups like teams, or do anything interesting with voice range.

hardy fog
#

I can take screenshots of my world assigning multiple users the same playerId

#

Admittedly, it might have been my fault. Although I'm not sure how bad I'd have to mess up to modify a read-only value

grand temple
#

Just do onplayerjoined > debug log player name and player ID

hardy fog
#

Where can you view the debug log while you're playing? Is there a part of the docs that says how to do that?

#

Right. It does unique playerIds for the master client, but for the other players who join it. Well I'll get a screenshot

grand temple
#

There's a series of keys I don't remember, I don't use it. Usually I use the unity editor console because udonsharp has a built in log reader that automatically pulls logs into the console from whatever vrchat instance is running

#

If you're not using udonsharp, you can still add it to your project to get the log reader

#

Just enable it in project settings

hardy fog
#

Thanks, I'll read about logreader. I love udonsharp

#

Helps so much to do it in C# syntax

#

Here's the master's view

#

And the second player's view

#

So when player 2 teleports a player one, they both teleport.

grand temple
#

Wait when you say player ID are you talking about their index in the playerlist? Because yes that's all over the place. I mean vrcplayerapi.playerid

#

It seems like you're just getting two references to the same playerapi. I assume this is an array, how are you populating it?

hardy fog
#

Here's my actual code, too

#

Onjoin and onleft I use VRCPlayerApi.GetPlayers(playerList), then I sort playerList by lowest playerId

#

Oop. I just doxxed myself.

hardy fog
grand temple
#

It sounds like an issue with your sorting but it's too late at night to comb through that lol. What I can say for sure is that you will have a problem with "invalid" playerapis, which are players that have left. If you try to access anything about them, your script will crash. But they won't be null either so the only way you can deal with them is onplayerleft, look through your arrays and set those elements to null. If you just run getplayers again, it will not remove invalid playerapis. Which is why some people opt to just recreate the array from scratch every time a player joins or leaves. Something like

playerList = new vrcplayerapi [vrcplayerapi.playercount];

hardy fog
fiery yoke
#

Well it does

#

sort of

grand temple
#

This is entirely personal preference, but I prefer to avoid getplayers entirely. This is what I use instead, keeping the same array and manually adding and removing players each time

    VRCPlayerApi[] allPlayers = new VRCPlayerApi[80];
    public override void OnPlayerJoined(VRCPlayerApi player)
    {
        for (int i = 0; i < allPlayers.Length; i++)
        {
            if (allPlayers[i] == null)
            {
                allPlayers[i] = player;
                break;
            }
        }
    }
    public override void OnPlayerLeft(VRCPlayerApi player)
    {
        for (int i = 0; i < allPlayers.Length; i++)
        {
            if (allPlayers[i] == player)
            {
                allPlayers[i] = null;
                break;
            }
        }
    }```
#

If you wanted to add sorting logic to this, you could just do a basic insertion sort per element rather than resorting the entire thing every single time

fiery yoke
#

GetPlayers probably only overwrites the elements in the array provided that are necessary. So if you have 4 players and the last player leaves it will write the first three elements of that array, but the last element will still be written to from last time. If this is the case then you should only get an invalid playerapi if the last player that joined left, and if any other player left, the last player should exist twice.
Just my speculation tho.

#

If that is the case then writing null to index of playercount should fix that

grand temple
#

That sounds correct, but also jank like that is why I don't bother with getplayers haha

fiery yoke
#

Well the intention was to avoid allocations

#

which youre not doing when you create a new array every time

#

The question is: Does it really matter...

grand temple
#

Yeah I can see why they didn't make a method that returned a new array every time, it's better but also if they're not clearing the null elements that's problematic

hardy fog
#

When I do it, I'll keep the same array and just assign/remove players from it

fiery yoke
#

Well you cant do that easily

grand temple
#

Why not? That's what the code I just posted does

fiery yoke
#

The best algorithm for that is "null gapping" which just searches for the first null element

#

Worst case the lobby is full and one player leaves and reconnects constantly

#

in which case you have to search the entire array from start to end every time

#

ofcourse in this use case thats neglectable

grand temple
#

That's a whole lot cheaper than re-assigning the entire array every time

fiery yoke
#

Yeah. Just saying that its not a solution that will work in all circumstances.

#

But probably most

#

Especially in Udon

#

And also that will completely jumble which player joined when

#

So if that is important then you need another method

grand temple
#

If you need sorting, you add an insertion sort to that. If you need cheap, that's already cheapest. Not sure what situation it wouldn't be best in

wheat rover
#

That code you posted will also fail to track any players that joined before you.

fiery yoke
#

No it doesnt

grand temple
#

No, when you join you get spammed with a bunch of onplayerjoined

fiery yoke
#

thats the lovely part about OnPlayerJoined

#

Since from your view everyone is joining you

#

As there is no "host"

wheat rover
#

Oh.
That's kinda stupid honestly

fiery yoke
#

Its actually not

#

Youre not joining someone

wheat rover
#

You are joining a lobby, though.

fiery yoke
#

There is no lobby

#

Matrix quote

wheat rover
#

Yes, there is a lobby.
The lack of a central host doesn't mean there's no lobby...

fiery yoke
#

VRChat works on a P2P-based system

#

Everyone is connected to everyone through a middle man

grand temple
#

You still need to instantiate their player objects in your client. At some point, you need to receive the message that they exist. And that message is onplayerjoined. Maybe that's not the best name, but it is very useful to what is actually happening

fiery yoke
#

I think its a good name

wheat rover
#

OnPlayerStart would make more sense as a name than OnPlayerJoined then. Oh well.

fiery yoke
#

The player joins your view of the world

#

In fact

#

you can join an instance without other players joining you. In case they are on a different branch.

#

You will technically still be connected to the same instance over photon, but you wont receive any of the player controlled data.

#

Since you are on different network builds

verbal socket
#

Is there somewhere a code i can copy paste for a udon code for playing a viseme anim when a button is pressed and when its pressed again the anim is played in reverse

#

@me when answering

compact stirrup
#

I have made an udon behavior and inside the behavior I have a non-public bool variable. I've set the default value to true, but when I repoen the variable file, it sets the default value back to false, this is incredibly frustrating and I've had it happen multiple times, with script variables, and also boolean node boxes inside the script logic itself, anyone else experience this?

#

it's also not saving my preference of sync type either, reverting back to none

fickle swift
#

I dont know what I'm doing wrong. But I'm trying to set the Voice audio of a single player to be heard by everyone in the world not that large. But for some reason its not working

#

It doesnt seem to be doing anything and you can only hear them at the default distance

cunning mist
#

While I haven't played around with this system much myself, you'll likely have to set it up to be global, as right now the system is just telling you to play your own voice further. As to how you would network that I'm not experienced in getting a player variable globally.

verbal socket
#

why do my reflection probes turn black when i bake em ?

unborn hornet
#

Damn, how does one escape backticks...

#

Got it. wew

normal yarrow
#

Hey there, so I'm trying to play a YouTube video on the VRC Unity Video Player component, but I notice it doesn't play at all when the map loads.

#

Anyone know what might be wrong?

fickle swift
normal yarrow
#

It won't play YouTube URLs but videos from self-hosted sites seem to work.

dapper lion
#

@normal yarrow seems fine, have you tried using the example prefab in the vrcsdk examples folder?

normal yarrow
#

Yes

dapper lion
#

hmm, tried other video links?

normal yarrow
#

I noticed these errors

dapper lion
#

it may be a url that is blocked or requires payment to watch

#

try a different url and see if work

normal yarrow
#

Hm.. tried a different one and got the same result.

dapper lion
#

same errors too?

normal yarrow
#

Yep

dapper lion
#

and youve uploaded this world to vrc and got the same problem? (just making sure if it needs the server or not)

normal yarrow
#

I've done build tests and it didn't play there.

dapper lion
#

well usually what ive seen causes it to not play is because it needs the server to pull from, but testing and playing it in unity will obviously not pull from a server

#

so if it works when its uploaded, then that was the problem, if not. it may be either the link or the video player not pulling anything at all

normal yarrow
#

It's weird cause I can pull and play videos from my own site (server hosted elsewhere)

dapper lion
normal yarrow
#

I would but videos won't stay there forever.

dapper lion
#

with the same video, if its less then 10, you can just convert

serene moat
#

YouTubeDL does not exist in the editor, so you cannot resolve any URL's that are not direct links to the files

dapper lion
#

streamable links stay for 6 months

normal yarrow
#

Ahh

dapper lion
#

that is correct as well

normal yarrow
#

Is there a way to incorporate it to the editor? 🤔

dapper lion
#

unless you have the plugin in unity

serene moat
#

For VRC, yes if they wanted to. For you, probably not easily without breaking TOS.

normal yarrow
#

Hm.. so I got no way to really test this on editor.

#

That's unfortunate.

#

Oh well, guess I'll have to host it off my site.

dapper lion
#

well i mean you could test if th uploaded world method works

normal yarrow
#

I could do that but it would take forever just to test one video.

serene shale
#

this error even shows with merlin's video player after filling out the playlist url field for that reason, works fine ingame :P

fickle swift
olive sphinx
#

I'm following the tutorial for running the UdonExampleScene. The VRChat client is not launching when I press "Build and Test"

normal yarrow
#

I notice that this doesn't seem to work in VRChat, is there a way I can have music have reverb to them?

dapper lion
#

@normal yarrow you need a zone

normal yarrow
#

A zone? Hm..

dapper lion
#

and make sure it has "audio listener"

normal yarrow
#

Alright.

#

How do I properly set up the min and max values?

#

Do I just max it all the way around the whole map?

dapper lion
#

for areal?

#

for the whole map, just leave it normal without the sudio source

normal yarrow
dapper lion
#

you also need the filter

normal yarrow
#

Got it now

dapper lion
#

you need both if its for player audio and off shore audio

normal yarrow
#

Gotcha.

#

Actually, I only want the entrance music reverberated.

dapper lion
#

then move the zone by the entrance

normal yarrow
#

(And microphone speaking, but I can't seem to get that done right now since VRC_PlayerAudioOverride doesn't exist for Udon)

#

Oh wait, so does this zone only need to go over the audio source object?

olive sphinx
#

Well it works now using Steam. VRChat client would not launch with Viveport.

dapper lion
#

it needs an audio source, from what ive see, and override should work

normal yarrow
#

I can't even find that script.

#

I think they took it out.

dapper lion
#

? ive never used the script, just the traditional unity way of doin it

normal yarrow
#

Ah

dapper lion
#

add the audio listener to the cam, and bend it to your will via that

normal yarrow
dapper lion
#

ahhhh, yes, i belive it still works

normal yarrow
#

I was gonna use this so that if you're holding a microphone, your voice will project throughout the whole arena, and also therefore reverberate since it would come from the same audio source as the entrance music (ideally),

dapper lion
#

so it was added, i see what you mean now

normal yarrow
#

Or at least an audio source right next to it.

dapper lion
#

lemme send you something you can tinker with

normal yarrow
#

Sure thing.

dapper lion
#

you have messaging blocked

#

but theres a player audio chnger called " better player audio" and it works with udon, its worked for me for worlds i needed players to be heard accross the room (very big rooms)

normal yarrow
#

Oh wait

#

Let me fix that

#

Alright go ahead

void ridge
#

I have two questions and a report

#
  1. What units are velocity measured in?
  2. Is there documentation where I could have just looked up the answer to that, and the answers to other specific questions about nodes
normal yarrow
#

Oh hey Joker, lol

void ridge
#

Hey Pablos!

normal yarrow
#

Nice seeing ya here 👍🏽

void ridge
#

I see you're still making wrestling stuff 😄

normal yarrow
#

Haha yep.

#

Wish I could've gone this far in Rec Room though.

void ridge
#

🤷‍♀️ do whatcha gotta do

normal yarrow
#

Yep

#

I'm learning a lot about Unity with this though.

void ridge
#

yeah, learning Unity is why I'm here too 😄

normal yarrow
#

It's definitely worth it.

void ridge
#

anyway, let's save the chatting for in-game, I'll DM you my profile-- Back to on-topic:

I have two questions and a report

  1. What units are velocity measured in?
  2. Is there documentation where I could have just looked up the answer to that, and the answers to other specific questions about nodes
normal yarrow
#

Sure thing.

void ridge
void ridge
#

Hmm ok, this kind of answers me

A velocity in Unity is units per second. The units are often thought of as metres but could be millimetres or light years. Unity velocity also has the speed in X, Y, and Z defining the direction.
But I think to be precise the answer would have to be specific to VRChat, right?

normal yarrow
#

Not really.

#

It's mostly Unity stuff.

void ridge
#

Same with my more general question about docs. A lot of the particulars about nodes in Udon are going to be unique to VRChat, aren't they?

normal yarrow
#

I think so, but I haven't screwed too much with Udon stuff yet.

grand temple
#

Anything related to players and networking will be vrchat specific, yes. But rigidbodies, transforms, rendering, that's all unity

normal yarrow
#

Well there ya go

trail shard
#

how does the gun grip work for pickups?

grand temple
#

You will hold it with x forward and z up

trail shard
#

also hi phase lol

#

mine kinda freaks out I'm not sure, what do I need to do to set the actual location of where the grip is?

dapper lion
#

gun grip also does not allow you to turn it in desktop

grand temple
#

Assign an empty gameobject to the gun slot in the pickup

trail shard
#

and then just move it to the grip?

grand temple
#

Yeah

#

And rotate it so that x is forward and z is up

void ridge
#

I'm using a trigger collider to add some velocity, and it seems inconsistent. Sometimes it adds, sometimes it doesn't. Anyone offer insight why?

trail shard
#

I rotate it on the x axis -90 degrees to get the z axis facing up and x is still forward correct?

grand temple
#

Setvelocity is very unreliable if the player is grounded and the value you're setting is low. It might be more reliable if you set 10 or if you try setting velocity every frame until the player is ungrounded

#

Normally z axis is forward but if you're coming from another program like blender that entire concept is thrown out the window so I have no idea what the forward axis of your particular model is

unborn hornet
trail shard
#

ayy got it thank you phase

dapper lion
#

@unborn hornet i saw on their thing it said 6 months, i must be going crazy then

void ridge
unborn hornet
dapper lion
#

guess i was crazy

grand temple
#

If you have the player, it's just a property, is grounded

void ridge
#

It seems like OnPlayerTriggerStay will be using more CPU time 🤔 am I right to think that?

#

It's checking the state of every player that's colliding, every frame, right? So at some large scale (lots of players, frequent collisions), could this be adding up to perf loss?

celest olive
#

Uh what do I need to make an interact-able button? I tried using a vrcpickup component with pickuppable turned off, and - as I peeked into a Vowgan video out of frustration - without literally anything but a UdonBehaviour that does have an Interact-Event in it's script.

#

Really just this little black cube object there. Click it, get stuff to happen.

unborn hornet
void ridge
#

Right, so wouldn't OnPlayerTriggerEnter cost less CPU?

normal yarrow
#

I'm trying to figure out how to swap a Render Texture to a different one, and I'm new to Udon, oof.

normal yarrow
void ridge
#

Enough less that I should keep that in mind, or am I just being obsessive? 😛

normal yarrow
unborn hornet
#

Down side is that there are rare conditions when lag may occur which a player might pass through the trigger without having a frame of being registered as being within the trigger zone. So take care to be sure that the zone is large enough for your use case.

#

(though that applies to trigger zones in general, just a head up tip mostly)

unborn hornet
celest olive
#

Uh evidently I did the big dumb and didn't link up the script.... sorry for the premature and unprofessional intrusion? :x

normal yarrow
#

Okay I cleaned it up a little bit. Anyone know how I can achieve swapping render textures through a toggle button?

unborn hornet
unborn hornet
normal yarrow
#

Alrighty.

#

Okay, I concede that I have no idea what I'm doing.

fickle swift
dapper lion
normal yarrow
#

Okay, so I got this to disable the sprite and animation, however, I notice that it only resumes the animation and doesn't restart (it does restart when I manually disable/enable the animator in the editor)

#

@unborn hornet

normal yarrow
#

Ok nevermind I just disabled the whole gameobject and that works instead.

slim hound
#

@void ridge If you don't want to use OnPlayerTriggerStay you could do this

#

Teleports the player up a tiny amount before applying the velocity so being grounded isn't an issue

solid apex
#

I want to know how to make a simple time delay , anyone can help me ?

fiery yoke
# solid apex I want to know how to make a simple time delay , anyone can help me ?

Since Udon runs on the main thread synchronously you have to test a condition every frame.
The best solution is to have a boolean and a "EndTime" float variable that you set to Time.time + delay.
Then in Update you test if the boolean is set to true and if Time.time > EndTime and if so set the boolean to false and trigger your stuff.

verbal socket
#

ok is there a place where i can dl udon code thingies ?

#

i kinda want one that toggles between animations i made...

#

door open / close

#

i have no clue what so fucking ever on how to do anything

void ridge
tawdry surge
#

Probably been answered multiple times before, but I don't know how to search for it: Are there already Udon prefabs that mimic all the triggers available in SDK2? I'd like to upload a world I bought from booth on SDK3 in order to future proof and save time later. Plus I could dissect the prefabs to start learning Udon while being able to have my world made public in a timely manner.

raven peak
#

This also shows the node equivalent for the sdk2 triggers. https://ask.vrchat.com/t/vrc-triggers-udon/196/3

verbal socket
#

@void ridge i kinda have no clue how to do ANY thing in the udon graph

#

and he just shows "its this"

#

and some of the things he has i cant get for some reason

dapper lion
#

@verbal socket what you need?

verbal socket
#

a udon graph where when a button is pressed an animation plays

#

for opening / closing a door

dapper lion
#

sorry bud, dont have something like that

raven peak
#

@verbal socket you want something like a bool variable in the animator to switch between the two animations. then you would use the Animator.SetBool to make it open and close.

dusk lintel
#

PC build but every time I upload it says it must be under 50 Megs....

bleak widget
#

Is there an easy way to locally sync a variable across alike udon scripts?

fiery yoke
#

The simpler way is having a shared reference to a common data container. Otherwise you have to set it on all of them individually.

bleak widget
#

Yup that is just what I was going to do next. I was just wondering if there was an alternative method that was built in to do that. Thank you ^-^

void ridge
#

Checking my understanding on this: is this the best way to handle gravity for a World? This is the graph component of my VRCWorld object. I just added on a Set Gravity node.

#

Or is there some better designed way for handling "global" gravity? Maybe something that's referenced for objects, too?

raven peak
#

that just sets the players gravity.

void ridge
#

Right, so do I have to also set the default gravity for objects somewhere, in a similar way? Or is there some more central place where gravity is controlled

spring moss
#

Is there a way to force avatars on players upon world entry? Or maybe the player has to be standing on a player square and their avatar is force changed before the game starts.

raven peak
fiery yoke
#

Jinx!

void ridge
#

So is that a yes? Or are you just saying, this is how I change gravity for objects

#

And I still have to do them separately

raven peak
#

its for the whole scene just have to do it once.

void ridge
#

OK, because players count as rigidbodies?

fiery yoke
#

Well...

raven peak
#

only when not grounded.

fiery yoke
#

Welcome to VRChat development. Players are weird. Especially when it comes to physics interactions.

raven peak
#

im not sure why discord keeps trying to reply when im not wanting to. rip

void ridge
bleak widget
#

They change from rigidbodys to non rigidbodys?

raven peak
#

vrc uses the rigidbody for gravity when the user is falling/not grounded. when you are walking on the floor you dont need that on so they probably set it to kinematic.

#

for force avatar stuff you can call the setavataruse on a pedestal during the start event but players can just switch back after. and most people will stop visiting your world.

#

people like using their own avatars.

fiery yoke
#

Mostly because you cant temporarily set an avatar or restore their one

void ridge
#

Is there a way to read what avatar someone is using?

#

In such a way that you could enforce certain conditions if they are/are not wearing a certain avatar?

raven peak
#

not directly. there might be some funky work around but nothing reliable.

fiery yoke
#

Users avatars and your world should be as seperated as can be

void ridge
#

Maybe just a height range? I know in Laserdome they want a height range. I assume they just use the honor system, which kinda sucks

fiery yoke
#

You can somewhat calculate a rough estimate but its kinda jank

void ridge
#

How separated avatars are from World is a design question, seems to me it should be up to the designer 🤷‍♀️

raven peak
#

you can get information about avatar bone positions and rotation. laserdone requires a specific setup due to this.

compact stirrup
#

on the subject of jank, is there a system for me to determine who pushed a button in Udon? Like if I have a udon behavior on a button, is there a way for me to get the vrcPlayerApi of the person who pushed it?

fiery yoke
raven peak
compact stirrup
#

I have a button near spawn that when pushed, sets immoblize to false

#

that, or I have to use a particle effect and I'd really rather not do that

raven peak
#

immobilize can only be set by the local player. not sure why you would need to know who pressed it.

compact stirrup
#

no, you can set it via script

#

I need a button to re-mobilize someone who got immobilized

#

unless there's a manual command in-game? let me look at that...

void ridge
#

If I'm setting Physics.gravity, when should I do it? Is there a good/conventional spot for "instance initialization" stuff?

raven peak
#

other then a networked variable to target that player there is not really a easy way to do that at the moment. for freeze tag i have each user own a object then send a networkevent to the owner to freeze and unfreeze.

raven peak
void ridge
#

For now, not changing. Where is Start? I see it in the VRCWorld graph, but is that called every time a player connects?

compact stirrup
#

there's an onplayerjoin trigger event I think?

raven peak
#

it the first event that gets called when loading into the world. its local.

mighty fjord
#

Are there any known issues with audio sources looping despite them not being supposed to?

void ridge
#

OK. So maybe this is a deeper misunderstanding I have. Physics.gravity has to be set locally for every player that joins, even though it's referenced for stuff that isn't that player, like objects and other players?

#

And is this how all variables work?

raven peak
#

im trying to think how to explain this simply cause this opens up a large can of worms.

bleak widget
#

Do udon variables need to be public in order to be read from another udon script? I would assume this would need to be the case for proper scoping

raven peak
raven peak
void ridge
#

OK, hopefully the last question I have about gravity for now. How does Physics.gravity interact with VRCPlayerApi.SetGravityStrength? Will one of them override the other if set?

raven peak
#

ive not messed with both at the same time but my assumption is the players gravity is physics.gravity * vrcplayerapi.gravitystrength.

void ridge
#

Right, multiplication, got it

#

That was my guess too

raven peak
#

in a old world in sdk2 i reversed the gravity so players would walk on the ceiling.

forest mica
#

That’s cool

raven peak
#

it should still be public was called no floor chat.

void ridge
#

(thank you for your help jet)

timber ridge
#

I need help with my vrchat framerate,it is super stuttery. I can play the game but the frame rate makes it unbearable,i tried looking for answers by watching videos and searching on google and reddit but nothing seemed to work.i tried lowering my resolution and still nothing changed. Please help

void ridge
#

How do I change graphics settings for VRChat?
Holding down Shift while launching VRChat will bring up a configuration menu where you can adjust the graphics quality. Additionally, you may want to consider using the Minimum Performance Rank Display system and Dynamic Bone Limiter systems, available as a button in the top-right in the Safety tab of your menu.

bleak widget
normal yarrow
#

Okay, so I made a system to toggle an entrance tron, however, I need to now (somehow) get the one video player I have to toggle visibility, load a pre-determined URL, and play the video. When that gets disabled, it should stop the video and then disable visibility.

normal yarrow
#

This setup doesn't seem to be working at all.

hardy fog
normal yarrow
#

🤔

raven peak
# normal yarrow

do you have allow untrusted urls on? and you probably want playurl instead of load url. the video hasn't loaded when you are doing play. playurl will auto start it when it loads.

normal yarrow
#

I'm doing this in the editor

raven peak
#

are you using the unity or avpro video player then?

normal yarrow
#

Unity Player

raven peak
#

the playurl should fix it for editor. if not they i would try a test build to see if it works.

normal yarrow
#

I notice the URL doesn't even go in here.

raven peak
#

might not be working right in editor.

normal yarrow
#

I'll do a build test and see if it works there.

raven peak
#

when it comes to vrc components i dont trust the editor for testing.

normal yarrow
#

Hm.. no, it doesn't play in the build test either.

#

The other tron graphics do play though (but that's because those are animated spritesheets because video player limitations)

raven peak
#

you can put in a debug.log to see if the right methods are being called.

normal yarrow
#

Where can I find that?

raven peak
#

unityengine.debug.log

#

it can print a string to your console.

normal yarrow
#

Ohh

#

wait

#

Yeah

#

I see what you mean now, lol.

#

Ok for some reason now my mouse is automatically dragging the udon graph screen, oof.

#

Gonna relaunch Unity

#

Okay where do I attach the log to?

raven peak
#

i would put it in front of the stop method and playurl method. then you can attach a constant string to the log obj to print which one is being called. this is to make sure that things are firing correctly in the code.

normal yarrow
raven peak
#

ya that works. then you could put "should play url" for the string.

normal yarrow
#

Welp, nothing happened.

#

Also for some reason when I press the button, the editor game just pauses itself.

raven peak
#

looks like you have an error causing the problem. click the red icon on the top right of the image.

tawdry surge
normal yarrow
raven peak
#

im assuming you have the video player referenced.

normal yarrow
#

Yeah.

#

MainTron would be it.

raven peak
#

why do you have them set to synced?

normal yarrow
#

So that everyone can see the trons change.

raven peak
#

thats not how that works.

normal yarrow
#

oh

raven peak
#

that is for syncing variable values like ints and floats.

normal yarrow
#

Oh I see

raven peak
normal yarrow
#

Was the syncing causing the issue?

raven peak
#

i wouldn't think so but maybe.

normal yarrow
#

Okay I confirmed it's not.

raven peak
#

ya but it should work fine.

normal yarrow
#

For whatever reason, it isn't.

raven peak
#

I want to say its the editor not playing nice but you were having problems in game as well.

normal yarrow
#

Yeah

#

And I know the video URL itself does play in-editor.

raven peak
#

the editor could not be playing nice with the component but when you did a test build the sync variables broke it.

#

could try another test build.

#

do you know how to open the debug log?

normal yarrow
#

I check the console?

raven peak
#

for vrc.

normal yarrow
#

No

raven peak
#

in launch options.

#

then you can press "Rshift+`+3"

normal yarrow
#

That opens it up?

raven peak
#

ya

normal yarrow
#

Nice

raven peak
#

you will be able to see the debug.log message and if there is a error.

normal yarrow
#

Welp, same thing happens.

scarlet lake
#

not really a question specifically about udon but i want to create a small forest scene and have the foliage sway to simulate wind. how would i go about doing that?

raven peak
normal yarrow
#

😔

raven peak
normal yarrow
#

I have it as a child to an empty that gets toggled as enabled/disabled

#

So all the trons get enabled/disabled together.

raven peak
#

that might be the cause. if you are calling the events before the component gets initialized could cause the problem.

normal yarrow
#

Ooh

#

Hm...

#

Is there a way I can delay the playURL command?

raven peak
#

i would personally keep it outside of the objects being turned on and off. then you just say to play and stop when you turn on and off the objects.

normal yarrow
#

Ahh I see.

#

I'm really new to all of this so I would have no idea how to set that up.

raven peak
#

would basically what you have now but you drag it out of the empty parent that is being toggled.

normal yarrow
#

Ohhh I see

#

The only thing is, the reason why I have it disabled is because I have a picture that would be there if no video is playing.

raven peak
#

you can separate the screen and the video player. so the screen would still be with everything but the video player component would be out.

normal yarrow
#

Ahh I see

#

I see what you mean now

scarlet lake
#

do we know when sync animation will be available ?

normal yarrow
#

Welp, yep, that worked.

#

Hm, now I need to figure out how to change the default color of the video screen to be black instead of white.

scarlet lake
#

also i noticed that my mirror/avatar toggles, etc dont have the blue laser anymore when u point at it. is that just how it works with udon worlds now or did i forget something

tawdry surge
#

Just a shot in the dark, since I know it's something I'd need to work my way up to attempting, but if I wanted to have a system that can save a players progress in a long duration RPG world into a code that you could copy/paste into a UI bar.. I saw something hinting at that idea, but is this possible without causing excess overhead?

#

I know I'd probably have to set points that the system would save and generate some numbers for.

#

But ideally, it'd be something random so people couldn't just cheat their way through if they figured out the pattern.

raven peak
raven peak
tawdry surge
#

You think it could still randomly generate the "progression code" so that they'll be unique but still functional?

raven peak
#

two ways could do it. based on the users display name it could jumble the code but it will break if the user change their name. you could also just make a encoder to make it harder to read.

tawdry surge
#

OH! I forgot about seeing the world being able to read usernames!

raven peak
#

it cant be completely random cause you need to know how to decode it.

tawdry surge
#

That's a good idea.

#

It breaking if they change usernames isn't of too much consequence.

#

Thank you!

rancid cedar
#

So i have a pickup item that's only changes client side, is there an easy way to make it server synced?

rancid cedar
#

Is that a default script I assume?

#

because i was just using VRC_Pickup to make it

raven peak
#

its provided by vrchat's sdk.

rancid cedar
#

ah i see, its just an option to check when you add a behavior

#

dope, thank you

normal yarrow
#

Okay so toggling it off starts the video over again, oof.

raven peak
#

yes cause you are telling it to stop. you would need to pause it then play when you turn it back on.

normal yarrow
#

Right but I want it to restart when toggled back on.

raven peak
#

im not sure what you are wanting then.

normal yarrow
#

Basically toggle button to start the trons and the video, toggle it again to turn it off and reset it to the default tron pictures.

raven peak
#

ya that can get a bit tricky with the unity player.

normal yarrow
#

The giant screen would display the video player stuff

fresh elbow
#

does anyone know why i'm getting this error?

#

using the c# extension for udon

raven peak
normal yarrow
#

It already goes to a render texture.

raven peak
#

might need to try the udonsharp discord.

#

no no no no that is a bad way of doing it.

normal yarrow
#

oof

dapper lion
#

thats terrifying

normal yarrow
#

...yeah

raven peak
#

you dont need the camera you can do it directly.

normal yarrow
fresh elbow
#

ill try there

normal yarrow
#

Well, the entrance tron spritesheets are animated, so those needed to be spritesheets.

fresh elbow
#

uh

#

anyone got a link to that

raven peak
#

there should be a link on the github.

fresh elbow
#

ah yeah, couldnt find it on github, but found it another place

#

ty

raven peak
normal yarrow
#

Okay well if now the video player is going directly to the render texture, I now need it programmed to show that RAW logo when no video is playing to the render texture.

#

What do you mean?

raven peak
#

you are using a camera for the spritesheet animation. why not just apply the material to the objects you want to have it on?

normal yarrow
#

It doesn't look right when I directly put the spritesheet on the material.

raven peak
#

you need a sprite sheet shader. who are you doing it for the camera?

normal yarrow
#

If I use a sprite sheet shader, the emission goes bye bye.

#

And I need that emission to make them look like lit up LED boards.

raven peak
#

another option is code the tiling and offsets to animate them.

#

a custom shader would be better but im assuming you dont know how to make one.

normal yarrow
#

I do not.

raven peak
#

the cameras are going to hinder performance a bit is the problem.

normal yarrow
#

oh

#

Welp

#

I wonder if this will work

chilly crater
#

Is there a way to change your avatar without the VRC avatar pedestal?

#

Like you click a gameobject and it swaps?

normal yarrow
#

Ahah! I figured out the video restarting issue.

#

😎

#

Makes way more sense now that I look at it. @raven peak

raven peak
#

👍

normal yarrow
#

Now I need to get the default video screen color to be black.

chilly crater
#

BlueprintID? Isn't that savefile scumming?

#

Upload with a file, and then try to upload the world again with a previous version of the same file?

#

I'm not sure.

normal yarrow
#

Hm, so I noticed that the trons only play locally.

#

oof

#

Pretty much, yeah.

scarlet lake
#

I want to create a virtual barber shop world where anybody could sculpt custom hair grooms. I wanted to export them as FBX but there seems to be no way of using local / remote storage from udon. I noticed that in VKet you can have a button that pops up a browser window for a specified URL. Is this functionality accessible through UDON?

dapper lion
#

bro that is illegal my friend

#

same thing with 360 video players currently

#

@scarlet lake best thing you could for that feature is just putting a link in a type spot, and set it to copy

#

otherwise youd be heading towards the "no, dont" town

normal yarrow
#

wah?

scarlet lake
#

thanks! @dapper lion . i suspected that was VKet specific feature. I know there is no way of calling REST api from udon but through that button i could encode a fair amount of data in url itself. and then convert to downloadable FBX on server. sadly, having a copyable text field seems to be the only way to transfer data from VRC into real world.

dapper lion
#

correct, but yo can technically make a copyurl thing ive seen others do and the user just simply pastes in the link

scarlet lake
#

that seems like the best option. ill google how to do that

raven peak
normal yarrow
#

I see.

#

The other trons that were just spritesheets also didn't pop up either on the other client.

viscid reef
rancid cedar
#

any way to set the velocity of a game object using udon? I know there is bust i just dont know what the node might be called lol

fiery yoke
#

What makes a GameObject move? The Rigidbody Component. So its a property of the Rigidbody. (Rigidbody.linearVelocity)

rancid cedar
#

how exactly would i go about getting a reference to the rigidbody of another game object in the scene? Basically im using a button to teleport and reset the velocity of something that's floating in space

#

you can't drag a rigidbody into a public variable, and I couldn't seem to find a way to dig into a GameObject to find its rigidbody like you might do in unreal or something

#

but its possible i just don't know the right node or something

chilly crater
#

I still can't figure out why people can't pickup certain items in my world.

native estuary
#

That happens most commonly when you have multiple pipeline manager components in the scene (searching with t:pipelinemanager in hierarchy finds them)

You can also import this and check VRWorld Toolkit > World Debugger if you are having trouble finding them
https://github.com/oneVR/VRWorldToolkit/releases

rancid cedar
#

ah nvm, i forgot about GameObject.getComponent

native estuary
chilly crater
#

No triggers, just a button

#

I can pick them up just fine

#

But other people can't.

#

Non-masters?

#

They render, other people can see me shoot them AND their projectiles. They just can't pick them up.

native estuary
#

And they aren't on desktop vs vr or something?

chilly crater
#

They are on VR

#

White balls are the guns, colored balls are the respawn buttons

native estuary
#

Are you on desktop?

chilly crater
#

Yes

native estuary
#

Well that could still be some big area collider trigger you have in the world

chilly crater
#

There are no area colliders.

#

the pickup is on an empty... Is that bad?

native estuary
#

Empty?

chilly crater
#

I created an empty

#

The mesh, grip, and spawnpoint are parented to it. The empty has the pickup script and udon script, rigidbody and whatnot

native estuary
#

Shouldn't really change much as long as you have the collider and vrc pickup on the same object

#

I mean your picture looks alright and since you don't have any trigger collider I can't think of any other causes really

chilly crater
#

I can pick it up when I test build with two clients

native estuary
#

Well both of those are desktop users so to be expectes

chilly crater
#

I can't exactly test it since I don't have VR. This is meh.

#

Can something be too small for VR?

native estuary
#

I mean most likely but that doesn't seem too small

chilly crater
#

I moved the buttons and the whole table up some

#

AND doubled their size. Now to upload and drag a friend with VR into it.

chilly crater
#

Yeah, it was the size of the snowballs.

#

VR apparently doesn't like things that are too small

mild fern
#

i think i am dumb cause all of a sudden all of my objects that i had sync posistion on for my worlds are being hella weird

#

and not working

#

did i miss an update?

normal yarrow
#

I just realized that the reverb is applied to every audio source, oof

normal yarrow
#

Any way to fix that?

void ridge
#

I want to generate a bunch of random values when an instance is first loaded, and keep them synced for everybody so long as the instance continues to exist. The closest answer I've found is this:
https://ask.vrchat.com/t/getting-instance-id/501/5

#

I know how to generate a random values. What I don't know is how to do them as part of "initialization," such that it only needs to happen once.

#

I think I'm just still lacking the basic understanding of when and how to synchronize data. If there's a good guide for that I'd love to see it

cunning mist
#

Have all the values be set in start, but only if you're the object owner. So essentially...

private void Start()
{
    if(Networking.IsOwner())
    {
        Synced Value = Random Value or whatever;
    }
}```
#

@void ridge

#

For synced variables, the person who owns the object is the only player who can even modify the values of synced variables.

void ridge
#

Thanks for being the person who answers on Christmas Vowgan 😄

cunning mist
#

I wrote that in U#, just imagine the first If statement is just a branch

#

No worries, just hopped on my phone for a minute lol

void ridge
#

yeah, I think I get the jist, though I haven't used U# and have only learned a tiny bit of c#

#

I'm still sort of confused by this

#

I think I get that udon behaviors are always attached to objects. And I understand that networking is peer-to-peer and objects have owners on the network. But why limiting something like this by owner equates to initialization of an instance? Seems super weird to me

#

I'm also not totally up to speed on how Start works, but I can find docs for that part.

cunning mist
#

Synced values are set to anyone, so only one person needs to set them. Start also only fires the first time that the object exists, so you don't need to worry about it happening more than once.

void ridge
#

Start also only fires the first time that the object exists
define 'exists' 😂

cunning mist
#

The first time the object thinks about itself, essentially. Technically it happens about one second after the world loads, but it never happens again unless you've spawned in that object again, then again synced variables don't function on instantiated objects as you can't network instantiate, so that's an entirely different thing.

raven peak
#

Do you know about execution order joker?

void ridge
#

Yes, execution order I understand

#

execution flows start with an Event, and anything that needs to operate on memory fires one at a time, in a pre-defined order. In Udon, that order is controlled by the in/out execution ports. And Block nodes are special and weird and I'm not sure why they're not redundant 🤔

raven peak
cunning mist
#

Ah you already grabbed it

raven peak
#

Its the order of events that happen per frame.

void ridge
#

Right, got that

cunning mist
#

Block nodes are a bit funky, but they're important for wanting to do multiple Branch checks in the same event without relying on it being true or false to lead into it.

void ridge
#

I can respect funky.

#

Start is only ever called once for a given script.
This I understand. I think what I'm missing is deeper, meaning, when does a script run and what causes that?

cunning mist
#

When the script runs is dependent on the event being called. Update/LateUpdate happens once a frame. Start happens as soon as it exists. OnEnable happens whenever you enable the object, and the inverse with OnDisable. Interact happens when you click it, so on and so on.

void ridge
#

OK, so for an object that is included as part of the initial state of a scene (i.e. not spawned in at any point), Start fires when the first user loads the scene.

#

And then it doesn't fire ever again (unless it's de-spawned and spawned again)

raven peak
#

The event start gets called once locally for everyone when the scene first loads up.

#

All events are local unless you send a network event to have everyone do the event.

void ridge
#

OK, that's what I was afraid of. So if I'm using Start to generate a random number, then without something more, it sounds like it's going to try to generate a new number each time someone loads in. But that can't be right.

raven peak
#

That is where the ownership check comes in.

#

When a new instance is created there will be a master of the instance (first person in there). They will have ownership of the generator so on start they will generate the number. Then using a synced variable when new people join will get the value of that variable.

cunning mist
#

Right, only the person who owns the object can even set it, so having a branch check Networking.IsOwner before you set those values will give you identical values for everyone.

void ridge
#

What about ownership transfer? Is it just that there exists no possible scenario when a user is first given ownership of an object and then executes Start?

#

other than the scenario of instance creation, i.e. initialization

raven peak
#

What are you trying to do? That would require you to take ownership then do the start event?

void ridge
#

Oh, no, I don't want that. That just sounds like the thing that we need never to happen.

#

I want to generate a random number when an instance starts, an then keep that number in existence and synced for all users who may join, until the instance closes.

raven peak
#

Have a synced variable this will be the random number to sync. On start have a branch with the network.isowner as the condition. The set the number to something random if true.

void ridge
#

What I'm hoping is implied in Vowgan's solution is: when the master player leaves and ownership of the generator object is transferred to a new master, that new master couldn't ever go "I own this now, and I'm gonna fire Start"

raven peak
#

nope will be fine.

cunning mist
#

No new players will ever on-join become the owner of the object. Even if you literally set them in Start to be the owner, ownership transfer takes a frame and can only be acted on during the next frame.

#

Yeah you'll be fine.

raven peak
#

As long as there is a person in the world with the synced value it will be the same for everyone. The only time it will change is if everyone leaves and rejoins. Cause there is no one left in the instance to transfer the number.

#

But then a new number will be generated.

void ridge
#

Right, that's the intended function

#

OK, I think I know what I need to know! That is, Vowgan is right, but now I know why they're right 😛

raven peak
#

👌

void ridge
#

Closing thoughts:

  1. Thank you both a ton for helping me out during your xmas afternoon 👍 🎉
  2. From a newbie perspective, this seems like an inelegant solution to what I might overconfidently presume is a somewhat common need. I wonder if this could be feedback for Udon.
#

Seems like not the rarest thing to want to run something at instance start, make some decisions, and then save the answers for the remainder of the instance.

raven peak
#

I got nothing better to do at the moment. But i cant think of a more elegant solution other then more settings to sync.

void ridge
#

Again, newbie--this is probably ultimately just a result of some larger architecture that I don't yet understand. But in any case, it seems to be within the scope of an SDK to make things like that easier 🤷‍♀️

#

Even if it's just to modify the VRCWorld prefab to include some easy spots for "stuff that runs once and only once for each game instance, right at the beginning"

raven peak
#

Syncing will be getting a upgrade hopefully first quarter 2021. most of my projects are waiting for it

raven peak
void ridge
#

this is software. I thought looking clean with a mess under the hood was the name of the game 😏

raven peak
#

Lol very true

#

But now with udon we get to get our hands dirty.

void ridge
#

"This is software" meant to be read in the tone of that one scene from 300 ("this is sparta")

void ridge
raven peak
#

Usually happens when you have a filter on a audio listener. Let me look back on the question.

raven peak
normal yarrow
#

I am, yes.

#

Ahh

#

I can do that for player audio?

raven peak
#

It shouldnt affect player audio. Unless they changes something i didnt know about.

stark bay
#

Got a problem uploading my world, its not necessarily 'udon' but it is 3.0 and does use very basic udon stuff like light switches and such, tried uploading it (Again because I've already managed to before) and the first strange thing I noticed is that it was named 'unpublished world' the upload menu, after clicking publish and waitin a couple months I got to the uploading ui and the worlds thumbnail and name had been reset as if it was a new other world, as well as this I also couldn't even click the upload button...And I also got this in the error log:

NullReferenceException: Object reference not set to an instance of an object
VRCSDK2.RuntimeWorldCreation.Start () (at Assets/VRCSDK/Dependencies/VRChat/Scripts/RuntimeWorldCreation.cs:82)

This is making me unable to update my world from this point on and the weirdest part is, I tried doing this again but before publishing I put everything under a gameobject and hid it (Hid everything basically) and when I had the publish UI it had its name and thumbnail as usual but I did not try actually clicking upload cause I didn't want my world to be stuck as an empty space

#

The only thing I can think of that I changed in this version of the world is some lights and I added an object but nothing that crazy

rancid swift
#

Could it be that Udon does not support syncing strings that contain 0-bytes ("\0") in them? I'm getting this absolute banger of an error message, it doesn't stop, but it also never syncs: