#udon-general

59 messages Β· Page 67 of 1

feral merlin
#

Is there a way to check the time of day and toggle something depending on the time reported by the system?

#

For instance I'd like a world to have one track play during the day and a different one to play at night

cold raft
#

yes

quick basin
#

would this be possible with graph?

scarlet lake
#

When I test with 2 clients, they are not in the same instance... how to fix? 😦

mighty fjord
#

It also does kindof depend on what shader you're using, but usually the property you want is internally called "_EmissionColor"

maiden sundial
#

Why does this happen? Why? This has to be some sort of bug
I don't understand why. I made so much testing on this and this is as far as I got with VRCObjectPooling.

I'm trying to use a synchronized object pool (just the active state of bullets) while keeping the position local per player, since the only actions that matter to me is when the bullet is fired and hits a target (this game being PVE).
The bullets fire properly from both client and owner when they are being used for the first time, HOWEVER, for some ungodly reason once the object pool loops back to the first object, they spawn on the player's item as expected and then get forced back to their actual spawn location?

This is position pull happens after OnEnable in the bullet, and it's seen as early as FixedUpdate. No other script is messing with the position of this bullets and the function that is enabling the bullets. Thinking that Return() is the guilty function here since the first time it spawns it goes through TryToSpawn() -> OnEnable() ->Collission() -> Return().... Loop back from pool -> TryTospawn()

I want to note that these objects do not have object sync since I want to save on bandwidth. Even if they could have, the position does not get reset properly and the bullets freeze in place for a good while when being spawned in with object sync on.

I really want to avoid using a custom pool since we dont have access to lists and queues yet.

quick basin
mighty fjord
#

Currently it would just set the color of the emission to the one you specify, but you can do some further scripting if you'd like to do some transitions or other colors

quick basin
mighty fjord
#

The most intuitive way to do that would probably be to add a public Gradient property to the UdonBehaviour so that you can easily edit it in the inspector

#

Then you'd use the sliders value (0 to 1) to sample a point on that gradient which would then give you a color to use for the color input on the Material.SetColor node

quick basin
#

it wont let me connect gradient to anything

mighty fjord
#

Try Gradient.Evaluate and give it the Slider.value aswell

#

Then it should return a color which you can then use for the SetColor node

mighty fjord
#

Yeah, you should probably also plug the custom event nodes flow into Evaluate and then take the output flow and plug it into the SetColor node. Also, dont forget to set up the rest of the inputs for the Evaluate node.

quick basin
#

like this?

mighty fjord
#

Oh, it's fine, that's why we've got chats like these, we're here to help after all. '^^

#

Yes, precisely, now you can take the gradient variable, pull it into the graph and plug it into the Evaluate node

quick basin
mighty fjord
#

You're almost done, now you just need to add a slider variable for the slider you've got in the world and then get the 'value' from it and plug that into the last input on the Evaluate node.

quick basin
mighty fjord
#

UISlider ^^

quick basin
mighty fjord
#

Now that you've got the slider, you actually need to get the 'value' (UISlider.value) from it aswell before plugging it into the float input

feral merlin
mighty fjord
#

There you go, now you can set up a nice gradient and have the slider blend between the colors. You should probably set the sliders max value to 1 aswell. ^^'

mighty fjord
quick basin
mighty fjord
#

Is it not working? Does the slider work in the first place? What issue are you running into?

quick basin
#

it just stays white

mighty fjord
#

Did you set up the gradient in the inspector?

quick basin
#

yeah

#

its the stars at top im trying to change btw

mighty fjord
#

Oh! You're not telling it what slider it should be referencing, you should make the UISlider variable public aswell. ^^

summer coral
#

I would like to do manual syncing of a specific timer.
How would I go about syncing the timer of the same object somwhere else? (Currently using udonSharp)
Is there a way to reference the same variable of the same object on other clients using OnDeserialization?

quick basin
mighty fjord
#

Good job. ^^

quick basin
mighty fjord
#

Yeah, if you're planning on doing multiple materials driven by the same slider then I'd strongly advise looking into and learning about arrays

summer coral
#

if I wanted to manually sync a variable of the on the same script/object in other clients on deserialization, any idea how I would do this?

quick basin
zinc ridge
#

was wondering if there was a way to modify a textmeshpro's maxvisiblecharacters with udon

#

to achieve an animal crossing text effect?

zinc ridge
#

another thing, how would i go about simply setting the value of a bool?

floral dove
slim hound
#

Set bool requires a bool constant to set its value

zinc ridge
floral dove
floral dove
zinc ridge
#

been trying to figure this out all day

lusty elk
#

how do i access a public variable on a different udonbehavior on a seperate gameobject?

grand temple
uncut plaza
#

I put QvPen and usharp videoplayer on my world and I got this message

#

how can i fix it?

solemn talon
#

If I set the owner of a GameObject to a player, does the player also now own the children of that GameObject?

grand temple
#

no, each gameobject is independent

glass niche
uncut plaza
#

yep i did

#

i also remove sharp and re-import

glass niche
#

try making a new project and importing Udonsharp, usharp videoplayer and QvPen and see if the error occur

#

if the error shows up again you might want to reinstall unity 2019

#

just to rule out the issue

uncut plaza
#

kill me

uncut plaza
#

new project is good

#

no problem

amber tartan
#

SO, i am trying to get an object to stick to the player, and have an ai follow that object. so far everything works, except that instead of moving the object (im using transform set position), it makes a copy every time its called. any ideas what might be going on? follower is set to an avatar, and follow is set to a plane (using it to see whats going on) that is set as the target on the avatar. here is my udon graph, and showing what happens in game. (happens with both "build and test" and hitting "build and publish" then going into the world) stacks are where i jumped btw.

#

also the otter in the back is the avatar to follow the plane, and the plane going through its neck is the one that is first instanced and supposed to be tracked onto the player

blazing timber
#

this given unitypackage do not working.

#

or maybe it's just working on VRC rather than playmode?

hushed gazelle
#

Has anyone else had trouble with the game not putting all clients in the same instance when running Build and Test lately?

white compass
#

someone know how i get the audio of the u# video player from Merlin to 2d global audio? I tried to change the audio sources to 2d but this didn't work quite

#

got it working

trim sapphire
#

Is OSC input available yet for Udon graphs or U# scripts?

stark adder
#

I'm gonna ask here too.. There is a Text on EVERY one of these buttons.. EVERYBODY ELSE can see it fine.. In Unity I can see it fine.. But my VRC just shows blank buttons and refuses to show the text πŸ˜… WTF

#

Like what the F ? xD Is my VRC broken

stray junco
#

hi

since that i working in my udon world project
i know that beside's udon graph also exist some of sdk2 components as well
and that idk where really to put my question wether here or in world dev
but i decide to put it in here because i work in SDK-WO
maybe i also need to do some UG-(udon graph) implementation on my audio source as well idk

so with that being say'd...
i wonder there a way to make my short music or sound to be transitional-loop-sequenced
maybe i didn't enplane correctly
but what i want is ... is to make my music or sound plays in unlimited time without noticeable gaps between END and START

any idea how to make this possible ?
please help

warm blade
#

any door lock systems out there? that's not a keypad?

coarse parrot
warm blade
coarse parrot
warm blade
coarse parrot
warm blade
coarse parrot
#

So what do you already have now?

coarse parrot
warm blade
coarse parrot
#

Likely you'd need a door first then implement locking. So first thing is trying to create a script to open-close the door when interact, without locking

#

This way you will be able to implement locking later on top of existing door

warm blade
coarse parrot
warm blade
coarse parrot
coarse parrot
# warm blade wait then how do i do so ?

You'll need one synced variable for udon, preferably a bool. Then you have Interact event to toggle the bool between true and false, then OnDeserialization event, have the bool variable set to animator parameter

#

Could you show what you have for the door animation also?

warm blade
#

the animation it self or the animator?

coarse parrot
#

Animator first

warm blade
stray junco
#

can somebody explan's what those nodes mean?

coarse parrot
#

That's good you're already have it setup

coarse parrot
coarse parrot
# warm blade

So now we can focus on creating udon behavior. You have to create an udon behavior like I've described earlier

stray junco
#

@coarse parrot
ah so that's like for example...
when i hold my gun and press mouse button or trigger button it will call a trigger to shut or not
because key up means shut and key down means dont shut
is that it?

warm blade
coarse parrot
stray junco
#

@coarse parrot
oh so it's oposite ok then thanks

coarse parrot
warm blade
coarse parrot
warm blade
coarse parrot
coarse parrot
warm blade
coarse parrot
#

I think you could make it public too, for future use.

warm blade
coarse parrot
#

I think is should make you and example that'd be much fasterπŸ˜…

warm blade
coarse parrot
warm blade
coarse parrot
warm blade
coarse parrot
warm blade
#

having issues finding it xD

coarse parrot
warm blade
coarse parrot
#

Try if the door is working

warm blade
coarse parrot
warm blade
coarse parrot
coarse parrot
warm blade
#

yeah becourse of my animator ?

coarse parrot
#

That's weird you name it that way

warm blade
coarse parrot
#

Like, why do you need to prefix with x2?

#

Is that only one parameter in animator?

warm blade
warm blade
#

so renamed the one in animator just for Open

coarse parrot
#

Oh You didn't have a collider on the door

warm blade
coarse parrot
warm blade
coarse parrot
#

That can be done too, but need to move interaction node to separate udon behavior on a button

coarse parrot
warm blade
#

nope wouldt let me

coarse parrot
warm blade
coarse parrot
warm blade
#

this is how

  • ehm yeah seems like the box i covering both doors
coarse parrot
#

Collider has to be in the same object with udon behavior

zinc ridge
#

how would i go about checking if the player has pressed right trigger on their controller? similar to this

coarse parrot
coarse parrot
#

Also if the door itself has a collider(to prevent player walking through), you will need to extend udon collider to cover the door collider too.

warm blade
coarse parrot
warm blade
grand temple
#

if you click on it, it will expand below

grand temple
#

sounds like the animator isn't specified

coarse parrot
# warm blade

Check again if the animator is assigned on udon behavior component

#

Ah you didn't link animator variable into SetBool node

#

So do I

#

Make it like this

warm blade
#

just couldt move past the collider xD

coarse parrot
warm blade
coarse parrot
warm blade
#

okay ^^

warm blade
coarse parrot
coarse parrot
#

Also set up a collider the same way with the door

warm blade
#

capsule xD *

coarse parrot
#

The graph:

#

door is a public variable, and assign the door udon behavior into it.

warm blade
warm blade
coarse parrot
#

Create another udon with same graph as the locking one. But change string to ToggleOpen

warm blade
#

ohhh

coarse parrot
#

You may need to remove Interact node from the main door udon as well.

warm blade
#

wich was that?

coarse parrot
#

The main door udon that has an animator

warm blade
warm blade
limber jackal
#

should be possible. You can set voice distances to 0 locally for players to essentially mute them. As long as you're careful with how the voice distances are being set, you could mute players in a certain room to all players not in that certain room

#

I'm having trouble after upgrading to unity 2019. Everything went well except unity no longer recognizes VRCUrlField as a valid class and gives me this error

'VRC.Udon.Editor.ProgramSources.UdonGraphProgram.UI.VRCUrlField' is missing the class attribute 'ExtensionOfNativeClass'! anybody know what might be causing this? I already tried deleting the library and regenerating it, but I can't get url fields back

zinc ridge
#

how would i go about checking if the player has pressed right trigger on their controller? similar to this

twin hedge
#

Ok, I'm really confused. I tried to set up the Udon network, and I did this set up many times, but for some reason this one won't work

#

it works fine for other objects, but not this object. It's a plane

coarse parrot
warm blade
#

but even that i had issues with xD

limber jackal
#
twin hedge
#

nobody? alright, i will figure it out myself

limber jackal
#

@twin hedge what's the problem? that the network isn't syncing the toggle?

twin hedge
#

oops bad crop. hold on

#

what does this mean? I googled it and found nothing helpful

limber jackal
#

haven't seen this before, but I think it's saying you have a node somewhere in your udon graph that is missing an integer input if i had to guess

twin hedge
#

hmm

#

but I've used the same network many times and they never failed me

#

I tried other objects and they worked fine. but this object, which is just a plane, won't work with the udon network

limber jackal
#

If that's your entire udon graph then it seems like something just broke in unity. You may want to save everything and reopen the project, and maybe reimport the udon graph asset

#

or you can try exiting the scene and reopening it

twin hedge
#

alright

#

nope it still doesn't work

#

Yeah, it has to do something with the object being plane cuz I replaced it with another object and it worked fine

#

I put it in an empty object and it works now. I guess I'll put them in the empty objects

amber tartan
#

Oop, forgot to remove the collider lol. OFF TO SPACE I GO!

#

Trying again

#

Nope, still broken

#

Anyone got an idea on whats happening? (Check the replied to message above)

grand temple
#

wait you're using vrcinstantiate but you don't want it to copy the object?

#

that's exactly what vrcinstantiate does

#

if you don't want it to copy, just remove the instantiate

amber tartan
#

No, I want it to instantiate ONE then move that with the player

#

The only time it should run through the instantiate is once

grand temple
#

do you need these objects to have any synced variables or network events?

amber tartan
#

I just need an ai to follow the object

#

Everything works fine other than it multiplying

grand temple
#

do you need to make a new AI for each player?

amber tartan
#

Yes

grand temple
#

so then you need to vrcinstantiate the AI as well

amber tartan
#

I have an on player join that will instantiate one ai, and should instantiate one object

grand temple
#

it's not working as you'd expect because you're pulling variables from a completely different flow path

#

you have your update loop pulling the gameobject from the instantiate, which causes the instantiate to happen again on update

amber tartan
#

Ok

grand temple
#

if you want the instantiate to happen once and then store a reference to that object, you need to add a variable and set that variable to the gameobject you get from the instantiate

amber tartan
#

Ok

grand temple
#

the same problem is in onplayerleft, you're also pulling variables from a different flow path. That's just not intended behaviour

#

but if you set the variable to a new copy every time a player joins, then it will only update for the last person that joined. So you'll need to add an array of these objects, use a for loop to find an empty spot, and put the new object in that spot.

Then on update, for loop through the array to update all of them.

And then onplayerleft, for loop through to find the matching player and remove theirs

amber tartan
#

Ok

#

Ty

#

Wait how do I se- nvm got it

#

Ok, so, I'm having a bit of trouble figuring out how to do that with the node graph

amber tartan
#

Well I froze vrchat, umm

amber tartan
#

And now I crashed unity lol

amber tartan
grand temple
#

which part?

amber tartan
#

Like all of it lol

grand temple
#

so first is you need an array of gameobjects

#

an array can contain multiple things, but it cannot be resized so you'll need to make the default size big enough to handle all the players your world will ever have

#

which is the soft cap * 2 + 2, so if you have 16 soft cap, set the array to 34 length

amber tartan
#

Ok, so I need one thats 82 then bc its 40, also thank you soooooo much for your help before and in advance

#

Now that the game doesn't freeze when I build and test im going to build and publish as public so you and others can check it out in-game

amber tartan
#

I'm gonna restart with another graph so I don't loose my progress, but can copy my work when I figure it out

pallid mango
#

What does this node do

grand temple
#

it's useless. It's auto-generated, these things happen

pallid mango
#

Thanks - is there a useful datatype to just store a transform as code or do I have to just save three vector3s

#

I want to hardcode some position/rotations to snap to when i drop a pickup near it

grand temple
#

huh? You mean.... a transform?

pallid mango
#

Well, I have a transform varible that I'm trying to set on Start with my hardcoded position and rotation, but it wants an actual instance, rather than letting me just set values to it. I guess I'm just looking for a Pos/Rot/Scale bundle datatype

grand temple
#

oh, that's kinda what a matrix4x4 is

pallid mango
#

Perfect, that's what I was missing

hushed hull
#

I am very new to Udon, how can i make a interaction like a pool table update for both quest and pc? Cause i uploaded my world, works fine in both platform separately however when we try to play pool, I click to start the game but the Quest user cant see the UI to join the game. Anyone know of a fix? Thx and much love

grand temple
#

whenever you're syncing anything between two platforms, you need to make sure that every object is ordered exactly the same between the two versions. If you delete objects on the quest version, it will assign network IDs differently and it won't be able to sync properly

hushed hull
#

Could it be that i copied the Scene from the PC Version to a New Scene for Quest? Or is that okay as long as the Hierarchy is the same?

grand temple
#

it's fine as long as the hierarchy is the same

#

but it's possible that copying it changed the hierarchy

hushed hull
#

Going through it now... looks it did change the hierarchy. If i upload to quest on the OG Scene would it screw everything up that i did on pc when i switch back to the PC Platform on Unity?

hushed gazelle
#

Copying it to a new scene would mean it's in the same project and therefore has unique identifiers across the board for everything.

#

Ie; The Pool Table in the PC Scene isn't the same as the Pool Table in the Quest Scene because they're both part of the same World Project and (conventionally) they are both in a game that can transition between the two scenes.

hushed hull
#

Okay, ill try it out tommorow, THANK YOU to both of your help!vrcHappy I am use gonna upload the OG Scene and delete the Quest Scene

grizzled trout
#

hi , i have an idea for a vr chat world but it needs something that i am not sure where to start learning. i want to make a simple computer in vr , nothing amazing just something that would let you select "folders" and scroll through text documents. have a few ideas how to do some of it but no clue how i would do scroll threw text with out doing some really dull stuff "if down arrow button is pressed and on page 3 go to page 4" kind of thing, ied love to use the UI menu but cant find anything involving a scroling menu

hushed gazelle
#

Is it possible to return the Start Colour of a Particle System in Udon? I've looked through the search but it doesn't seem to be there.

#

Nevermind, found it! It's in ParticleSystem Main Module.

hushed gazelle
#

You don't have UdonSharp installed.

hushed hull
#

SORRY IF THIS IS THE WRONG CHANNEL! So I was wondering if this fix is still good for the new update? I have run into an issue where a a quest player grabs a QV Pen and so does a PC Player, they both draw a line however both lines are deleted after then pen is released. The line stays for user but not the β€œviewer”. Or Do i need to add a script?

desert grove
#

Silly Question. UndonFlat converts Graphs to sharp. Anyone know of a tool that does the opposite?

torn pendant
#

I have 4 audio i want it to play random when i click interact how is this done?

boreal flower
#

Is there a way to get the player's current computer time or timezone?

hushed hull
boreal flower
#

Thank you

brave flicker
high geyser
#

Hello i got a question how do i make my world quest compatible when i test it everything is miss textured

desert grove
coarse parrot
desert grove
#

thats not what I am after, I need to see what my scripts look like in udon without having to play with disgusting noodles.

#

Maybe, I asked in the wrong channel, UdonSharp nor C# or Unity is new to me. We have a tool that will take the graph and convert it to udon sharp, I was just curious if we had something that took sharp and converted it to a graph πŸ˜‰

warm blade
warm blade
coarse parrot
#

And locking variable will be used to determine if TeleportTo should be executed or not.

warm blade
#

okay πŸ˜„

fallen prawn
#

I may ask a question here, why I can't set UI text on Update()?

This is the code, using U#.

void Update()
{
  int spawned = 0;
  foreach (GameObject gobj in DiceObjectPool.Pool) if (gobj.activeInHierarchy) spawned++;
  limitText.text = spawned.ToString("D2") + "/" + DiceObjectPool.Pool.Length.ToString("D2");
}
#

This is what it should be. (Test using CyanEmu)

warm blade
coarse parrot
fiery yoke
upper musk
#

is there a way to set scale/change scale of an object in udon?

#

i only see pos and rotation

fiery yoke
#

localScale

upper musk
#

but that's only local I assume? what if I want it to be global

fiery yoke
#

Then its lossyScale

#

Scaling is a bit special due to the mathematics behind it

upper musk
#

Okay, I'll try that vrcBotThink

#

Thanks

fiery yoke
#

Ohh yeah i forgot lossyScale is readonly

#

To scale an object "globally" you need a 3x3 Matrix

#

Since rotations have to be taken into account, which skew the euclidean space, which makes scaling complicated.

upper musk
#

Maybe I'll just not then

#

My udon skills don't go far beyond pickups and mirrors

fiery yoke
#

Yeah spatial mathematics are sadly not super straight forward.

upper musk
#

Thanks for answering me

mighty fjord
#

You dont really need global space scaling if all the parents are set to the default 1,1,1 though, do you?

warm blade
fiery yoke
topaz jetty
#
Networking.SetOwner(Networking.LocalPlayer, this.gameObject);
Debug.Log("took ownership");
menuOn = false;
scoreDisplay = true;
Debug.Log("reuqesting serialization");
Debug.Log(Networking.IsClogged);
Debug.Log(Networking.IsNetworkSettled);
RequestSerialization();
Debug.Log("requested serialization");
OnDeserialization();
Debug.Log("Sending out start game network");
SendCustomNetworkEvent(NetworkEventTarget.All, "startGameNetwork");
Debug.Log("Sent out start game network");
``` I have no idea what I'm doing wrong. Networking.IsClogged returns false, Networking.IsNetworkSettled returns true, the event goes through fine, `menuOn` and `scoreDisplay` are both synced variables, it says it transferred ownership successfully in the log, yet nothing is getting deserialized. It doesn't even call OnDeserialization on the other client, yet it works fine on this part of my code (same networked object) ```cs
Networking.SetOwner(Networking.LocalPlayer, this.gameObject);
selectedSong = localSelectedSong;
masterId = Networking.LocalPlayer.playerId;
joinedPlayersIds = new int[] { Networking.LocalPlayer.playerId };
RequestSerialization();
Debug.Log("Requested serialization");
selectionMenu.SetActive(false);
songSelectedMenu.SetActive(true);
updateSongSelectedMenu();
startJoinButtonText.text = "Start";
pallid mango
#

Can udon make temporary named variables within the scope of the event or do they need to be persistent across all events?

fiery yoke
pallid mango
#

So when udonsharp seems to be doing it is that just trickery and they are global?

fiery yoke
hushed hull
#

SORRY IF THIS IS THE WRONG CHANNEL! So I was wondering if this fix is still good for the new update? I have run into an issue where a a quest player grabs a QV Pen and so does a PC Player, they both draw a line however both lines are deleted after then pen is released. The line stays for user but not the β€œviewer”. Or Do i need to add a script?

warm blade
grizzled trout
#

hi , i have an idea for a vr chat world but it needs something that i am not sure where to start learning. i want to make a simple computer in vr , nothing amazing just something that would let you select "folders" and scroll through text documents. have a few ideas how to do some of it but no clue how i would do scroll threw text with out doing some really dull stuff "if down arrow button is pressed and on page 3 go to page 4" kind of thing, ied love to use the UI menu but cant find anything involving a scroling menu

desert grove
grizzled trout
coarse parrot
warm blade
coarse parrot
warm blade
#

oh gimma a sec xD

warm blade
coarse parrot
#

Remove the animator

coarse parrot
#

You will also need position of where you're going to teleport to

warm blade
coarse parrot
#

Connect TeleportTo only from branch false

warm blade
feral merlin
#

Is there a way to edit player speed and jump height upon entering a trigger and reverting it upon exiting?

coarse parrot
#

Keep the SetLocking and what it connected to

coarse parrot
feral merlin
#

I got that

#

But how do I edit speed

#

And jump height

warm blade
coarse parrot
coarse parrot
#

Also remove OnDeserialization node

warm blade
coarse parrot
warm blade
coarse parrot
#

Then add a new public variable to store Transform. Transform is a position, rotation and scale of a game object. So create an empty game object in your scene at destination you want to teleport to, then asssign to a variable, then you can get position and rotation of the transform to input into TeleportTo

coarse parrot
#

Can it lock? Or can you edit it to be able to lock?

warm blade
coarse parrot
#

Either edit the existing TP or look into it and see how it use TeleportTo node

coarse parrot
warm blade
coarse parrot
coarse parrot
warm blade
coarse parrot
#

Insert branch with locking in between Interact and TeleportTo

coarse parrot
warm blade
#

yeah how to locking

warm blade
final thorn
#

I want to split my map in to 2 parts with a teleport were when somone goes through the teleport everything loads out (Including the avatars on the other side) how would I do that?

coarse parrot
warm blade
coarse parrot
coarse parrot
warm blade
coarse parrot
#

What do you have now?

final thorn
warm blade
coarse parrot
# coarse parrot Not possible

Occlusion culling and clipping plane sill apply to player. Occlusion culling isn't a way unloading the scene so that is misunderstanding.

warm blade
coarse parrot
warm blade
coarse parrot
coarse parrot
#

This one is for interaction to set locking state when the locking button is pressed

warm blade
coarse parrot
#

The flow should end at SetLocking so that I said you have to cut connection from the right side of SetLocking

coarse parrot
warm blade
coarse parrot
#

I changed my mind. You should move locking state to the locking button itself

#

Along with moving top part of the graph into locking button graph

coarse parrot
#

Not right now sorry

warm blade
coarse parrot
#

Don't connect Setlocking to TeleportTo

#

Those are separated action.

#

That mean if you toggle locking then it will tp you

warm blade
coarse parrot
#

What to what?

warm blade
coarse parrot
#

Keep this part and don't connect to anything outside of this image

coarse parrot
#

That's an interaction when you toggle locking. And you don't wan't to TP when you interact with the lock button

warm blade
coarse parrot
#

Therefore you don't connect the TeleportTo node to whatever it interaction with locking machanism

warm blade
coarse parrot
#

Better

#

And branch to prevent TP from executing

warm blade
coarse parrot
#

Front

warm blade
coarse parrot
#

You have two tp node now remove the one to the left side

#

and insert the branch between interact node and tp

coarse parrot
#

And try figuring out from what I've told you earlier

warm blade
coarse parrot
warm blade
coarse parrot
#

One branch

warm blade
feral merlin
#

I originally asked this in a different channel but figured it may be better to ask here

#

How can I set this up to only happen to a LOCAL player?

grand temple
#

you need to check if the player that entered/exit is local and plug that into a branch

feral merlin
#

How do I do this though

#

@grand temple sorry for the ping but could you elaborate on how to do that?

grand temple
#

plug the playerapi from onplayertriggerenter into a playerapi islocal node, and plug that into a branch node

#

then put the branch node between the onplayertriggerenter and the setrunspeed

warm blade
feral merlin
#

@grand temple Got part of what you were saying but still got an issue

#

What would I plug into the instance?

grand temple
#

the local playerapi

#

you can get it with networking.localplayer

feral merlin
#

Gotcha

warm blade
#

anyone able to help me xD?

brittle swift
#

how do i update udon sharp? do i delete the folder then reimport the new one?

cold raft
#

Sometimes

#

Depents on version diffeence

brittle swift
#

well, i havent updated udon sharp in a while since i havent touched it

#

lkdjaslkdnjmal

#

but im upgading my project to 2019

#

unity

#

i dont know how old my udon sharp is

cold raft
#

If you udon sharp version is lower than 0.19.2 (there is a version file inside the udonSharp assets folder you can check)

#

If it is older that 0.19,2 then you need to delete Assets/UdonSharp/Plugins folder first. Otherwise just import the new package

brittle swift
#

thanks!

pallid mango
#

All right I think I wrapped my head around deserialization… I don’t need to update variables when receive deserialization…. The values are updated magically on their own. I only need OnDeserialization if I actually need to update the world based on those values as they came in. Is this correct?

brittle swift
#

hmm...i tried migration methods, and my sdk gets broken in unity 2019?

#

my sdk from 2018 hasnt been updated in a while,

#

so i wonder if its related to that somehow

#

i have backups but

grand temple
#

did you import the new SDK after migrating?

brittle swift
#

yes i followed the instructions, make a new scene

#

and import after

#

it still got broke

grand temple
#

exactly what broke?

brittle swift
#

well there is errors in the consle

#

i dont know exactly what

grand temple
#

could you share a screenshot?

brittle swift
#

i can but its going to take me a bit, i actually made a backup and planned to try again and i already deleted the corrupted project so

#

if it happens twice i will do it

grand temple
#

it might also help to do a clean install. Close unity, delete the vrcsdk and udon folders, then reopen unity and import the sdk

brittle swift
#

what udon folders in paritcular, udon shap?

#

sorry dumb question

#

oh you mean the Udon that vomes with the sdk

#

sorry i think i understnad

grand temple
#

you could also delete udonsharp too to be safe

brittle swift
#

alright

brittle swift
#

hmm

#

didnt help

brittle swift
#

does anyone have the latest 2018 Sdk

#

i wonder if its just ...breaking because like its old sdk and the updgrade is too much or something

grand temple
#

screenshots?

feral merlin
#

@grand temple mind if I trouble you for one more thing?

grand temple
#

don't ask to ask, just ask

feral merlin
#

Is there a way to track if specifically the player's view point entering a trigger collider?

grand temple
#

sure, the simplest way would be to make a really tiny sphere and make it follow the player's head with an update loop

feral merlin
#

I just meant specifically in graph

#

I have a pool and I want it to spawn a sort of post processing cube only when the player's view is within the trigger

grand temple
#

post process volumes already have the option of being enabled when the player's head is inside a collider

feral merlin
#

See the issue is

#

Post processing isn't on Quest

#

But I have a shader that over-renders everything else and is transparent black

#

Since it over renders everything, I only want it to spawn if the player's view is submerged

grand temple
#

you could calculate it manually instead of making use of physics but it's more complicated

#

you would use transform.inversetransformpoint and then if it's a sphere collider, check if the magnitude is less than the radius of the sphere. If it's a box collider, you'd have to check if each axis is less than each of the bounds of the box

feral merlin
#

So how would I go about doing this with graph?

grand temple
#

get the position of the player's head with playerapi.gettrackingdata.position, and then plug that into transform.inversetransform point

feral merlin
#

playerapi.gettrackingdata is the head?

#

Or view rather?

grand temple
#

yes

#

it has a couple other options but head is one of them

feral merlin
#

Okay I've got this

grand temple
#

you also need networking.localplayer and playerapi.gettrackingdata

feral merlin
#

Alright so now it's like this

grand temple
#

now you need the transform that has the region

#

plug that into the "instance" slot of inversetransformpoint

feral merlin
#

It is a box collider by the way

grand temple
#

well since you're calculating it manually, it doesn't need to be a collider

#

but you just need it's transform

feral merlin
#

Uhh

#

Kinda confused by what you mean

#

This is the box collider as is right now

grand temple
#

I think you might want to try the first method

feral merlin
#

@~@

#

Okay so what would that entail

#

I am such a noob at this

#

I have the transform of a Unity cube that can be used as the collider

#

@grand temple would this work?

grand temple
#

yes

#

does it need to be a box collider? It would be much simpler if it was a sphere

feral merlin
#

It does

#

Sadly

grand temple
#

ok then you need to get the scale of the box collider and check if each axis of the inversetransformpoint is within the bounds of the box collider

#

at the very least, make the center of the box zero so you don't have to account for that

feral merlin
#

The target object is the size of whatever collider I would need

#

This is the collider for the dark effect

#

So what do I do from there?

grand temple
#

check if the result of inversetransformpoint is within the bounds of the collider

#

check if the x axis is less than 0.5 and greater than -0.5, check if the y axis is less than 0.5 and less than -0.5, and then check if the z axis is less than 0.5 and greater than -0.5

feral merlin
#

And how do I do that?

#

What module(s) do I need?

grand temple
#

float less than/float greater than

#

and combine them together with boolean AND

feral merlin
#

logic or conndition?

grand temple
#

conditional

feral merlin
grand temple
#

you need to split the vector3 and get the individual parts

#

vector3 get x, vector3 get y, vector3 get z

feral merlin
#

So like this?

grand temple
#

you have them flipped, it's (top value) less than (bottom value)

feral merlin
#

Got it

#

And now attach these to x and y?

#

@grand temple Got the ands in place, now what?

grand temple
#

combine them together more

#

all the way down to one bool, like a big tree

feral merlin
grand temple
#

yep

#

now use that for setting a gameobject active

#

and use update so it always checks

feral merlin
#

I haven't used update so how do I go about that

grand temple
#

it's just an event that happens every frame

feral merlin
#

Where do I implement it

#

Okay think I got it

#

This?

grand temple
#

yeah but there's no reason to use a branch

#

just plug the bool directly into the setactive

feral merlin
#

It worked!!

#

Thank you so much

#

Do you take tips?

grand temple
#

no I don't

feral merlin
#

Alright, well figured I'd at least throw the offer out. You've been a tremendous help

restive drum
#

does anyone know how to pull the current url being played out of the video player object?

cedar cairn
#

So i made this simple little thing. It works, but it appears to be networked. The toggle toggles when anyone leaves the trigger. How do i make it local?

grand temple
#

onplayertriggerexit happens when any player touches the object, but it gives you the player so all you need to do is check if that player is local. The "playerapi islocal" node is what you want, and then you plug that into a "branch" node. The branch node would go in between the onplayertriggerexit and the set "ison"

cedar cairn
#

Like so?

grand temple
#

you need to plug in the playerapi that you get from the onplayertriggerexit

cedar cairn
#

Ahh yeah ofc. Well thanks! πŸ™‚

mellow trail
#

so ugh.. i opened the jam thing

#

:D

#

nice vrcworld

#

doenst seem like scene descriptor script exists

#

had to relaunch unity all good

runic sparrow
#

Did you import the package into unity?

#

Hey silly question but I see these examples here in the doc but I'm not finding them in the sdk examples folder in my project:
https://docs.vrchat.com/docs/udon-example-scene

#

Am I supposed to download this example scene elsewhere?

#

Oops, found it!

hushed gazelle
#

So what's the actual difference in video players between the Unity and AvPro players?

floral dove
hushed gazelle
#

Ahh I see.

soft mountain
#

Hey, so I'm trying to do some stuff on a non-player humanoid avatar - problem is, I can't for the life of me get my OnAnimatorIK() callback called from my U# script. And yes, I do have IK Pass checked in the animator. Any ideas?

hushed gazelle
#

I don't suppose there's a quick math node in Udon that can take two values and spit out the difference between them?

soft mountain
#

Subtract?

#

Pretty sure there are nodes for all the basic operators

hushed gazelle
#

You need to know the larger number in advance for that though.

warm blade
#

Anyone able to help trying to make a TP lock systems xD but im kinda new at this xD

soft mountain
soft mountain
warm blade
hushed gazelle
#

Yeah, what's the intended use of it?

warm blade
hushed gazelle
#

What is this TP Lock state actually going to do in your world?

warm blade
hushed gazelle
#

Well you need a Branch on Interact that checks what Locking is set to and only progresses to TeleportTo if it's false. There should be no link between SetLocking and TeleportTo, and you need to hook that Unary Negation up to the Locking value.

#

All ToggleLock needs to do is Set Locking via unary negation of Locking. We don't care what it's previous value is.

hushed gazelle
#

Is there a way to tell if something like a particle emitter is part of an avatar or an object in the game world?

hushed gazelle
#

Yup, just gotta connect Locking to that Branch and you're set. Its own node, not from the existing one tethered to the UnaryNegation.

hushed gazelle
#

The bool value?

warm blade
#

So this?

hushed gazelle
#

Nooo.

warm blade
hushed gazelle
#

Better

#

Now you need to connect Locking to the Branches as well.

#

Because right now they don't know what you want to check is true or false.

warm blade
hushed gazelle
#

Your branch is built wrong though. It needs a bool value to read.

hushed gazelle
#

That Locking value IS a bool.

#

Drag another copy of that value into your graph, connect it to each Branch.

#

All you're doing right now is setting Locking, but you're not reading it anywhere.

hushed gazelle
#

THERE you go.

#

Don't forget the other branch.

warm blade
#

so with the other branch - or the first one i need to connect it to the value of that branch aswell

hushed gazelle
#

Just make another Locking value and connect that to the Branch.

hushed gazelle
#

THERE we go, finally.

warm blade
hushed gazelle
#

Hey, we got you there in the end.

warm blade
warm blade
slim hound
hushed gazelle
#

Anyone got any ideas for my own problem? I'm looking to check if a ParticleEmitter is part of a player or an object in the world.

warm blade
slim hound
#

Yes

slim hound
#

Do you just mean checking if the particle collision is coming from a player?

hushed gazelle
#

Yes

warm blade
#

it*

slim hound
# hushed gazelle Yes

Udon doesn't really have a direct way to tell if a particle collision came from a player or not unlike SDK2 which could gate based on the layer of the particle

#

But an alternative you can do is have the particle system itself be the event sender

#

Assuming that is what you want to do

hushed gazelle
#

I think you just solved the problem for me; I'll just try putting them on their own specific layer.

warm blade
#

sheeesh now i need to solve mine O.O

slim hound
#

When you said its not working what do you mean?

#

Like what behavior

warm blade
#

well seems like when i try to use the lock for my tp its just tp's me instead of locking

slim hound
#

Do you have a separate object interact that sends a custom event to that one that you showed?

slim hound
#

Oh wait in your graph you are going custom event through a branch

#

remove the branch and connect the event straight to the set locking

slim hound
#

Yeah

#

Though whats your other udon behavior like?

#

You should have another one that sends the custom event right?

warm blade
#

what do you mean ?

slim hound
#

What are you trying to do? have a button that locks it or have it lock when someone teleports?

warm blade
#

im want a button that locks the tp. wich you come from. so people cant use the same to go where it leads

slim hound
#

So you want it to lock for other players after someone uses that teleport?

warm blade
#

yes

slim hound
#

You would want something like this then

warm blade
#

so like this?

hushed gazelle
#

Does an UdonGraph with an OnPickupUseDown Event have to be on the same gameobject as the Pickup component, or will it work if it's a child of it? (Eg, if I have a pickup object with several gameobjects inside it, will those react to the player attempting to Use the held object?)

slim hound
slim hound
hushed gazelle
#

Thought as much, but worth a check to save an extra graph if I could.

slim hound
#

On the set locking node you need to make a constant bool and have it as true

warm blade
#

constant bool?

slim hound
slim hound
#

Yes that node

#

Plug it into the set locking node input

warm blade
slim hound
#

What is it plugged into in your screenshot?

warm blade
#

well to the locking bool - but when i try to set it into the set lock - i just goes there

slim hound
#

Remove the other one first

warm blade
slim hound
#

Delete the locking bool

#

Also do you have errors in the unity console?

warm blade
#

deleted it - does not seem like i have any errors

slim hound
#

Oh well that should work then

#

though now you would need logic to unlock the teleport too

warm blade
warm blade
slim hound
#

Isn't it supposed to?

#

Wait how does your graph look

warm blade
# slim hound Isn't it supposed to?

well okay so i a few buttons - a keypad where you have to put in a code. wich then show a button they can use for teleporrting - to a room - in that room i have tp to teleport you back. and one i wanna use as a lock wich is then gonna lock the button they used to get there. so they cant teleport there

warm blade
slim hound
#

You need to set the bool constant to true

warm blade
#

just by pressing the box right?

slim hound
#

Yes

shut patrol
#

Are there any improvements planned for the assembler? For example, operations on direct access to variables or jumps, copying variables to an address. Something like this:

PUSH, behaviour
JUMP_INSTANCE, 0x00000000

PUSH, behaviour
PUSH, jumpAddress
JUMP_INSTANCE_INDIRECT

PUSH, behaviour
PUSH, variableAddress
COPY_TO_INSTANCE, inVariable

PUSH, behaviour
PUSH, variableAddress
COPY_FROM_INSTANCE, outVariable

PUSH, toAddress
COPY_TO_ADDRESS, fromVariable

PUSH, fromAddress
COPY_FROM_ADDRESS, toVariable

PUSH, fromAddress
PUSH, toAddress
COPY_FROM_TO_ADDRESS
indigo wagon
#

what does this do on the set varyable block

cold raft
#

good question!

#

i means corresponding OnVariableChanged events will trigger

warm blade
slim hound
warm blade
slim hound
#

And you pressed the compile button?

warm blade
soft mountain
#

Asking again since the first time was at a really odd time: I'm trying to control a non-player humanoid avatar - problem is, I can't for the life of me get my OnAnimatorIK() callback called from my U# script. And yes, I do have IK Pass checked in the animator. Any ideas?

warm blade
coarse parrot
#

Not quite. I have only around 10 minutes

warm blade
coarse parrot
#

Do you still have another udon on locking button?

warm blade
coarse parrot
#

The locking button shouldn't have that animator

warm blade
#

this one is the lock for the other doors

coarse parrot
#

You should create a new variable here called "locking"

#

We're going to move the locking state into the lock itself

warm blade
#

so just like we did once before just in this one instead?

coarse parrot
#

Yes. With GetLocking then unarynegate then setlocking

warm blade
coarse parrot
#

Also custom event from the door udon

warm blade
coarse parrot
#

The one that you replaced with const bool

warm blade
#

oh

warm blade
coarse parrot
#

Yes

#

Remove the Door variable too

warm blade
coarse parrot
#

What do you have now, the graph?

coarse parrot
#

Connect the top 4 to each other, hope you remember how

warm blade
coarse parrot
#

good. The custom event is the same name as the sting below

warm blade
#

yeah done

coarse parrot
#

Back to the door

floral dove
#

FYI if you wire up the target UdonBehaviour to that Door variable, then you can choose the eventName from a dropdown instead of using a string const. Will ensure you spell it the same in both places, and show an error if you ever rename the "ToggleLock" event so you know why it's no longer working.

coarse parrot
#

Add a new UdonBehavior variable to the door udon, better call it lockButton

coarse parrot
#

yes that too

warm blade
coarse parrot
#

A is to replace by SetProgramVariable
B is GetLockButton and connect to A instance slot

#

Also remove the top group of three

warm blade
#

like this?

humble vortex
#

I'm building a world and I want to prevent opening user portals within a, say, 40m x 10m area but allow them outside there. The most stupid implementation should be placing lots of (dummy) spawn points all over the target area, though I wonder if some "smarter" method exists, does it?

floral dove
#

we don't have a way to mark a specific area as non-portal-able other than spawn points afaik

humble vortex
#

Oh... the 400 spawn points would make it up for a while, thank you

grand temple
#

do you specifically need that area to prevent portals? Or do you need the whole world to prevent portals? "forbid user portals" is an option in the scene descriptor if you want the entire world affected

runic sparrow
#

Hey what's the difference between an udon script getting another object's udon component & firing off a method vs. sending a custom event? Is the first method something that's only experienced for the local player?

grand temple
#

that's the same thing

#

if you wanted to fire a method on another udonbehaviour, you would do so by sending a custom event

#

if you wanted it networked, you would do so with "SendCustomNetworkEvent"

runic sparrow
#

Ahh, so I guess my question is what should be sent over the network? Like let's say one object's behavior pulls various other objects around the scene close to it- is the only way to get all players to see this effect of "pulling things in" to send a custom network event? Or is position something that is automatically persisted over the network

grand temple
#

position is only synced if you want it to be. You would do that by adding the objectsync component. Then when a player wants to move an object that is synced, they would need to take ownership of it before moving it

runic sparrow
#

Ahhhh, interesting!

#

Thanks for your help ❀️

grand temple
#

however that is only necessary if the movement is dynamic. If it's just moving from fixed point A to fixed point B, a network event would suffice because that is all the information that is necessary

pallid mango
#

I thought ownership transfer was automatic

grand temple
#

if it has a pickup, then yes you will take ownership automatically when you pick it up

#

but if a script is just setting the position, then the script needs to take ownership

runic sparrow
#

Yeah that's what my behavior is doing, I'm still very green with working with the sdk so I'm stumbling a bit, but I'm coming up with a way for a player to hold multiple objects at once, so to speak

grand temple
#

then yeah, your best bet is to take ownership and set position

pallid mango
#

Somehow I keep ending up with infinite network event loops on deserialization

grand temple
#

what are you doing in ondeserialization?

pallid mango
#

Updating all of my variables

grand temple
#

are you modifying the synced variables?

#

or modifying local variables by using synced variables?

pallid mango
#

All right I think I’m starting to immediately detect that I don’t know what I’m doing

#

… ok that’s what synced does. Disregard I know what I’m doing wrong

#

I made everything way more complicated than I needed to

humble vortex
prisma prism
#

anyone know how to lerp or slow parent an object with udon?

dull stream
#

I'm trying to make a custom pickup float towards the player in desktop mode on interact. For now it's not supposed to be picked up or do anything, just fly towards them.
Once interacted I'm making it's ridig body kinematic and collider disabled. Then I'm using Transform.Lerp to move the object towards the player's head and once it reaches it it should (for now) just fall back to the ground.

For some reason it still lingers in the air for a while. I thought lerp is supposed to reach 1 (the time when it should drop to the ground) when it's at the destination not reach it, stop for a while then drop.

I also noticed that the further away I'm from 0,0,0 the more the offset between the player and the gun is. What am I doing wrong?

#
float lerpTimeToPickup = 0.8f;
float _lerpTime = 0;

bool MoveTowardsPlayer
{
    get => _moveTowardsPlayer;
    set
    {
        _moveTowardsPlayer = value;
        rigi.isKinematic = value;
        col.enabled = !value;
        _lerpTime = 0;
    }
}

void FixedUpdate()
{
    if(!MoveTowardsPlayer)
        return;

    Vector3 playerPos = player.GetPosition();
    VRCPlayerApi.TrackingData localData = player.GetTrackingData(VRCPlayerApi.TrackingDataType.Head);
    
    _lerpTime += Time.fixedDeltaTime * lerpSpeedMultiplier;
    Vector3 newPos = Vector3.Lerp(transform.position, playerPos + localData.position, _lerpTime);
    Quaternion newRot = Quaternion.Lerp(transform.rotation, localData.rotation, _lerpTime);    

    transform.SetPositionAndRotation(newPos, newRot);

    Debug.Log("Lerp time is: " + _lerpTime);
    if(_lerpTime >= lerpTimeToPickup)
        MoveTowardsPlayer = false;
}

public override void Interact()
{
    MoveTowardsPlayer = true;
}
#

For reference this is what I'm going for (minus sticking to the camera for now)

pallid mango
#

Pumkin ninja

dull stream
#

I'm done with my long question now iris

soft mountain
#

So I'm trying to control a non-player humanoid avatar - problem is, I can't for the life of me get my OnAnimatorIK() callback called from my U# script. And yes, I do have IK Pass checked in the animator. Any ideas? Does that callback just not work in Udon?

solemn talon
#

So I've got a problem where when the owner of a script leaves, OnPlayerLeft gives me a null VRCPlayerApi. Has anyone got any tips for how to get around this? I'm considering using something like OnOwnershipRequest or OnOwnershipTransferred to cover the owner leaving, but that feels clunky

floral dove
floral dove
soft mountain
floral dove
solemn talon
floral dove
#

When a player joins, we assign them an object from the pool (this program is on the PlayerDataManager, which has a reference to the pool)

#

then when that object's ownership changes, we check if the object has not been initialized by looking at a synced int called playerId which has a default of -1. If it's -1, we set it to the new owner's id
(the rest of the logic is all on the PlayerData objects from the pool)

#

However - if Ownership changes and the playerId is not set to -1, then we can assume that this player has left, and we can have the owner of the ObjectPool set the playerId back to -1 and return the object

solemn talon
#

Ooh that's pretty much exactly what I needed, thanks a bunch!

floral dove
#

sure thing! I think it's a pretty solid pattern.

#

you could simplify things a little by having the playerdata objects have a reference to the pool directly instead of fetching it through another object (the PlayerDataManager, in this case)

#

then you can just check if the local player is the owner of the gameObject that the pool is on, and return it if they are.

soft mountain
#

@floral dove Ok, I ran that experiment. The MonoBehaviour's event does log. The U# callback still doesn't. And to be clear, I was using U#, so I'll go verify with a graph program as well.

#

@floral dove Yep, silence from the Graph program as well. Posting both programs below.

#
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;

[RequireComponent(typeof(Animator))]
public class AvatarDriverTest : UdonSharpBehaviour
{
    public GameObject target;
    public Animator animator;

    private void Start()
    {
        animator = gameObject.GetComponent<Animator>();
    }
    
    public void OnAnimatorIK(int layerIndex)
    {
        Debug.Log("U# OnIK");
        animator.SetIKPosition(AvatarIKGoal.LeftHand, target.transform.position);
        animator.SetIKRotation(AvatarIKGoal.LeftHand, target.transform.rotation);
        animator.SetIKPositionWeight(AvatarIKGoal.LeftHand, 0.5f);
        animator.SetIKRotationWeight(AvatarIKGoal.LeftHand, 0.5f);
    }
}```
floral dove
#

Aha! I'm sorry to hear that but thankful that you've found this issue. We recently moved some events to proxies, that could be part of the issue. If you file a Canny, then we'll update you when it's fixed.

soft mountain
#

Well that's fun, it's been a while since I've seen a one-character bug like that lol

wind zenith
#

@fiery yoke has there been any new changes in your seamless portal system? If it's gotten better, I'm curious if you would allow me to copy it into my own world. If not, could you elaborate more on these "weird tricks" you used?

#

I'm especially curious about the stencil / rendering tricks, but we can talk in #shaders for that

proper pier
#

Despite fixing whole script issue with import of UrlInputField, it still seems not to receive any active focus nor input from the keyboard, while the rest of the UI around works perfectly fine. Is it still related to swap of unity versions?

hushed gazelle
#

What's the best way to calculate if an object is upright? I get the feeling Vector3.up is involved, but not quite sure of the best way to parse that against the object's rotation.

indigo wagon
#

is this how i make it so that a player trigger only effects the local player

#

aka noone else trips it on your client but you

chrome veldt
#

Hi, does anyone here know much about the AV Pro in the SDK? Im trying to stream twitch and most accounts work but not mine. Could it be due to a bad internet connection of mine? All I get is a blank plane where the stream should be.

dull stream
plush stump
#

Can I spawn an object to player's avatar and follow him around?

frozen tinsel
#

anyone got a clue about this?

warm blade
#

Still fighting with a lock system for teleport

left elk
#

Haiai, This might be silly question but I want to make like a brush that plays different audios when you click trigger (Click 1 plays audio 1, Next click plays audio 2) etc..

How do I do this? If it requires code maybe U# possible?

blazing timber
#

what causes every time I enter a room that will trigger an irrelevant event.

dull stream
#

You can use AudioSource.PlayOneShot which spawns an audio source, plays a sound and destroys it. I think you're better off having one audio source and replace the sound clip in it before playing

left elk
desert grove
#

onUse? also, PlayOneShot is good for optimization just note that it will be a local only sound.

dull stream
left elk
# dull stream Your brush should have a VRCPickup component on it, which has a onUse yeah

I feel so silly, I just don't understand, I try to google on OnUse to see if I can find any documentation / guides on how to use this but couldn't find anything,
Then I realised I had @cunning mist's (Sorry for tag!!) vacuum, It has so if you pick it up and click trigger, it disabled the volume, So I thought I could see in U# how he did it ( https://vowgan.booth.pm/items/3085036 )

However when looking at the U# I don't see anything that uses onuse or what exactly disables the audio, It just "works"

cunning mist
#

You need to have the pickup be Auto-Hold = True, then you use the event "OnPickupUseDown"

dapper lion
floral dove
pallid mango
#

I love non-euclidian spaces, but the prefabs for making them were always a trade secret

wind zenith
#

It's because it deals with this

pallid mango
#

Hope there is a public prefab for us plebs one day so vrchat in general can get less Euclidian

fiery yoke
wind zenith
#

I'm not too familiar with VRchat rendering quirks, got any more juicy info on that?

fiery yoke
#

Honestly Im not either. Im not really a rendering person. I dont even really know what the shaders do that I wrote there anymore.
Something with Z-Buffer Manipulation lol.

wind zenith
#

And how did you deal with the VR stereoscopic stuff?

fiery yoke
#

I didnt. I render everything to the screen lol

wind zenith
#

And what about the cloning / teleportation?

fiery yoke
#

I render everything in a specific order, with different cameras that have different culling masks, and certain stuff is on special layers that are only rendered by some caremas, with special shaders that manipulate the Z-Buffer. Its pretty complex.

wind zenith
#

Could you provide the Z-buffer shader code, or links to resources that helped you with it?

fiery yoke
#

Well I dont really want to dig up my old stuff and try to reason about it right now, because Im working on something else at the moment.
But here is a good general video about portals:
https://www.youtube.com/watch?v=cWpFZbjtSQg

Experimenting with portals, for science.

The project is available here: https://github.com/SebLague/Portals/tree/master
If you'd like to get early access to new projects, or simply want to support me in creating more videos, please visit https://www.patreon.com/SebastianLague

Resources I used:
http://tomhulton.blogspot.com/2015/08/portal-rende...

β–Ά Play video
wind zenith
#

Yeah, I watched it earlier and copied it into a separate unity project (non Vrchat). Still trying to understand it, especially with the PortalTraveller list

fiery yoke
#

Well for VRChat you cant do cloning, so I just render the avatars from the other view onto the screen.

pallid mango
#

Is any of this stuff available for download or purchase? I’ve been wanting to do weird topology stuff for a while

fiery yoke
#

VRChat is kinda "anti" when it come to this, because its unpredictable behaviour where you might end up getting softlocked.

pallid mango
#

I guess I don’t follow

fiery yoke
#

If you are not careful with your cameras, you could end up with very nauseating effects, and because you dont see your menu you cant escape from the world without closing VRChat. Which from VRChats perspective is "not favorable" to the point where none of this is really supported. Its possible. But you are not "supposed" to do it. Plus messing with rendering is very limited, since you have to basically "replace" the actual player camera with your own to precisely control the order.

dawn verge
#

Hey. Is it possible to make a connection from C# / udon? Or is there any mechanism for a vr chat avatar / client to receive input from another program?

#

Ideally I'd make a websocket or similar connection to another program on my desktop and when the vrchat client receives a message, the bones rotate. Simple example

#

So, no traffic through vr chat servers, just a connection I could proxy to create a remotely controlled avatar or something

floral dove
#

The only routes currently possible for communication within Udon are via Logs or Midi. Midi can only currently get data into Udon. We have some plans for bidirectional communication via OSC but no release date yet.

dawn verge
#

ah, glad to hear it's planned at least. I just think some dynamic bone control would be more interesting than a bunch of presets. More avatar quirks with less data!

#

is some really rough communication possible with logs and midi? like logs to read data from the client and midi to upload data to the client?

#

Ah, found the midi docs. That would be a really interesting way to do what I'm trying to, hah. What are logs? Is that just where Debug.Log ends up from vrc?

grand temple
#

yes, it's in appdata/locallow/vrchat

#

avatars can also send debug logs with state behaviours

dawn verge
#

Hah, that sounds like an amazing workaround. But if I defeated PEGA, I can do this!

#

That's not breaking any rules, is it? Using midi input to remotely control an avatar?

grand temple
#

I'm not aware of any way to control avatars with midi, just worlds

dawn verge
#

Oh, darn. I've seen a few worlds with npc avatars walking around, wasn't sure if that was world code moving them or avatar code 😦

grand temple
#

oh, that's 100% world code

#

avatar code is very explicitly different and only applies to actual players

#

if you want to use udon to control npcs, you absolutely can

#

also another way of getting data into vrchat is to use an inputfield. That may be simpler than MIDI, though it will require the window to be focused

dawn verge
#

my hope was a player avatar that could be controlled by some external input, I suppose that's not possible?

grand temple
#

that depends what you really want. Like if you want it to actually have all the properties of a real player then your best bet is to literally just run another client and give it controls as if it was a real player

#

but if you just want a character to walk around, talk to people, do things, then there's no reason you can't just build that with udon

dawn verge
#

an npc that could world hop would be cool too, that's the main "player" feature I am after

#

running a vr chat client and emulating controls to it would also be fine with me! I just assumed that would be treated as botting and that's usually bannable so I asked for an internal / integrated solution πŸ˜›

grand temple
#

as long as you don't modify the client itself I think that's fine

dawn verge
#

last question then would be - can desktop avatars have limbs follow fake "trackers" or would I have to emulate a VR system to, for example, have an avatar wave at someone with Ik?

grand temple
#

You could approach that in two ways. First is to simply make an avatar with those features in the action menu. Literally just animation that play out. The second is to write your own steamvr driver that makes it think there's a headset and controllers and tell it from code exactly where everything is

dawn verge
#

without some mechanism to target and move arbitrary bones in the model, I suspect moving a handful of bones following fake trackers might be the better solution for me

#

thanks

grand temple
#

writing a steamvr driver is far from simple, but if you think you're up for it then I won't stop you lol

dawn verge
#

Yea... first I'll see what I can do inside unity with a desktop model, a bone, and a text input like you mentioned before

#

see what C# can and can't do

grand temple
#

steamvr driver would probably be 100% c++

dawn verge
#

I'm unfamiliar with a lot of that unfortunately. Been programming since the early 2000s but never made a driver

grand temple
dawn verge
#

I thought it might be as easy as launching an emulated controller / tracker and controlling it with a nice simple json api 🦞

#

I didn't realize how locked down the programming part of vrchat might be. Might not be able to make an avatar with ik limbs controlled by another server in the house 😦

#

without that part of the avatar/client api, it seems like even that OSC messaging update won't help that

floral dove
#

The OSC approach includes a new API for controlling avatar parameters and eventually limbs (via tracker movement, most likely)

dawn verge
#

is there a roadmap or timeline for that?

#

it would be awesome if I could position arbitrary bones to have 3+ armed models, but being able to emulate a full body player is a great start!

#

if it's ~1 year out, I could wait for that instead of trying to engineer a steamvr driver... although based on my googling, people would really appreciate one lol

pallid mango
#

First thing I’m doing on it is making true eyetracking so I can’t wait

dawn verge
#

I'm deciding between emulated index controller or building a steamvr driver that can / build a map so I can control a thing as an npc / doing nothing and hoping vr chat is still popular when that feature comes out

#

doing nothing is always a tempting option when a future update might make any work you do before it pointless

#

I see an update from 4 months ago about OSC. I guess learning how that works could be a good use of time

pallid mango
#

It’s more of a general data protocol. How you use it will largely depend on VRChat’s implementation of it

dawn verge
#

ah. so that probably just needs an afternoon to glance at

#

ty for the help everyone, I'll lurk & keep an eye out.

dull stream
pallid mango
#

It sounds like you want a regular Interact script rather than a pickup

#

I believe pickups can only be used while being held

#

You could have two different hotspots, one to interact with it, and another to pick it up

pallid mango
#

There is some property of the game object that controls how far away it can be held. This is different from proximity which is how far away it can be grabbed. If the grab distance is larger than the maximum held distance, it will teleport closer.

#

If they are outside the proximity distance, they can’t grab it at all

#

I’ll have to experiment to see how the grabbable volume is calculated. It might just be the collider.

vocal bison
#

ay so im trying to figure out how to make a combat system with udon but i dont exactly know how to trying to do a gun pvp world anyhelp would be great

autumn oriole
#

is there any way I can check some logic every 1ms? on Update rely on frame, I want something like Thread.Sleep?

coarse parrot
autumn oriole
coarse parrot
warm blade
#

trying to make a lock system for Teleporter - so faar its's not working anyone able to help?

trim sapphire
#

I'm encountering a really strange issue in U# with System.Convert.FromBase64String.
The issue is that if I pass it any sort of variable, it will cause an exception, stating "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters."
However, if I call the function and put a Base64 string in directly, the method behaves as expected.

#

Here, the first line executes no problem, while the second line causes an exception. I've made absolutely certain that the resulting string object from new string(finishedCharArray) is identical to the string I put in the first line.

fiery yoke
#

Ohh this is very unconventional in a Udon sense. Udon does not dynamically allocate variables. It needs to know of all variables existing at compile time.
So try putting your string constructor in a seperate variable before calling the method.

trim sapphire
#

Like this? I've separated out every method return value into its own variable, defined at the start of the file right after the class. I'm then setting these one-by-one in my own method.

#

Still throws an exception when I call FromBase64String.

#

Not sure what to make of it. If I add in:

Debug.Log(new string(finishedCharArray));

Then the string will be printed to the console without issue as we haven't tried to decode it yet. If I then copy the whole string exactly as it appears from the Unity console and compare it like this:

stringEncoded = new string(finishedCharArray);
Debug.Log("dGhpcyBpcyBhIHRlc3Qgc3RyaW5n".Equals(stringEncoded));

...then I get False back. So they're not the same string? But if I print stringEncoded before I do the comparison, then it's... the same string.

#

Let me see if I can replicate this issue in a new, smaller script just for testing this.

fiery yoke
#

Hmmm....odd.

#

Try the same script in C#?

warm blade
coarse parrot
warm blade
# coarse parrot

For some reason i cant connect Get PrivateTP to the getprogramvariable

warm blade
trim sapphire
#

Alright, I just realised it's 8 in the morning and I haven't slept yet, so I'm gonna go... do that. Here's where I'm at:

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;

public class Base64DecodeTest : UdonSharpBehaviour
{
    char[] finishedCharArray = new char[] {'d','G','h','p','c','y','B','p','c','y','B','h','I','H','R','l','c','3','Q','g','c','3','R','y','a','W','5','n'};
    string stringEncoded;
    byte[] rawDecoded;

    void Start()
    {
        // create a string object from the char array and set stringEncoded to it.
        stringEncoded = new string(finishedCharArray);
        // this should print "dGhpcyBpcyBhIHRlc3Qgc3RyaW5n" without issue
        Debug.Log(stringEncoded);
        // this should decode the string and put the return value in the rawDecoded array
        rawDecoded = System.Convert.FromBase64String(stringEncoded);
    }
}

This runs without issue, the base64 gets decoded, and the byte array gets filled with the correct data. So I'm still not 100% sure where the issue in my other script is. Maybe some sort of bug to do with constructing the char array at runtime instead of having it be a constant? The only other difference I can think of between these is that here it runs in a Start() whereas in my other script, the code runs from the MidiControlChange() event. Going to take another crack at this tomorrow and I'll be back in here if I can't get it to behave. I appreciate the help!

warm blade
coarse parrot
# warm blade ?

Drag the variable into the graph and connect line to instance slot

warm blade
coarse parrot
#

PrivateTP should be UdonBehavior type, not gameobject

coarse parrot
warm blade
coarse parrot
#

Yes. Does symbol name the same name as locking variable in lock button udon?

warm blade
coarse parrot
#

Only for doors. Lock button should have a different one

shrewd kernel
#

Hi, Is it possible to make it so when a player spawns in to the world he hears the world music and then walks trough a triggercollider and the music is turned off but only for him, when a another player comes in, that player will hear the music too but the first player should not hear it, so actually the music should be local and stays local.

fiery yoke
#

Yes thats possible :>

shrewd kernel
#

I have only the udon script for global

#

Which component should I use for making it lokal?

fiery yoke
#

Instead of using OnPlayerJoined, just use Start.

shrewd kernel
#

Ok, thats all?

fiery yoke
#

Should be.

shrewd kernel
#

Ok, will try that, ty

fiery yoke
#

When you join an instance with people already in it OnPlayerJoined fires for all users already in the instance including yourself

shrewd kernel
#

Ahh, thats why, ok

#

Ty

frigid granite
#

anyone know how to set up Qv pens on a udon world

celest edge
#

Any tutorial how to make resync button for video players ?

fiery yoke
#

Unless you want to get into the nitty gritty of networking I wouldnt suggest making your own video player. Unless ofcourse you just want to learn something new.
If you just want a working video player to use and dont want to make your own, then I would recommend looking for one someone has already made.
Im currently still working on mine unfortunately πŸ™ƒ

celest edge
#

Well it is always good to learn something new.

fiery yoke
#

Of course. But in this case its relatively complex so there is no "This is exactly how you do this" tutorial. What I mean with that is that people who make this simply know the behaviour of Synced Variables, Networked Events and Video Players themselves. And then use the behaviour of these individual components to create something like a syncable video player. So the in my opinion best way to learn how to make something like that is first learning how the individual components work. And unfortunately I dont really think there is in depth tutorials about those either. Just written documentation and personal experience by trial-and-error

silver geyser
#

how can i make a custom event? when i try to make a custom event in the ''send custom network event'' i need to pick a custom event.. i dont know how to make the custom even tho.. and most of the tutorials on youtube are old and i just see people can type in anything..

grand temple
#

Just add a custom event node from the node search menu. Once you give it a name and make it do something, hit compile and it will show up in the dropdown

teal yacht
#

Hello, when the event OnPlayerLeft is called, how do i get the playerId of the player who left ?

grand temple
#

Hm, it may be too late to query anything about that player, but you could try just doing playerapi.playerid. if that causes your script to crash then onplayerleft is too late

teal yacht
#

it is too late, is there any other option ?

grand temple
#

I guess you could keep an array of all the players and then an array of all their IDs. You can still do a comparison after they have left so you could do a for loop and find which one belongs to that player, then go over to the other array of IDs and pull out the corresponding entry

teal yacht
#

that gonna be heavy for nothing tho... but i guess that the only solution

grand temple
#

I would however question why you need this? I might be able to offer a better solution if you shared what the purpose is

teal yacht
#

It allow me to refresh an UI that keep track of all the connected players

grand temple
#

Oh well then you're probably going to do a lot of for loops anyway to do stuff like inserting a player into an empty slot or whatever

teal yacht
#

Actually yes... so i guess that doesn't change much

#

Is there a way to know the max number of player that can join a world ?

grand temple
#

Not through udon. But you could just put a number somewhere that udon can read

#

The hard cap is (soft cap) * 2 + 2

teal yacht
#

Well, i guess i'll do a public var then

#

yeah but how to know the soft cap ?

grand temple
#

That's the number you specify when uploading the world

teal yacht
frosty spoke
#

hey im having trouble with vrchat it keeps disconnecting

tacit pasture
#

Anyone have any documentation or prefabs etc of the audio boost area for vrc, like where you stand in it and it makes you louder for other players?

desert grove
tacit pasture
#

thanks a lot

tacit pasture
#

guess i can use an older version

desert grove
#

just inspect the releases and download the one before the 2019 update yeah. But you really shoudlnt be using 2018.

tacit pasture
#

sweet ty

wintry radish
#

Hey I would like to have a cube that you can pick up and when it enters a trigger it should turn off gravity.
My issue is... How do I get the rigidbody component from a gameobject?
I don't quite understand the GetComponent thing yet.
I don't want to add a rigidbody variable because if I clone that cube it will still use the rigidbody from the original cube.
(I'm using Udon Graphs btw)

desert grove
#

No, when you duplicate an object with a component it reads its own component. As for a graph, I cant help you with that. Script only.

floral dove
wintry radish
#

Hmm well thanks. I'll take a look at that

wintry radish
#

Okay I figured it out, but it doesn't seem to apply it when I set use Gravity to false via udon graphs.
Do I have to do something special with networking or why does that happen?

floral dove
#

Are you sure this logic is running? You can add a call to Debug Log to see if it is, and to make sure that the component you're retrieving exists.
BTW - no need for a 'self' variable. You any 'instance' input that needs a GameObject, Transform or UdonBehaviour will default to self.