#udon-general

59 messages · Page 64 of 1

manic yarrow
#

I've got the timesincelevelload set up

grand temple
#

to the same number every time, or to something else?

manic yarrow
#

so I can set it to -1

grand temple
#

oh, you need a float const node

manic yarrow
#

Networking IsOwner next, right?

#

Not sure

grand temple
#

yeah, just a series of branches to make sure that every case is observed before doing the respawn

manic yarrow
#

hmm, about that owner check

#

What if someone else grabs a seat you're in?

grand temple
#

then it will transfer to them and they will do the respawning

#

but they'll still receive the onenterstation from you, and so the float will be -1 and they won't respawn it until you get off

manic yarrow
#

Which node outputs parents to an obj?

grand temple
#

transform getparent

manic yarrow
#

I tried that one, it doesn't connect to IsOwner

#

unless there's more than one IsOwner and I haven't noticed

grand temple
#

isowner expects a gameobject

#

so you can just do transform get gameobject

manic yarrow
#

or do I?

#

It should be getting it from the getparent at the start, no?

grand temple
#

this part is not correct. You're checking if timer is greater than timer + 30 but that will always be false. You need to check if time.timesincelevelload is greater than timer + 30

#

the ownership check looks good

manic yarrow
grand temple
#

yep

#

also make sure you're plugging something into objectsync respawn. Easiest would be getcomponentinparent (vrcobjectsync)

manic yarrow
#

Does it have to be blank?

#

I have one in this graph but the type is set to vrc_pickup

grand temple
#

what, getcomponentinparent?

manic yarrow
#

yeah

#

it's set to type with pickup attached

grand temple
#

the instance there can be blank because it's just looking for a transform. Transform, gameobject, and udonbehaviour will always self-reference in graphs if left blank

manic yarrow
#

So I should make a new one

grand temple
#

I'm not sure what you're asking

manic yarrow
#

I was just trying to re-use a node I already have

#

but it has a type attached to it

#

I wasn't sure if that would affect it

grand temple
#

yeah you don't want to directly re-use it because it's not the right type. But you could copy it and then change the type

manic yarrow
#

which type?

grand temple
#

vrcobjectsync

manic yarrow
#

alright

grand temple
#

that's what respawn is looking for

manic yarrow
#

So will that cover both sitting and picking up?

grand temple
#

oh right, you'll want to set the float to -1 onpickup and time.timesincelevelload on drop as well

manic yarrow
#

How would I refer to the parent in that scenario?

#

since I can't attach anything to events

grand temple
#

the parent has the onpickup and the child has the timer float. So just have onpickup > getcomponentinchildren (udonbehaviour) > setprogramvariable "timer"

#

or you could rearrange it so that the variable and the update loop is on the parent, that may make more sense

manic yarrow
#

The reason it's on the child is because there were some issues with it being on the parent

#

I can't remember what the issue was, but having the script on the seat fixed it

grand temple
#

like what, being able to detect onstationenter?

manic yarrow
#

that might have been it but this was a few days ago now

grand temple
#

you can't detect events like that happening on a separate gameobject. That's why you put a script on them and then send the events or the variables back to another script. You're going to have to communicate between them somehow

manic yarrow
#

I feel like the way you suggested is easier

grand temple
#

I would also just recommend having public udonbehaviours on each to refer to eachother instead of doing getcomponent all the time. It's not a huge deal since you're not doing any of this every frame, but it does reduce the number of nodes going on and also allows you to make use of the fancy dropdowns on setprogramvariable and sendcustomevent

#

getcomponent is relatively expensive because it has to look for things by checking a bunch

manic yarrow
#

I assume I'll need to make the timer public now

grand temple
#

yes

#

wait I mean no

#

setprogramvariable can set private variables

#

in udon, public really just means that it will show up in the inspector. Which doesn't exactly match C# but oh well

manic yarrow
#

yeah, that's what made me think I'd need to

#

so just make a variable with the same name then?

grand temple
#

if you want to move it, yes. If you want to set it on another udonbehaviour, no

manic yarrow
#

It's just that I don't see how I'm meant to refer to it otherwise

grand temple
#

setprogramvariable

#

if you have the udonbehaviour as a public variable, it will populate the dropdown with that program's variables. If you are still using getcomponent, you have to plug in a string const and make sure it's spelled exactly the same including capitalization

manic yarrow
#

oh, it's just a string

#

alright, I think that's everything

grand temple
#

no, the instance is left empty so that will refer to itself

#

you need to do getcomponentinchildren (udonbehaviour)

manic yarrow
#

I don't see it under udonbehaviour

grand temple
#

I mean gameobject getcomponentinchildren, then plug in the udonbehaviour type

manic yarrow
grand temple
#

no, not that

manic yarrow
#

wait

#

it must've corrected

#

just noticed it's the wrong node

grand temple
manic yarrow
#

yeah, I typed "type" a little too quickly

#

I dunno

#

with that swapped, is that everything?

grand temple
#

yeah probably

manic yarrow
#

Just to be sure, what happens when the world starts and nobody has touched anything?

grand temple
#

oh yeah, you probably want the default value to be -1

#

but worst case it would just respawn to where it already is ¯_(ツ)_/¯

manic yarrow
#

I suppose having an object teleport an inch every 30 seconds isn't bad

grand temple
#

well after respawning it, you want to also set the variable to -1 otherwise it will be respawning every frame

manic yarrow
#

So I just tack that on the end of the script

grand temple
#

on the update loop, yes

manic yarrow
#

would it be better before the respawn? I don't know how it works but I can imagine it might have the chance to trigger a few times

grand temple
#

it does not matter since everything that goes through the flow happens instantly. There is no possibility for udon to execute this twice before it's finished once

manic yarrow
#

Oh right, white line and all that

grand temple
#

if you have some really complicated math that takes time to do, it will freeze the game entirely until it is finished

manic yarrow
#

I was thinking about lag and stuff, I used to write E2s for garry's mod and sometimes you'd have to account for that kind of thing

grand temple
#

yeah, then it probably ran on multiple threads and so you can have different threads doing different things or even the same thing at the same time. But udon at the moment always runs on the same thread, so performance is worse but it's much easier to keep track of everything

manic yarrow
#

VRChat needs multithreading joke goes here

grand temple
#

plenty of other things are multithreaded, especially constraints, networking, and voice transmission. Making code that is multithreaded is one thing, making a VM that allows people to make their own multithreaded code is another thing entirely

manic yarrow
#

am I missing something? doesn't seem to work

#

sync mode, anything like that?

grand temple
#

pics?

#

any udonbehaviours crashing?

manic yarrow
#

first one is on the seat, second one is on the pickup

#

neither of them cause a respawn after 30 seconds

#

just in case, I'll compile again and make a new build

#

maybe it just didn't apply

#

nah, didn't help

manic yarrow
grand temple
#

not crashing on compile, I mean crashing ingame

#

check your logs

#

ah, vrcobjectsync GetType is not correct. That's asking for a vrcobjectsync and will give you the objectsync type which is... not what you want. Probably one of those weird auto-generated nodes that isn't really useful.

Instead you need VRCObjectSync Type

#

I tried looking and I have no idea what folder this node is in, but again if you don't know where it is you can always find it in the full search with tab!

manic yarrow
grand temple
#

sounds like the script on the pickup is crashing from something

manic yarrow
#

I can send you the log if you want

grand temple
#

you can look at it yourself, just search for "halt"

manic yarrow
#

no halts

grand temple
#

ok, then it's not crashing. Try adding a debug log after the setprogramvariable to make sure that's happening

manic yarrow
#

what should I search for?

#

searching "debug" didn't do anything

slim hound
#

Searching for "Log" should bring it up as the first option

manic yarrow
#

inside the log itself?

slim hound
#

They are nodes in the graph that you add to debug your udon programs

manic yarrow
#

I've added them already

#

I'm sifting through the last game's log

slim hound
#

You should just be able to search for whatever string you were logging

#

How do you have the log in the udon graph setup?

solemn talon
#

Anyone got any ideas for raycasting to detect the presence of a player?

#

My layer mask includes both the Player and UI layers but the ray doesn't seem to work with players, at least in "Build and Test"

manic yarrow
slim hound
solemn talon
#

SDK3 and Udon

slim hound
#

Yeah I was asking more of the udon behaviors and how they are set up

solemn talon
#

Basically just raycasting in the forward direction from a GameObject

slim hound
#

If you were trying to follow that article it would be a fairly roundabout way to do it in udon

solemn talon
slim hound
#

So does each player have their own raycast or does each player have their own collider?

solemn talon
#

Each player should have a collider that is detected by a raycast

#

And blocked by objects on the default layer

#

The raycast is blocked I mean

slim hound
#

So do you have an objectpool that assigns them to each player?

solemn talon
#

I haven't done that, I associated the canvas element with the main camera, I thought that would populate it

#

I can give that a shot though

#

Basically just what that article said, but with a bigger box collider

slim hound
#

Udon has built in functions to do all of that without the roundabout methods

#

You should ignore that article since you are using Udon

#

If you have an object pool you would assign an object to each player and give them ownership of it, then in the graph get owner > get position of owner > move game object to that players position

solemn talon
#

I'll start working on trying that out, just to be clear I create a pool of GameObjects collider components on an appropriate layer that no actual collisions happen, assign them to players as they join, then raycast against the GameObjects that are on each player? With the GameObjects updating their position every tick?

slim hound
#

Yeah, for the raycast though you would need to use a networked event or alternatively have an object pool for giving players the raycasts also

solemn talon
#

Cool, sounds promising. Thanks for your help!

manic yarrow
slim hound
#

I prefer GetChild as you can give it an value of which child specifically

#

Though you only have one game object as a child right?

manic yarrow
#

yeah

#

wait, 2 actually

#

one of them is a seat entrance point

manic yarrow
slim hound
#

That graph you sent should be fine

#

The other part is probably where the issue is

manic yarrow
#

that other part works perfectly for what it does

#

all that second graph does is poke some new values in

slim hound
#

What does the respawn function look like?

#

And to clarify that is the part that isn't working right?

manic yarrow
#

This part works great for the seat (which is what the script is attached to)

#

so things respawn correctly 30 seconds after getting out of the seat

#

but the other part is what's wrong

slim hound
#

Wrong how?

grand temple
#

can you just try using public variables instead?

manic yarrow
#

all I know is that it doesn't do what it should, and instead does nothing

manic yarrow
grand temple
#

I mean to replace all the getcomponents

#

manually define exactly what you want to do instead of just assuming that it's set up a certain way

manic yarrow
#

On both scripts?

grand temple
#

yes

manic yarrow
#

I realised something though

#

Is there a chance that the pickup script could be interfering?

grand temple
#

you're going to have to get it the rest of the way yourself. There's a lot you can do to find out why it's not working. Try logging every step of the way in the update loop so you know where which part is stopping. Try logging the variable so you know what's happening. Try logging the name of the gameobject you get from getcomponents so you know for sure it's getting the correct thing.

burnt moth
#

trying to make a toggle where you click it and npcs disappear and appear, like On/Off but for multiple objects and this isnt working so far

#

I’ve read so much and tried to learn but it doesnt work

burnt moth
burnt moth
#

They turn off and then they wont turn on anymore

slim hound
#

Show graph?

burnt moth
slim hound
#

In the inspector in the object array you don't have any missing elements do you?

burnt moth
#

you mean the array where I put the things turned off and on

slim hound
#

Yeah

burnt moth
#

no since it's turning off properly

#

there is something with the graph or something

#

the sync method is contineous

#

the first time I click it, it's doing what it should, but the npc's wont come back when I click it again

slim hound
#

Are you testing in game or in editor with CyanEmu?

burnt moth
#

I built test it

#

with the skd

#

sdk

slim hound
burnt moth
#

but it didnt work in vrchat

slim hound
#

Yes that will make it easy to figure why it didn't work

burnt moth
#

someone told me to make a bool to fix my array

#

maybe thats why

#

he told me to do this

#

but I didnt understand how

slim hound
#

What are the NPC objects you are toggling?

burnt moth
#

just npcs

#

like gameobjects

slim hound
#

Can you change the udon behavior to toggle a couple of cube game objects instead and see if that works?

burnt moth
#

okay I'll try

burnt moth
#

the thing I am trying to disable is a trigger with the model as a child so I disable both the trigger and the model

#

cause it would be weird to speak to a non existent npc

slim hound
#

Yeah that's kind of what I figured

#

Something with the NPCs is changing when you toggle them

#

If you get CyanEmu you can test in editor and see what is happening

#

Or you could just go into play mode and toggle them manually

burnt moth
#

hmmmmmm

#

I'll try and see if it works if I seperate them

#

like not being parents and childs

#

then I'll try like you said

burnt moth
#

thanks for the graph!!!!!

#

you are a lifesaver

burnt moth
#

is it possible to make a working boat that you can drive

#

basically just a car but just shaped as a both or used a finished model and add some sort of graph to it

cold raft
#

that is already posable

#

you could look up varneon on yt he makes realistic driveable cars

burnt moth
#

okay

#

I am also wondering if it possible to make where u click on a toggle and an animation plays, but you can only press it once and then you gotta wait until the animation finishes or a certain time before being able to toggle it again

#

for some reason when I jump avatar pedistals like go invisible but when I am on the ground I can see them

cold raft
#

Yes you can disable buttons for x time while animation is playing

#

this disappearing when you jump has todo with culling to over aggressively

hushed gazelle
#

If I Destroy a synced gameobject, does it destroy it for all players or just locally?

grand temple
#

just locally

pure parrot
#

hey guys , i did a small graph to change the colour of an object when a player step on it . I put a cube as trigger but nothing ever happens and idk why . I don't think that the animator part is falty since i tested this specific part and it was working

slim hound
manic yarrow
#

What counts as an update to the update event node?

grand temple
manic yarrow
#

ah, that throws a theory out then

#

I was thinking that whatever I was doing on the external script wasn't counting as an update

#

as if an update happens when there's a change of some kind

pure parrot
#

Is it possible to only use 1 OnPlayerTriggerEnter event for multiple SetBool ?

#

I'm making multiple trigger zone and Idk if I need to make a graph for each one of them or just making a single graph for everyone

slim hound
#

Also in your use case it might help for you to know that OnPlayerEnterTrigger will trigger whenever any player enters the area not just the local player

pure parrot
#

I want to make a system where I can detect how much person there are , there's 8 platform and when a player step on it the colour goes white to green , if the player isn't on it anymore it turns back to white

#

Thinking about it this is extremely dumb , I could just make a graph for the material switch part and then do something to count how much person there is when someone press a bouton

#

problem , idk how to do that

slim hound
#

You could use the OnPlayerTriggerEnter to count how many there are too

#

You would just need to branch for either local player or master

pure parrot
#

what's the use of knowing if the player is local or master ?

slim hound
#

Otherwise everyone will add to the number when they see someone EnterTrigger

#

So one player entering will add 5 if there are 5 people in the world

scarlet lake
#

how do i make where if you throw a object of the map it respawn

slim hound
#

Adding an object sync component will give it that behavior

scarlet lake
#

also what making a object bounces

slim hound
scarlet lake
#

this ?

slim hound
#

In assets right click > create > physics material

#

On that material make it bouncy

scarlet lake
#

i meant for when it falls off

slim hound
#

Falls off?

scarlet lake
slim hound
#

Add an object sync and if it falls out of the map it will respawn

#

Other than that you would do ObjectSync.Respawn or transform set position to move it back

slim hound
scarlet lake
#

what is timer and single under

pallid mango
#

Example: a jump scare in a horror map. lol

#

Master - I have not had any use for this in udon. Useful if you want the person who has been in the room the earliest to have special abilities I suppose

scarlet lake
#

because in this it say timer but when i try to find its no were

pure parrot
#

ok thx for the answers

scarlet lake
#

?

scarlet lake
slim hound
#

They will be under float

floral dove
scarlet lake
slim hound
scarlet lake
#

im not the new

#

its just lol im stuck on this part

scarlet lake
slim hound
#

Just watch some of these to get a better understanding of what things do https://www.youtube.com/watch?v=7yuj7X0-OuI&list=PLwEtUGCdQX7HMkFCVxiNvO4DS2CmHWbe6&index=9

Let's say you want something to happen when you push a button, but not right away. Well, we can set up a timer to do exactly that! My apologies for any audio weirdness, but I refuse to turn off the air conditioning right now and did my best to edit it out. The trucks going by however didn't manage to get edited out.
Note: If you'd like the timer...

▶ Play video
scarlet lake
cunning mist
cunning mist
#

So that I can get a quick breakdown, what is it you're trying to do?

late belfry
#

anyone know why pool tables cause my FPS to drop to 10?? please help

pallid mango
late belfry
#

is it my 3090???

floral dove
late belfry
#

ohhhh. ok. thanks

scarlet lake
#

How do I make the pick able object global

scarlet lake
#

so

#

i dont get it

cunning mist
hybrid fossil
#

A question.

Is Udon applicable to VRC worlds, or can it be used for setting up unique animation for avatars as well?

cunning mist
#

Worlds only, though you can do a lot through Avatars 3.0!

scarlet lake
#

where can i find this under

grand temple
#

that looks like a variable, but it's very very old. Nowadays variables are added in the floating window on the left with the plus button

scarlet lake
#

because this udon im trying to make

grand temple
#

if that's a picture from your own graph, make sure you have the latest SDK. If you're following a tutorial, find a more up to date one

compact snow
#

Anybody aware of the workaround for Dropdown.AddOptions? I'm trying to dynamically update the dropdown menus but udon doesn't support List types, so i can't ? (forgive the noob)

grand temple
#

Unfortunately no, you cannot

compact snow
#

☹️ bugger

grand temple
#

Best you can do is create your own version of a drop-down out of buttons, vertical layout group, and instantiating

compact snow
#

hooo baby -.- I'll er.. consider that. thanks Phase

feral valve
#

Just asking if possible. Can you make a box collider not allow portals to be placed in them? I don't see it as a feature and curious if it can be done with udon by deleting it or straight up not allow it

feral valve
#

though if it is possible how can I make one

#

cause idk how you can get a gameobject thats spawned and delete it

slim hound
#

If you make the box collider an assigned spawn point on the scene descriptor it will give users the "Portal too close to spawn" message when they try to drop one

#

You may need to have multiple depending on the size of the box collider

feral valve
#

I was hoping I could just scale the collider and it work. but I guess I just have to useless spawn points. only testing

#

Hopefully there's another way

#

Or a way of discouraging it like respawning them

obsidian solar
#

Is this still a feature? I'm trying to create an object that can be held in 2 places.

flint urchin
fiery yoke
#

Is there a way to "Unload" a Video Player? Basically I just want to release the resources on demand.

obtuse agate
#

videoPlayer.Stop() ?

fiery yoke
#

Stop doesnt unload the video. It simply stops playback.

floral dove
fiery yoke
#

The weird thing is that youre able to Play() after Stop() which plays the video

#

So does it "remember" the last video and fetches it again?

floral dove
#

Hm - there's not a direct 'callback' pattern available, but you could have a variable that uses an OnVariableChange event - pass that into another program, and when the variable is changed your first program will receive an event with the updated value

#

it's more like C# properties than callbacks, but may get the result you want

manic yarrow
#

How can I set a variable in a udon graph using a separate udon graph? I've tried setprogramvariable attached to getcomponentinchildren, but that didn't seem to work too well

obtuse agate
fiery yoke
#

I use a pattern where I have an array of UdonBehaviours that acts as a "subscriber" list. When an event happens, I iterate through the array and do a SendCustomEvent to all valid Behaviours in the array. I use the array as a ring-buffer with an additional indexing integer that overflows at Length back to 0 and increments whenever you add a behaviour and skip over nulls unless no slot is available.

However this only works for events without parameters.

fiery yoke
floral dove
fiery yoke
#

Ahh I see it works because the actual video file is kept in a temporary memory somewhere.

pallid mango
manic yarrow
#

I'm on the latest SDK and I've not seen that

#

This is what I tried last

#

It was suggested to me to use public variables, but I broke something in the process and reverted

swift jolt
#

Is there anyway to detect if a player is crouching in udon?

normal yarrow
#

Does anyone know a good way (or asset) to make good looking volumetric spotlights that are VRChat compatible?

manic yarrow
#

I've definitely seen volumetric shaders before

normal yarrow
#

Ahh, yeah that does seem like a better channel to ask in

valid oar
#

I'm working on a world where I want people to be able to move forward and back through pages of text using text objects that appear and disappear in a sequence. I would imagine this would be done via an array that would store the various game objects and then hide the game object at the current element and show the one at the previous or next element depending on whether the button to go forward or back was pressed. I think that's how it would be done but I don't know how to translate that to Udon. I know there's a prefab that allows for different materials to be swapped so I could do it that way but that only goes in one direction and using text objects seems like it will use a lot less space than having a bunch of materials with their own textures.

#

I could hard code it so if I press the forward button on page 1, it has a script that hides page 1 and shows page 2 but I'm planning on having dozens of pages and making a separate script for each wouldn't be ideal if I can avoid it.

floral dove
#

synced, even

valid oar
#

I will do that, thanks.

uncut tusk
#

i have a question, anyone know how i can make a Trigger for Toggle GameComponent ? Like when i Trigger it, it will turn off the Animator inside the Object but the object stay On.

floral dove
#

Sure - you can make the Animator a variable and then control it's 'enabled' value or have it Stop()

uncut tusk
#

waht you mean exacly? i have my little problems with the Udon Graph 😅

floral dove
uncut tusk
#

Not very far xD I can't even create a simple trigger without help😅

floral dove
uncut tusk
#

I don't need that for an animator to be honest. I want to insert a button that allows you to turn a pressable button into a clickable one. depending on the user is in VR or desktop

floral dove
uncut tusk
#

okay thanks i hope i can work with that

floral dove
#

once you know how to use the Interact event and you have that working, you can then add an Animator variable and control that instead

manic yarrow
#

@grand temple I finally got it all working, although I noticed a minor issue

#

If someone is sat in the seat and then someone picks it up and drops it, the 30 second timer starts back up and the seat will respawn with a player sat in it

#

this is what I ended up doing, a public variable that points directly to the seat like you suggested

grand temple
#

so add a bool for when it's currently being sat in and don't set the float if so

#

and likewise for being held while getting out of the chair

manic yarrow
#

station seated, right?

grand temple
#

yeah

manic yarrow
grand temple
#

you're just allergic to public variables aren't you?

manic yarrow
#

I tried using the public variable I already had, wasn't sure how it could connect

grand temple
#

is it a vrcstation variable?

manic yarrow
#

It's less that I'm allergic to public variables, and more that I'm allergic to knowing variables have types

midnight beacon
#

Has anyone had this problem? Vector types wont display properly, they're totally busted

grand temple
#

just reload the graph at the top right

midnight beacon
#

Tried, no dice :C

#

(using 2019 btw, I should mention that just in case)

manic yarrow
grand temple
#

oh that bug, yeah it's known and will be fixed soon

midnight beacon
#

Oh okay, thanks for the heads up o7

grand temple
#

actually wait, what kind of constructor is that?

midnight beacon
#

MeshCollider, but the display issue happens on basic Vector3 types

grand temple
#

vector3 constructor looks like this to me

#

meshcollider constructor isn't a thing

midnight beacon
grand temple
#

ray constructor looks like this to me

midnight beacon
grand temple
#

let me double check with the latest SDK

grand temple
#

ohhh it's a vector3 const node, not a constructor

midnight beacon
#

Theres both a ray constructor and a Vector3 node thats busted

#

Seems to be whenever theres more than one column of values

grand temple
#

ok, thanks. That one is slightly different to the other issue so it was not on the radar

midnight beacon
#

Hooray for finding bugs. I was hoping this might be some common simple fix thing which is why I asked here first but thanks for discussing this with me, ill see if I can get it reported if I can't fix it.

grand temple
#

already thrown it in the pile, don't worry about it

midnight beacon
#

Oh, much appreciated ^-^

grand temple
#

if you need a workaround for now, though, it should work if you just plug public variables into the slots

#

if the slots have something plugged into them they won't display the full inspector so they will properly display the output

#

or if you want to define it in the graph instead of the public variables, you can use a vector3 constructor node

manic yarrow
#

Is get seated definitely the right node?

#

I just tested it with a friend and they still respawned

grand temple
#

probably, but it may only work for the local player

manic yarrow
#

I'm asking because "seated" is a checkbox on the station script itself

#

I don't think it's related to whether someone is in the seat

#

but I can't be sure

grand temple
#

oh yeah you're right, that's a property that changes how you attach to the station

manic yarrow
#

Hmmm

grand temple
#

just set a bool onstationenter and exit

manic yarrow
#

alright, give me a moment

feral valve
#

Thought I'd try asking again. Anyway to delete created portals in within a collider?

grand temple
#

you mean you want the world to prevent players from placing portals in a particular location?

feral valve
#

yeah

floral dove
feral valve
#

So there really is no other way

grand temple
#

you can also just prevent placing any portals anywhere in the vrcworld

feral valve
#

box collider didn't change anything when I tried it.

grand temple
#

but if you want to deny a specific location, then yeah I'd recommend spawn points

feral valve
#

spawn points I'm guessing only cover 4 square meters

#

So how would I make them not a actual spawn point

grand temple
#

udon has an onrespawn event, so when that happens just teleport them to where you really want

#

oh, onspawn not onrespawn

feral valve
#

alright, ty

floral dove
#

you can have the Spawn Order be 'first' and put your portal-protection spawn points after the first one

#

I think? Never used anything but 'Random' for Spawn Order

manic yarrow
grand temple
#

you're setting it to -1 onpickup, so that's not the one you want to block if they're seated. You want to block the one that's causing it to actually get respawned, which is the ondrop

manic yarrow
#

oh, right

grand temple
#

yup

#

and add the opposite to onstationenter

manic yarrow
#

what if someone sits and leaves?

grand temple
#

while someone is holding it?

manic yarrow
#

now you mention it that's a very specific set of circumstances

grand temple
#

the time will be set by whichever event comes last

manic yarrow
#

does quitting VRChat count as onstationexit?

grand temple
#

I have no idea

manic yarrow
#

Hopefully it does

#

otherwise it's possible for someone to sit and then quit

#

and then that chair is technically being used the whole time

#

(until someone else sits in it)

grand temple
#

That's not what you want. Setting it to -1 prevents it from respawning. If you pick it up, you always want to prevent it from respawning

manic yarrow
#

Is that in reply to the graph I just put together?

grand temple
#

yeah

normal yarrow
#

I notice that when I play an audio stream online and I put an effect, like reverb, all of a sudden the volume is maxed out and it can't be changed

#

Seems like a bug?

manic yarrow
grand temple
#

onpickup and onstationentered shouldn't have a branch at all

manic yarrow
#

I thought I needed that to check if the seat is being used

#

since I've got this bool that determines if someone is sat down

grand temple
#

yes, but you're using that to prevent it from being respawned when someone is sitting

#

picking it up doesn't start the respawn timer, it stops it

manic yarrow
#

I'm still not sure what you meant by "add the opposite to onstationenter"

valid oar
#

Is there a way to set all of the objects in an array to active? I tried reverse engineering the chooser script and came up with this but it doesn't appear to work. Do I need to cycle through the array and enable all of the elements individually or can they be handled as a group?

cold raft
#

you need a for loop

#

alternatively you could put all objects under the same parent in the hierachy and toggle that parent instead

valid oar
#

Unfortunately they need to be parented to different objects because those are all in another array that is being controlled by the chooser from the Udon Example scene. I have a very limited background in programming so I know how those work but not how to create them with nodes. Is there a tutorial you could recommend for that sort of thing? Most of the tutorials seem to either be very basic or focused on advanced networking.

cold raft
#

yeah udon tutorials are indeed either basic or advanced 😄

#

so kinda like this

valid oar
#

That's great, really appreciate it. It kind of even makes sense at a glance which is always nice.

stark adder
#

Is there anyone having this same problem ? where the Upload just fails MID upload like 50 times before I can finally upload it ? It gets really annoying

#

I am starting to go little crazy 😵

gusty tusk
#

Is Udon running c# code in real-time or does it get compiled like when Kotlin compiles Kotlin code to java code? And since if there's another high-level added, how much of a performance decrease would it be if i wrote in c# rather than using the Udon system?

cold raft
#

So both udon graph and udonsharp compile to udon assembly using IL2CPP, so udon# will be just as fast as udon graph

gusty tusk
#

Any overhead (comparing to before Udon) to keep note of? Thanks for all the replies!

cold raft
#

well udon is not as fast normal c# as there is indeed overhead on it but there is no way around that for vrc your only scripting abilities are udon, still udon is quite powerfull i never found it slow

gusty tusk
#

Ah, bummer. Cheers!

blazing timber
#

I want to teleport the player who toggled the button with their names on it. So far I made a udon can get the displayname who interact the button, but it’s only work locally. Need help.

cold raft
#

why do people keep implementing on ownership transfered

#

anyway what you need todo, isa syncronised variable of type string that you call like displayname
and instead of setting the text directly you should change the value of displayname and than request serialisation
then you need to alt+drag that new variable to create an onchanged event for that variable and in there you can update the textfield

#

like this

blazing timber
cold raft
#

Ah yes the variable changed stuff is very recent

stark adder
#

Is on variable change executed even when variable is not changed (manual sync RequestSerialization)

cold raft
#

I never tested that, but it would be pretty wierd if that is the case

floral dove
swift jolt
#

Is there anyway to detect crouching in Udon?

slim hound
keen socket
#

So, I've looked everywhere and can't find any good info on timers. I need a simple timer that after a collision waits x time and the continues on the graph. Watched a video or two, but was looking more for documentation... of some sort. Any info would be great 😉

grand temple
#

you're looking for sendcustomeventdelayed

keen socket
#

yee! thanks

sacred thicket
#

Hello, I have a little question: Is there a node in Udon that is basically the C# equivalent of "WaitForSeconds" so I can for exemple play a sound then wait 1 second and then teleport the player?

#

Oh wait, I think the question above answers it X3 Sorry!

random orbit
#

Guys I cant seem to find (transform.set position)

floral dove
#

type Transform, press Enter, type setposition, press Enter.

random orbit
#

Thank you

random orbit
#

Im having some issues with a graph that i made for some reason the door doesnt move but you can walk through it like hit has opened

grand temple
#

is the door's gameobject set to static?

random orbit
#

Yes

grand temple
#

disable that

#

static means it shouldn't move

random orbit
#

Bruh

#

Aight im pissed Thank you

scarlet lake
#

Does anyone know how to keep a player stable on a platform? Thank you, if you can help

floral dove
scarlet lake
#

Can you please show me, I’m trying to make a subway train and through the seats a do-able I want people to be to walk within the collision mesh

floral dove
scarlet lake
#

Ahhh thank you for your help

normal yarrow
#

Does the regular Unity Video Player component work in VRChat?

floral dove
# normal yarrow Does the regular Unity Video Player component work in VRChat?

you need to use our special wrapper for it - full details here: https://docs.vrchat.com/docs/video-players

normal yarrow
#

Oh I see, I wanted to play a local video, which I didn't see the option to use on these ones.

normal yarrow
#

Oof, that's unfortunate.

#

Guess I'll need to find a workaround.

floral dove
#

The workarounds are listed on that page! You can host it on a server and provide a direct URL link, or use one of our supported video hosts.

normal yarrow
#

I need local videos cause I need movie graphics for WWE entrances in my arena map, if I used those, I wouldn't be able to load all those graphics at once because of the rate limit.

#

(For context)

floral dove
#

right - if you want to have multiple videos playing, you'll need to queue them up with 5-second-ish delays when someone joins

normal yarrow
#

Yeah that unfortunately wouldn't work out, it'd take too long for all the graphics to change.

floral dove
#

how many different videos are you trying to load at once? Could you combine them into one?

normal yarrow
#

5 graphics.

#

1 for the main tron, 1 for the mini trons below, 1 for the floor ramp tron, 1 that's used on the ring apron and ring corner post trons, and 1 that's used on the side stage (and arena ribbon) tron.

#

If I could put them all in one, that would make sense, but the each of the graphics usually has their own different time length, making looping very difficult

#

Quite the sticky predicament I'm in.

floral dove
#

oof - you're likely to suffer a pretty big performance hit trying to play 5 videos at once on most machines. You could instead put them all in one video and split it up using UV mapping to have it play on the right sections of your models.

#

if they're very short, you could try turning them into sprite sequences and playing them through animators, but that can take quite a performance toll as well

normal yarrow
#

Hm...

#

Seems like there's no easy way to do this, lol

floral dove
#

no, you're trying to do a complex thing 😛

normal yarrow
#

True, lol

normal yarrow
#

I should mention the videos are pretty short, usually a couple of seconds long on loop

#

At least for everything but the main tron graphic, which is usually a good bit longer.

floral dove
#

You could combine them all into one video and loop the shorter ones long enough to match your longest loop, then map them all to the different surfaces

#

then you only need to load and play one video

normal yarrow
#

I can try that

serene shale
#

ETA on dynamic loading of externally hosted images?

dim horizon
#

And here's the result

#

I just basically have a camera pointed at the YouTube player screen and then mapped out the UVs for each TV to show a different section of the screen.

fading cipher
#

Is it a known bug that Input events don't run when the user has their VRC quick menu open?

dapper lion
#

i thought that was normal?

pallid mango
fading cipher
#

I mean if you release your grip, InputGrab doesn't run

#

That's pretty dang important if you're programming things to happen based off that and simply opening your quick menu completely circumvents it huh

#

I'd 100% call that a bug even

pallid mango
#

Yeah that sounds like a bug. At the very least opening a menu should release the grip

#

Report it on canny?

stray junco
#

how to disable (close) UdonGraph welcome screen
so i can work with my UdonGraph normally

any suggestion?

cold raft
#

yes goto an udongrapth behavior in the inspector and click open graph

dapper lion
#

are teleports currently teleporting to spawn on the 2019 unity version? been having issues and the scripts work on 2018 but not in OB

floral dove
floral dove
dapper lion
#

how does graph look? maybe somethings changed and im not seeing it

#

i totally did not just close the project that had the teleport script in it

stray junco
#

btw if this error log mean something to you
here:
BestHTTP.HTTPRequest/<>c__DisplayClass237_0:<SendHeaders>b__0 (string,System.Collections.Generic.List`1<string>)
BestHTTP.HTTPRequest:EnumerateHeaders (BestHTTP.OnHeaderEnumerationDelegate,bool)
BestHTTP.HTTPRequest:SendHeaders (System.IO.Stream)
BestHTTP.HTTPRequest:SendOutTo (System.IO.Stream)
BestHTTP.HTTPConnection:ThreadFunc ()
BestHTTP.PlatformSupport.Threading.ThreadedRunner/<>c__DisplayClass4_0:<RunLongLiving>b__0 (object)
System.Threading.ThreadHelper:ThreadStart (object)

floral dove
cold raft
#

yes click on that new program button

stray junco
#

@floral dove
oh so i need to open UdonGraph tab first
and then to open in inspector
ok got it
ty 👍

floral dove
stray junco
#

@floral dove
ah what can i say...
i was so stupid
because i didn't see on right side the name of the button
because i didn't expanded inspector menu to the left side
sorry for all this nonsense i cause 😒

floral dove
storm sable
#

Has someone already conducted a test, on how heavy SendCustomEventDelayed() is? I want a event to be fired every <1s, based on if a flag is set. Is it better to use Update(), checking a time variable, or queuing the event every time with SendCustomEventDelayed()?

grand temple
#

it's definitely faster to use the delayed event because that runs outside of udon

storm sable
#

Perfect, thanks!

supple flicker
#

It says I'm not using the right unity version for the sdk even though I'm using version 2019.4.28 for both unity and the sdk. It says I need to use unity ver 2018.4.20.

floral dove
supple flicker
#

K thx

#

Also, whenever I try to build and test it takes me to my home world.

dapper lion
#

sounds like vrworld tool kit time or check console or just. dont do build and test. or you might be using the wrong vrchat all together

solemn talon
#

Does the OnPlayerLeft event fire before or after the player leaves?

#

And would the leaving player still own objects when the event is triggered?

supple flicker
#

What's vrworld toolkit time?

floral dove
#

if all that is correct, you likely have errors when you build - check your console.

supple flicker
pallid mango
#

Ie: when you join, you also get a join event for every other player already in the room.

daring vector
#

Looking for some help on how to trigger the "trigger" parameter. I see a lot of methods online using bool but I'm looking for an interact to simply trigger my parameter.

grand temple
#

animator set trigger

daring vector
#

/sigh. I knew it was something super easy

#

gonna test it out now 🙂

#

@grand temple vrcMoney vrcMoney vrcMoney

indigo finch
#

Trying to keep a VRCPlayerApi array updated as people leave and enter a world, but it doesn't seem to update after it's called the first time. Any idea what i'm missing?

grand temple
#

the script is probably crashing

#

doing an equality check on a playerapi that has left will still return true. You need to instead use utilities.isvalid for such a situation

#

however, for that specific use case you don't even need to do anything like that yourself. Just run playerapi.getplayers once onplayerjoin and it will automatically populate the array

#

then you don't need to remove them from the array because every time you try to access it, just use utilities.isvalid and that will exclude players that have left

indigo finch
grand temple
#

I would recommend having one big array of all the players and then a secondary array where you separate them out individually. This is because the getplayers function is relatively expensive as it doesn't just access an array, it fill the array up. So you shouldn't just casually use it every time you want to access all the players, especially inside a for loop

indigo finch
#

I just edited it as i had tried previously, but this causes it to crash on the second int of the for loop

#

oh, and here is the other bit just to be sure

grand temple
#

it's a bit confusing, but you don't want to use playerapi.isvalid. You need utilities.isvalid

#

playerapi.isvalid is accessing a property on the playerapi, so if it's null as is the case of an unfilled array, then it will crash. It will only work if it's a playerapi that you knew used to be valid but isn't any longer because they left

indigo finch
grand temple
#

No, that's not necessary

#

However utilities.isvalid is slightly more convenient in graphs since it combines 3 nodes into one. So you may still use it for that reason

indigo finch
#

using cyanemu, errors do pop up...

grand temple
#

Don't run getplayers in the for loop. Just run it onplayerjoined

indigo finch
#

ummm... how would that look in the graph? should i make a variable for the 'get players' to store it in?

grand temple
#

Yeah, exactly

indigo finch
#

unfortunatly, still getting the errors. did i miss something?

grand temple
#

Click on the errors to see what they are

indigo finch
grand temple
#

The important part is that it's trying to access a gameobject array and the object reference was not set to an instance of an object

#

Make sure that your gameobject array has exactly the same number of objects as max players and all the objects are valid

indigo finch
#

perhaps it has something to do with one of the earlier error messages

grand temple
#

Add a debug log of the current value of intty and then the length of the gameobject array

indigo finch
indigo finch
grand temple
#

Yes, every time a player joins

indigo finch
#

4 times though?

grand temple
#

It's inside a for loop

#

It only runs twice

#

The second is when it goes back to 0

#

Something appears to be clearing the gameobject array. Do you have any other code anywhere else?

indigo finch
indigo finch
pure parrot
#

does anyone know a way to learn quickly the basics and some more advanced stuffs ? the tutorials on yt are good but i don't understand 30% of it and I would like to do some stuffs that are pretty hard to do in the future , like assign a trigger box to the Back chest of all players

neon rain
#

Is there anything like OnPlayerParticleCollision that checks if a Particle has collided with a GameObject?

grand temple
#

yes, there is. It's named exactly that

#

oh wait, you're saying you want something that has similar functionality to OnPlayerParticleCollision, but not for players?

#

If so, then it's just OnParticleCollision

#

unlike OnPlayerParticleCollision, you can put that one on both a particle system or a collider. If you put it on a collider, it will give you a reference to whatever particle system hits it

neon rain
grand temple
neon rain
#

Figured it out, thank you!

rain marten
#

Im having a slight meltdown in the brain thinking department:

Is there a way to make a set percent chance that goes up over time?

Example: A 1/10 chance for a function to occurs fails, and thus becomes a 1/9 chance

neon rain
#

Okay, I have a script that is supposed to play a sound effect on particle collision. I think I have something wrong in the actual playback part, because when I use CyanEmu to force the collision event, nothing happens. Here is my script and setup:

floral dove
gusty trout
#

Hey, I've been working on a world that has AudioLink set up, but now I'm trying to add a canvas slider that changes the intensity of emissions in the world.

Judging by what came with AudioLink, seems like I'm going to need some Udon# scripts/noodles to handle the behavior.
I'm also hoping to have networking set up on this too, so it is server-side instead of only client-side.

I'm pretty new to Udon so if anyone knows of any tutorials or assets that can point me in the right direction, I'd really appreciate it.

rain marten
scarlet lake
#

so it does work

rain marten
#

Also, ignore me, i found what i was looking for

floral dove
rain marten
#

yep yep

daring vector
#

Question: is there an elegant way in Udon to spawn an object that only the spawned can pickup? In the past SDK2, I would have a prefab without a pickup enabled, on spawn I change the prefab local to enable pickup then spawn, then change prefab to no pickup again. This would work but hoping there’s a more elegant stable method now.

floral dove
daring vector
#

Spawned objects are local only? I mean if I object sync them they won’t be, right?

#

I need the world to see the spawned object but only the spawning player to be able to pick it up

grand temple
#

in that case, you'll need to use a vrcobjectpool. It will behave similar to instantiate, but instead of creating new objects it will enable them from a set of objects that already exist

#

once you have that set up, locking down who can pick it up is as easy as just enabling pickupable for the person that clicked spawn

daring vector
#

But would that enable any future people that click spawn able to pick up all spawned objects?

#

Or will each be unique to the person who spawned it?

grand temple
#

depends entirely on how you set it up. But probably not

#

when you call trytospawn on the objectpool, it gives you a reference to that gameobject. Then you just do getcomponent vrcpickup, pickup set pickupable

#

the one edge case you'd want to handle is if someone spawns an object, then despawns, then somebody else spawns it again. So you'd need to make sure the objects disable pickupable from the ondisable event

daring vector
#

Okay I’m brand new to Udon so I’ll try to figure it out. There’s like 2 spawn tutorials on YouTube and both seem overly complicated for what needs to get done

grand temple
#

ok, here's what you do for a basic pool:

add a vrcobjectpool to an empty gameobject

duplicate a prop a bunch of times

put all the props in the pool's list (you can do this all at once if you lock the inspector at the top right)

make an udonbehaviour and put it on some button object

add a public VRCObjectPool variable to that udonbehaviour

add an interact event, make it trigger networking.setowner with the networking.localplayer

then make it call vrcobjectpool.trytospawn and use the public pool variable that you added before

on the udonbehaviour, plug the pool into the public variable slot in the inspector

daring vector
#

I’ll give that a try tonight, thanks. Question, is a pool limited to the number of pool items I create? I assume so

grand temple
#

yes it is

daring vector
#

K

#

So none of that will make it pickup able to just the spawned though it seems, right?

grand temple
#

nah, start with getting a pool to work then you can add that

daring vector
#

Kk

#

Thanks again. I don't see how a pool will benefit over just instancing an object, but I'll trust you

grand temple
#

it's not entirely about benefits, it's just that SDK3 does not support synced instantiation

#

there is some minor advantages to memory usage, it's much more efficient. But if it was possible I would still suggest instantiating for a beginner because pools are more complicated and more limited.

rain marten
#

So, bluntly, ive been at this for about three hours now resisting the urge to ask here:

How to i make a "start game" button. As in: I click a cube, the cube vanishes, and it starts either A: a global function of some kind that allows me to play an animation on a totally separate object, or B: Just plays the animation directly to the separate objects.

Im entirely new to UDON and to be honest worldmaking as a whole so do bare with my potential not-smarts.

grand temple
#

you would need to have a reference to the animator and then all you have to do is call animator set trigger. Then the animator can have a trigger with the same name that is used as a condition in a transition to an animation

daring vector
#

@grand temple should my pool be inactive when I build?

grand temple
#

the pool itself should be active. The objects I think would get disabled by the pool so that probably doesn't matter

daring vector
#

k, testing now

#

k, that works

#

that was very clean and easy to follow/understand so far

grand temple
#

do you want to do trashcans or something?

daring vector
#

So what is happening when it's SetOwner to me?

grand temple
#

only the owner can spawn objects from a pool

daring vector
#

it's just making me owner but anyone that picks it up becomes owner anywa, right?

#

picks up the spawned pickup I mean

grand temple
#

you're setting the owner of the pool, not the object

daring vector
#

oh

grand temple
#

the object's owner will be determined by whoever picks it up, so no need to set it manually

daring vector
#

right.

#

so now with this, I need to find a way to make the spawned pool object to only be pickupable by the person who spawned it

grand temple
#

when you run trytospawn, it gives you a gameobject. So first thing is to check if that is valid with the utilities.isvalid node. Since this is a limited pool, it's possible that the pool is already completely taken. If that's the case, it will give you a null object and isvalid will catch that

#

if isvalid gives you true, you can continue on and run getcomponent on that object with the vrcpickup type

#

once you have the vrcpickup, all you do is set pickupable to true

daring vector
#

to local player only, right?

#

or is it already only affecting local player

grand temple
#

yes, all code in udon is local by default. It will only affect other players if you explicitly tell it to, like by sending a network event or setting a synced variable (which is what the pool is doing behind the scenes)

#

unless of course there's an event like onplayertriggerenter, which everyone sees. Then the code inside that would run for everyone, but not because it's inherently synced just because they're all experiencing the same thing

#

interact however is a local event, so this is all you

daring vector
#

okay so my objects in the pool dont need their own objectSync added to them or anything as long as it's in the pool

grand temple
#

no, the pool handles enabling/disabling but the objects inside still need to do their own position syncing so you would need objectsync for that

daring vector
#

oh okay

#

K, I'm a bit lost on the Is Valid. I have that in on my TryToSpawn. Then from True you said I can getcomponent on that object. but how will I know which of the pool objects it is?

grand temple
#

you can pull it out multiple times and reuse it

rain marten
#

While im here i guess, Would this system work? It doesnt do anything in particular at the moment but is supposed to replicate Russian roulette more or less.

1/6 chance, if the 1/6 fails it shortens down to 1/5 chance and so on. If it passes, resets to 1/6.

grand temple
#

I don't think compareto is doing what you think it does, especially to a bool

#

what do you want it to do?

rain marten
#

Ok. lets go step by step.

#

RevolverChances_1 is set to a value of 6.
Range will pick a number between 1 and RevolverChances (I'll call it RC for now)
That number gets checked to see if its greater than 1. This gets compared to the yes or no values.
If yes, it would output a 1 (correct me if im wrong), which i can send to the subtraction to lower the Number for RC (Thus making it a 1/5 rather than 1/6)
If No, The output would be a 0 (Again, correct me if im wrong).

This is where things get messy cause im not exactly the smartest. If it passes the "No, its not greater than 1" test, then it resets the value of RC back to 6. (Reset_1's value is set to 6 as well, cause again, not smart.)

grand temple
#

ok I guess compareto is doing what you expect but that is a little weird to do it in that way

daring vector
#

I'm still stuck on the Is Valid - but I'll mess with it some more to figure out - thanks again for the help

rain marten
#

True but i dont exactly know of a better way. Glad that means it technically works for what i want it to do then

grand temple
#

I'd recommend instead plugging the bool that you get from the the greaterthan into a branch. That will split up the flow so you can do two completely different things depending on what the outcome is

rain marten
#

I'll be totally honest i wasnt even aware that was a tool lol.

#

I'll rewrite it tomorrow since its currently 4 am and as much as i do have an idea of how to make it probably better with the branch function i really cant be bothered rn lol

#

Rewriting it also gives me a chance to add another function in RR, which is to spin the cylinder, which technically resets the chances to 1/6

fading cipher
#

lol programming until 4am, you're doing it right

tulip sage
#

How do you join a public server?

midnight beacon
tulip sage
#

Yes

fading cipher
#

Hey y'all, tad bit confused. I have a bunch of local only object with 0 networking stuff happening in them and I'm scrolling through my logs to find a massive amount of ownership transfer logs regarding them

#

Does network ownership get applied to everything on scene load up even if the object itself isn't actually networked?

midnight beacon
floral dove
fading cipher
#

oof okay

midnight beacon
#

Am i doing something wrong with this script that attempts to destroy GameObjects that enter a trigger? The log activates but the object remains intact. Tried searching for answers and I couldn't find anything 🤔 .

cold raft
#

if you can re-use them you might want to return them to a pool instead

midnight beacon
#

I'm just starting out and id like to get to that, but it would be good to know why something simple like this doesn't work :S

#

(nvm worked it out, turns out there's two types of destroy and only one will apply locally? shrug)

broken bear
#

how do I export a udon graph to a string that others can copy-paste into their graph to import?

dapper lion
#

like the .asset?

#

or like specific nodes

broken bear
#

sometimes when I ask for help here some people have linked a string that I can import and it loads the graph on my side

slim hound
#

You just select the nodes want to copy and either control c or right click > copy

broken bear
#

good stuff, thanks

main river
#

Hey everyone, Im brand new to making VRchat levels, but have experience in game dev when it comes to environments and modeling. I was trying to block out my level, and was wondering how to get characters to sit cross-legged on a floor pillow vs the standard sitting position. I replaced the mesh on the Udon chair prefab to the one I wanted, just not sure how to change how the character sits when it interacts with the prefab

#

Sorry if this is the wrong channel, if it is, Ill post it in the correct one once I know which one that is

dapper lion
#

i might be wrong but i believe theres a "enterance" animation on the vrc station scrip where you can add a criss cross animation on

main river
#

I don't see anything about an animation..

dapper lion
#

not the graph. the vrc_station

main river
#

oops. My bad.

rain marten
#

I rewrote my code from last night and somehow i think i made it messier. Can someone confirm for me that this would infact do as i wish it to do?
(Check for a 1/6 chance, then if it fails lower the chance to 1/5 and so on. Resets to 1/6 when passed.)

main river
#

I do see a slot for an animation controller which is currently blank. Is it safe to assume Ill need to create a controller, add a new sitting animation to it, and then plug it into the VRC Station's animation controller?

rain marten
#

That would make sense. Im fairly certain theres already a VRC controller for seats somewhere in the VRCSDK examples

main river
#

There are, but it looks like just two different poses for default sitting positions. Ill take a look through the rest of the animations, if there is one, Ill duplicate an existing controller and add that animation to it, or make a new animation. Thanks for the help you two!

rain marten
#

You can overwrite the sitting positions directly with your own sitting animation. I'd recommend duplicating the controller anyway either way lol.

main river
#

haha yea. Wouldnt want to screw up the originals 😅

#

So to create this new animation I should probably download the avatar SDK, correct?

#

Just so I have the same character rig as the rest

rain marten
#

Not sure on that one

#

You should probably just need world SDK

#

since the rigs are the same either way more or less

main river
#

So I tossed the new animation controller containing the cross leg animation pose in the Animation Controller slot in the VRC Station script of the chair, but every time I build to test, it keeps detaching it from the script 🤔

topaz jetty
#

I started my vrchat in debugging mode by adding --enable-debug-gui in the launch options and need to copy some numbers my world puts out in the console, is there any way I can select it to copy it?

fiery yoke
dapper lion
#

anything written in there will be in your debugs log

fiery yoke
#

Do you remember the command for the logs lol?

topaz jetty
#

--enable-debug-gui...?

#

idk

dapper lion
#

im pretty sure its written in there by default. weather thats on or not

topaz jetty
#

I tried searching for the word log in the vrchat game folder with no results...

dapper lion
#

in appdata?

topaz jetty
#

no in the steam program files

#

is it in appdata?

dapper lion
#

should be

fiery yoke
#

its in %userprofile%\AppData\LocalLow\VRChat\vrchat

topaz jetty
#

yeah I found it but there's only logs from yesterday there for some reason

#

not from my current session

#

is it because of the debugging mode?

#

nvm found it, thanks

glossy sky
#

Hi hi. I was wondering if anyone else is having issues with GetPlayerTag? Works with CyanEmu and in Unity but doesn't work when actually in VRChat. Thank you in advance!

daring vector
#

K, round 2 of trying to figure this out: So I need help with setting my SpawnedSphere to pickupable. Not sure if I have this structured right but it's not working.

#

"pickupable" is unchecked on the spawned item by default. So trying to turn that on when it spawns it

cold raft
#

Well first thing I spot, you got to tie the gameobject from try to spawn to is valid, and you should probably check isvalid before setting ownership

#

And your variable spawned sphere is not getting set, you should connect the same gameobject from try to spawn also to the get component

#

Than it should work

daring vector
#

that object from TryToSpawn is a pool though, there's no pickup component in the pool itself, only the pool children

cold raft
#

Try To Spawn is done on an instance of VRCObject pool, the value that gets out of it is a single object from the pool

#

So I assume that is you sphere

daring vector
#

yeah

cold raft
#

Do that sphere does it have a pickup on it?

daring vector
#

It has a pickup script, but "pickupable" is unckecked. If I have it checked, it spawns it and I can pick it up just fine

#

but I want it unchecked by default and only enable the pickup for the person who spawned it form the pool

cold raft
#

Ah I see..

#

🤔

#

Well that's correct than right? There is no networking involved here so it all runs locally

#

I am not 100% if pickups synch there pickupable state I would assume not

daring vector
#

not sure if its synced but either way it's not activating it

cold raft
#

Can you show what you made of it

daring vector
#

oh, I kind of reverted back to where I was to start so no real change

#

I did notice there are two VRCPickup Types though...

#

VRC_Pickup Type and VRCPickup Type

#

I tried both and no results

#

I really just think my IsValid is not firing properly

#

I did try one other thing that I was sure was gonna work...

#

I dragged the Pickup component straight from inspector into the graph

#

and it made that new node

#

but it still didnt work

#

I just did one other test where I made a separate button with just those two nodes which should enable the pickupable to that object and that's not working either. So now I'm wondering if that Set Pickupable is working as it should be...

slim hound
#

It will always return false

daring vector
#

I thought that was checking if there's still pool items (I'm new to Udon)

slim hound
#

The VRChat object pool handles that

#

Don't need to do it yourself

daring vector
#

okay, so I can go from TryToSpawn to Set Pickupable?

slim hound
#

Yes

daring vector
#

awesome

#

okay, so my next test to simplify things is to see if Set pickupable is working and my smaller test is telling me it's not

#

this is my test:

#

I have a capsule with a pickup script. I unchecked pickupable.

#

I made a new button that on interact, set pickupable on that capsule pickup

#

and that's not enabling it

#

I know there's been funky things with "pickupable" in SDK2, not sure if it's still not a reliable checkbox or if I'm just not using it properly

daring vector
#

That looks right though, right?

slim hound
#

Sure

#

But if you have that on a pickupable object it might override the interact event

daring vector
#

no, that's just a separate button that should enable the pickupable of the capsule

#

nothing fancy about it. but it's not working

grand temple
#

@daring vector @slim hound you absolutely need isvalid because if the pool is all taken up it will give you null. Also, you have a whole bunch of stuff disconnected and not coming from anywhere.

First of all, the flow is all wrong. The white line specifies the order that things happen so you need to have it setowner first, then do trytospawn. You would do this by plugging the flow from the right side of setowner into the left side of trytospawn.

You want to plug in the pool's gameobject into the setowner, not the thing you get from trytospawn. This is because in order to spawn, you need to be the owner of the pool. The object you get from trying to spawn does not matter.

You never set spawnedsphere anywhere so trying to get it is just going to crash your script

You can drag out a variable multiple times, so you want the gameobject coming from trytospawn to go into both the isvalid and the getcomponent

You have to plug the getcomponent into the set pickupable. VRCPickup is the type you want.

daring vector
#

Reading and working through this - one sec.

#

I know this isn't right because it's not working, but this is what I understood...

grand temple
#

you still need to plug the gameobject from trytospawn into getcomponent

#

you can use it multiple times

daring vector
#

It wouldnt let me

#

TryToSpawn GameObject to the instance slot of GetComponent, right?

grand temple
#

get rid of the spawnedsphere first

daring vector
#

ah

#

Okay, awesome, I can pick them up now!

grand temple
#

woo!

daring vector
#

now let me go back and re-read this and ask questions if I dont understand the flow

grand temple
#

that's pretty much everything for this section

#

now you need to add an udonbehaviour on the objects that will handle despawning them and setting them back to pickupable false

#

do you want to have like trash cans or something?

daring vector
#

no, I don't want this object to be despawned ever

grand temple
#

what about when the person that spawned it leaves?

daring vector
#

yeah, that would be a good reason

grand temple
#

also, do you want to restrict it so you can only spawn one object?

daring vector
#

no, so let me clarify the use case of this

#

This is to spawn a reward for the user. They spawn it when they complete a challenge (probably not more than 5 people will do this per session so wont be too many)

#

only the person that completes it can pick it up

#

show it off, so on

#

nobody else can touch it but everyone can see it

grand temple
#

oh, that makes sense

#

then yeah I guess that's pretty much it

#

though if the instance goes long enough, you'll run out of trophies

daring vector
#

but would be nice if it gets trashed when they leave... or not, that's not as important

#

yeah, I mean, I was thinking of having like 10 in the pool

grand temple
#

yeah, all you have to do is add an udonbehaviour on all the objects that does

onownershiptransferred > set a variable called "lastKnownOwner"

onplayerleft > if the player given is the last known owner and I am the owner of the pool, return to pool

daring vector
#

lastKnownOwner is the pool?

grand temple
#

nah, just a playerapi variable that you make

daring vector
#

so how would that OnPlayerLeft be structured to do that?

grand temple
#

onplayerleft gives you a playerapi, you have a playerapi variable. Plug those into a system.object equality node. Then plug the result of that into a branch node. Branch will allow you to make stuff happen only if the bool that you get from the equality is true

#

this also needs a reference to the pool so make a public vrcobjectpool variable. You can plug that into a vrcobjectpool return node. And then you can just leave the obj slot of return empty because that will just reference itself automatically

daring vector
#

I'm not clear on what the equality is doing

grand temple
#

it's checking if two objects are the same thing

#

if they are, it will give you true

daring vector
#

ah okay

#

So is this what I'm testing? Seeing if the player that left is = to the last known owner?

grand temple
#

yep, now just plug the flow together from the onplayerleft to the branch. Currently it would do nothing because there is no flow

daring vector
grand temple
#

oh, the return is not correct. You need to plug the pool into the "instance" slot, that's referring to the pool itself

#

the obj slot is referring to the object you want to return

#

and currently the pool is a gameobject variable so that won't slot into there, you need to change it to a vrcobjectpool variable

daring vector
#

k, you lost me there

grand temple
#

you have a gameobject variable for the pool, change it to a vrcobjectpool variable

#

then slot that into the "instance" of the return node

#

and leave "obj" blank

daring vector
#

I got that, but not sure how to change that, let me see

grand temple
#

just delete the old pool variable and make a new one

daring vector
#

I'm confused on how it's still referencing the pool at this point though

grand temple
#

the pool variable needs to be public, which will make it show up in the inspector. so when you put this udonbehaviour on an object you'll need to plug the pool into it

daring vector
#

got it, that makes sense. And I'm sure that's going to be one of the things I'm going to forget to do in the future 😄

rain marten
#

The use text on a VRC PickUp: any good way to change that via the player using the item?

daring vector
#

I really appreciate this 100%!! means a lot to me, honestly. Let me take a moment to take this all in and review this

grand temple
rain marten
#

fantastic

daring vector
#

So it's all working except for the onPlayerLeft. I tested with 2 players and when the player left, the object didnt return. I think it might be my OnOwnership Transferred

#

I just have it as a string variable and that doesnt seem right

grand temple
#

yeah, you're not doing anything with the player that has left

#

and lastKnownOwner needs to be a playerapi

daring vector
#

got it

#

This should do it

grand temple
#

it's still a string

daring vector
grand temple
#

yeah that should do it

daring vector
#

so before I test this, this brings up a question. Now that the item is returned to the pool when the user leaves, will it not continue to have the lastKnownOwner tag?

grand temple
#

it will, but it will be disable so it doesn't matter

daring vector
#

will that affect things if it becomes spawned again by a new user later?

grand temple
#

no, because you'll only ever receive one OnPlayerLeft per player

daring vector
#

Okay, still not working and I'm getting an udon error now

#

Specified cast is not valid

grand temple
#

does it give any information?

#

maybe vrcplayerapi isn't a system.object hmm

daring vector
grand temple
#

yeah that's definitely referring to plugging the playerapi into system.object equality

#

try unityengine.object equality instead

daring vector
#

that doesnt seem to let me snap the VRCPlayerApi into it

#

Is it that though? I removed it and compiled and the error is still there

grand temple
#

hm, that's odd. There is no playerapi equality, so you could try playerapi equals, but there's a difference between equals and equality and I'm a bit fuzzy on which one is needed here

slim hound
#

That's an error with adding variables in Udon Graph

#

You need to restart the editor to fix it

daring vector
#

restart and no error

#

You guys are Gods.

#

So I tested and still not going away. Could it be a local test issue?

#

because I'm using 2 local players?

slim hound
#

Do you ever manually transfer ownership of the objects in your pool?

daring vector
#

no, only the person who spawned it can pick it up so there's no ownsership transfer

grand temple
#

did you pick it up before leaving?

daring vector
#

oh wait

#

one sec

grand temple
#

yeah, since we're doing it this way you'll want to setowner of the object the pool gives you too

daring vector
#

my other objects in the pool don't have the public pool variable even through I told the prefab to override all

grand temple
#

prefabs can only maintain references internally. If it's to a reference outside the prefab, that won't be saved

#

but even then, prefabs and udon don't get along very well

slim hound
#

If no other player can ever take ownership other than the person who spawned it you could just use OnOwnerShipTransferred to send it back to the pool

#

With a behavior on the pooled object itself

daring vector
#

@slim hound that sounds right to me...

#

(this one still isnt working)

grand temple
#

are you getting any udonbehaviour errors?

daring vector
#

gah, one sec

grand temple
#

huh, I've never had that before

daring vector
grand temple
#

oh, something went wrong when you switched the pool from a string to a vrcobjectpool

#

it's probably remembering something old that no longer exists. Try renaming it to something different

slim hound
#

If the error hasn't changed that probably isn't possible

#

The invalid cast error makes udon graph completely unusable

grand temple
#

do you know how to reproduce it reliably? I can't get it to happen by just naming a new variable the same as an old deleted variable

slim hound
#

I only ever got the error when adding variables by dragging and dropping them into the graph

#

I know it never occurred if I had just opened the udon graph program directly

daring vector
#

No more error when I made the pool a new name, but still not working. I'm going to try having it just return it on ownershiptransfer

#

I think that's an elegant solution and makes sense

grand temple
#

you'll have to add a timer that makes it not return if it's been less than a second since being spawned

#

you can do that by just setting a float onenable

#

and use time.timesincelevelload

slim hound
#

Shouldn't need to do that if you check if ownership is going to the master and only returning if so

#

Also the reason it wouldn't be working is you are storing last known owner as the new owner

daring vector
#

yeah, it's being returned the second I touch it for the first time lol

#

because it's changing ownership to me

slim hound
#

Try do OnOwnershipTransferred then check if it was transferred to the master and if so then return

daring vector
#

can I use a branch to do that?

#

remember, I'm new to all of this

slim hound
#

Yeah but from the Ownership Transferred event plug the VRCPlayerApi into the Get isMaster

daring vector
#

makes sense

#

Again, GODS!

#

works

#

@grand temple @slim hound Thank you so much

#

I appreciate the guidance and it all makes sense and is easy to follow. Learning more of this as I go.

tranquil summit
#

Any idea why this graph isn't setting the boolean back to false once it hits 10 seconds?

#

i have a proper timer that does work in the behavior, that's how it enters this condition, but for some reason it'll make the boolean true, but never set it back to false

grand temple
#

Everything going along the flow like that happens instantly

tranquil summit
#

thats why i have the greater than condition- oh wait i see

grand temple
#

I see you have ondeserialization and onplayerjoined but it's really hard to tell how those are connected when everything is squashed together like thet

tranquil summit
#

yeah im gonna be removing one once i get to testing in game, but now i see why it isn't working lmao, i just need to put my false statement in a better location

grand temple
#

you could just use a sendcustomeventdelayed

tranquil summit
#

u rite

rain marten
#

I think i refined my code from yesterday. It now uses a branch and custom events to tell things when to fire off in order.

#

What im having issues with now is setting custom events for a few specific things

daring vector
#

I’m away from my desk now but just had a thought. Do pool spawned items have a pre set action when they fall off the world? Or do I have to set that?

grand temple
#

the pool doesn't care, but if you have objectsync on them then they will be respawned

#

you can change this in the scene descriptor

rain marten
#

1: Im trying to make it so that its a single action revolver: You have to pull the hammer back (Use1), and then pull the trigger.
2: I also need to make it so that it will fire a bullet if it hits the "false" on the GreaterThan Check (preferably just play the animation thats set on a bool value currently)

daring vector
#

Respawn being where it spawned from or respawn back into the pool?

grand temple
#

it's original position

daring vector
#

K perfect

rain marten
#

Currently, the absolute nightmare of code i have right now is this:

grand temple
#

if this is on a pickup, just use pickupusedown. InputUse will trigger whether or not you're holding it. It will also trigger for both hands and for both down and up

rain marten
#

Got it.

#

and any ideas on how to make it single action? (Pull hammer on one use, pull trigger on second, resets to the start)

grand temple
#

keep track of the state and have branches based on what state it's in

rain marten
#

Got it. lemme think of a way through that quickly.

indigo finch
#

I feel like I'm missing something basic, but any idea why this is throwing out errors?

grand temple
#

For all the udonbehaviour methods like onplayerjoined, you need to do 'private override void OnPlayerJoined'

daring vector
#

Weird "W" appearing on my "Sit" text. I'm not concerned for now, just wondering why this is happening,

indigo finch
#

is it just meant to be public?

grand temple
#

Eh maybe I got the order wrong. Delete those entirely and starting typing 'override onplayer...' and your autocomplete should make it correct