#udon-general

59 messages · Page 84 of 1

wise quarry
#

doesnt work

fierce verge
#

??

wise quarry
fierce verge
#

you could make a sendcustom event behind the graph that enables it

#

and then a custom event before this one

#

calling it like "UpdateButton"

wise quarry
#

Thats my graph now

fierce verge
#

hmmm

#

that should work after set active

#

have you compiled before testing?

wise quarry
#

and clicked before compile

#

it doesnt work

fierce verge
#

without doesnt work for sure

#

because the branch doesnt get any input command so to speak

#

did you put the button into the public variable in the inspector?

wise quarry
#

but then the mirror stay active but without the button get the coloring

fierce verge
wise quarry
#

no

#

lol

fierce verge
#

hahaha so it trys to color nothing

wise quarry
#

how to do it?

fierce verge
#

just drag the button from the right into that slot

#

so from your hierachy into that slot

#

there should be a slot if you set the variable to public

wise quarry
#

there is no button

fierce verge
#

the HQtoggle is your button right?

#

put the button in that you want to change color

wise quarry
#

aaaahh you mean the toggle xD

fierce verge
#

yeah hahahah

#

you set the variable to public right?

wise quarry
#

yes

fierce verge
#

normally it should work

#

using this you could also make it change colors depending on if its a HQ or a LQ mirror

#

because now it makes them grey when theres no mirror

wise quarry
fierce verge
#

xD

wise quarry
#

doesnt work

#

oh wait its not connected

#

next try xD

fierce verge
#

xD

wise quarry
#

now if click on this, its invisible but i think because of the alpha

#

and the mirror doesnt stay active

#

i mean it works how it should

fierce verge
#

yeha that probably the alpha

wise quarry
fierce verge
wise quarry
#

its workiiinnng

fierce verge
wise quarry
#

lul

fierce verge
#

and now you can copy the component and paste as new on the other one

fierce verge
#

so when you press HQ the LQ one turns white

#

by adding another customevent to a button/toggle

#

btw make sure that when you copy and paste a Udon component to another object it can lose those variables

#

so you need to set them again

wise quarry
fierce verge
#

yess

wise quarry
#

thank you very much daaaamnn

#

now im on my next saiyajin level

fierce verge
#

if you have any other questions just post them here 🙂

wise quarry
#

how to connect both?

fierce verge
#

ehmmm

#

Just duplicate the Customevent

#

and place that again in front of the branch

grand temple
#

just do one then do the other

fierce verge
#

as long as they have the same name they trigger both

grand temple
#

the white line indicates the order in which things happen

fierce verge
#

could also do that

grand temple
#

you can't have two things happen at the same time

fierce verge
#

or just make 2 customevents and 2 setactives, for each button

#

but @wise quarry if you place this graph on the other Toggle you can change the variables per gameobject

#

so if you change the variables on the LQ it doesnt affect the variables on the HQ

grand temple
#

and no, that does not work. I just checked

fierce verge
#

ah I tought it did xD

grand temple
fierce verge
#

my bad

grand temple
#

even if that did work it'd be so messy and please god don't do that

fierce verge
#

true

#

I would just re-use that graph on the other button with diffrent variables

wise quarry
#

short: i cant make both? xD only color change or object toggle?

grand temple
#

no, just make it flow from one to the next

fierce verge
#

yeah

grand temple
#

every event has an input and an output arrow

fierce verge
#

the line is just the order of actions

#

so you can do Event > SetActive > SetActive > Color

wise quarry
#

i dont understand how to do it now, xD

fierce verge
wise quarry
#

if i do this, then the button stays red

fierce verge
#

because you dont have the Get ActiveSelf connected to the Branch

wise quarry
#

aaaah thanks it works

#

thaaaaanks

fierce verge
#

🥳

wise quarry
# fierce verge 🥳

It works with both Mirrors, i put it on LQ Mirror to and the buttons works how it should it be, but the problem is, i activate both then both buttons are red, that what i means is if i click on "HQ" then "LQ" should be green and not that both should be red, but in herarchy i see that the mirror disabled the other mirror, only the colors not working with both buttons

fierce verge
#

so basically both buttons turn a color but you only want one to turn a color?

wise quarry
fierce verge
#

yeah I see

#

I would make 2 variables, one is called ToggleHQ and one is ToggleLQ

#

and then do 2 set colors

#

or toggle1 and toggle2

wise quarry
#

What do you mean with 2 Variables?

fierce verge
#

so when true, it makes ToggleButton red, and toggleButton2 green

#

and then in the inspector swap the two buttons in only one of the two buttons if that makes sense

shy crypt
#

Am I using UseLegacyLocomotions properly, I am trying to get stations animation working properly for avatar 3.0's I'm trying to update my MMD world to SDK3 but I have been in the same loop for 3 days now. where all avatar 3.0 would have tracking control enabled when animation is playing

grand temple
shy crypt
#

seems like every MMD world I have recently Played in forces you in it

#

then agian I could be wrong

grand temple
#

you probably need to get the VRC Animator Tracking Control script from an avatar project and get it into your world project. Then add it to the animation to disable tracking

#

that's what I can assume from what I know, though I haven't actually made an MMD world myself

wise quarry
shy crypt
#

I have tried to get VRC animator script working but it seems to not like being alone without all of the other avatar scripts

wise quarry
fierce verge
#

xD

#

no problem! when you need some help just ask here or let me know!

#

why is my customevent not showing??

#

what happend to the inputfield?

grand temple
#

you may have to compile it

fierce verge
#

"Failed to refresh program 'TOGGLE LIGHTS' due to exception 'System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
"

#

I think this is my problem

#

but wtf do I do with it

#

wait a minute

#

I get that error when I pull this line???

grand temple
#

yeah don't do that

#

it's coming from a separate flow path, that will break things

fierce verge
#

should I put my onplayerjoin on the same input as the customevent?

grand temple
#

what?

fierce verge
#

I want to sync this toggle basically

grand temple
#

just don't share variables between flow paths

fierce verge
#

but its derived from a pool

grand temple
#

I have no idea what you're asking, all I can say is that dragging the line from there makes no sense

fierce verge
#

but how do I make this then?

#

I have this button that toggles a pool on and off

#

but I want to sync it to late joiners

grand temple
#

are all these objects going to have the same state?

fierce verge
#

yes

#

all active or not active

grand temple
#

then just grab the state of the first one

fierce verge
#

ahhh thats smart!

fierce verge
grand temple
#

copy this part

fierce verge
#

thanks!

grand temple
#

but for the int, just use 0 so you grab the first one

#

woah woah wait a second

#

why is this coming from a pool?

#

pools should be handling all this for you if you let them

#

but I don't think a pool is what you want at all

fierce verge
#

I got like 80 gameobjects I need to toggle at once

grand temple
#

you just need a regular old gameobject array if you're going to be manipulating the objects manually

#

a pool is a more automated solution where you just say "I would like to spawn an item please" and then it does

fierce verge
#

hmmm

#

I made everything in my world based on that pool idea

#

where it takes all items in a pool and toggles them

grand temple
#

you're not using anything from the pool though

#

you're just using the array of gameobjects

#

which you can do by just adding a gameobject array variable to your script

fierce verge
#

this one?

grand temple
#

that's the node you would use to pull from a gameobject array

fierce verge
#

wait just read it again

#

nvm hahaha

grand temple
#

you need to have a gameobject array in the variables list on the left

fierce verge
#

I seee

#

well gosh darnit

#

and then just replace pool > getpool by gameobject[]

grand temple
#

yeah

fierce verge
#

Like this right?

grand temple
#

yep

fierce verge
#

And then this would be my synced toggle

grand temple
#

yep

fierce verge
fierce verge
#

As soon as a player joins all objects get turned on when theyre off?

#

it works for a single gameobject but not for a pool?

grand temple
#

just don't use the pool like that

#

it's doing a whole bunch of other things that are not necessary and probably screwing with you

fierce verge
fierce verge
grand temple
#

try debug logging stuff

#

print the length of the array, print each item in the array

fierce verge
#

how do I even do this xD, I never had to debug since everything always worked except this array stuff

grand temple
#

debug log

fierce verge
#

how?

grand temple
#

a node

#

called debug log

fierce verge
#

where do I see the output?

grand temple
#
fierce verge
#

if I do this my button object gets dissabled instead of my array

grand temple
#

because you left setactive blank

fierce verge
#

ah yes

grand temple
#

leaving a gameobject, transform, or udonbehaviour blank will always self-reference

fierce verge
#

ahhh now it all works

#

only need to make the synced toggle now

stuck sentinel
#

im scared since i cant find a tutorial or anything that can help me with this

cedar iron
#

Anyone know how to teleport everyone with an event?

grand temple
#

you can only teleport the local player, so all you have to do is send a network event to everybody and when they receive it, teleport the local player

cedar iron
#

Not entirely sure how to do that....
Can you help me through the process?

grand temple
#

watch some tutorials on networkin

shy cipher
#

my control panel is gone?

#

im trying to make a world in sdk3

grand temple
shy cipher
#

alrighty

#

thanks

#

i prob messed up trying to update my map to sdk3

grand temple
#

nah, it's a normal issue that just happens sometimes

shy cipher
#

oh oki thanks

#

yeah sdk2 just stopped working

#

like nothing works with it anymore

grand temple
#

but you said SDK3?

shy cipher
#

i updated

#

to sdk3

grand temple
#

right, then it's normal that everything from SDK2 breaks

#

that's what it means to upgrade to SDK3

#

Triggers are deprecated, and you need to recreate everything in udon

shy cipher
#

alright i gotta update all my worlds and avatars anyways

#

yeah thats what i thought

#

anyways ima go finish my world now

shy cipher
#

is my sdk broken??

#

it did nothing

fast lodge
#

I'm trying to get a custom avatar, but my Unity wont work. Anyone know any solutions?

fierce verge
#

How can I make a synced integer in an animator?

shy cipher
#

i found out my problem

#

i cant enable any of the unity packages

#

doesnt let me

#

like i click on the arrow and it disables?

grand temple
grand temple
shy cipher
#

hold on

#

gotta reopen the menu

#

okay so packages and vrc examples

#

what files did i forget to delete when i updated?

grand temple
#

if you deleted SDK2 while unity was open, it wouldn't delete them fully. Try closing unity, deleting, then re-open unity and import SDK3

shy cipher
#

oki

#

also what files do i have to remove just the sdk folder?

#

ima just load the backup before i updated

grand temple
#

anything related to vrchat

#

I forget everything in sdk2, but it might have had examples too

shy cipher
#

alrighty

#

what about the examples folder?

#

eh i have a backup anyways

shy cipher
#

there were two things in the assets folder so-

shy cipher
#

yup, didnt work.

shy cipher
#

whenever i export it just shows the camera instead of the menu

grand temple
#

what do you mean by that?

#

like the game view doesn't have all the build and publish input?

shy cipher
#

nope

#

just the camera view

grand temple
#

you have some camera that is overriding the view?

shy cipher
#

nope

grand temple
#

what camera? what view?

shy cipher
#

when i export it shows this

#

thats my camera

grand temple
#

what do you mean by export

shy cipher
#

build and publish

grand temple
#

then how is that not what I meant here?

shy cipher
#

sorry

#

but yeah it doesnt show up

grand temple
#

so you've got some camera somewhere that is rendering to the game view

#

just disable that camera

shy cipher
#

alrighty

#

now it just says no camera rendering

#

is it my vrcworld?

grand temple
#

what exactly are you clicking to get to this point?

shy cipher
#

build and publish for android on the sdk

grand temple
#

do you get any errors in the console?

shy cipher
#

3 trigger on cube was not initialized in time

#

oh wait i have clear on build on

grand temple
#

idk, something is wrong with your SDK and I'm not getting enough information. Try a fresh install

shy cipher
#

it works with avatars

#

and other worlds

#

its just this one

#

i only have these

#

and i dont think it has anything to do with the problem tho

#

eh ill deal with it later

#

also its 100% the vrcworlds problem i know that

#

i just dont know what its doing

cedar iron
#

I'm looking to check to see if a player is in a trigger, and if not, the door closes

#

Is that possible?

west depot
#

gues this could go here. i cant find any related issues online. in vrc. chairs have recently just stopped showing up. i dont get the blue square telling me i can sit anymore. any ideas?

#

or someone direct me to a vrc support channel. i dont see one and this looks like development

mossy crane
#

Do people use the built in combat system variables of Udon often or is having custom hitboxes following players/ints to control health ect more favored for stability?

timber mortar
#

https://www.youtube.com/watch?v=cQ3hWKY-NiA&t=5s&ab_channel=Player_Bush001

I have all of this video correct and it works but when i try to turn off the audio is where i get confused, the person who made the video has a comment on how to do it but i still dont understand

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

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

▶ Play video
brazen epoch
#

I had to make my own implementation of Kill Boxes and such

mossy crane
#

Even ragdolling on 0 hp like back in SDK2?

brazen epoch
#

Correct. That doesn't exist

mossy crane
#

big sad, thank you for the reply tho!

brazen epoch
#

Of course. If you do find something official or supplementary, do tell please!

mossy crane
#

How did you manage size of avatar for your hitboxes if you ever went that route?

brazen epoch
#

The Player capsule collider is added by VRChat itself. You can just check OnTriggerEnter or other Collider events if you don't want to use Trigger Colliders
or just OnPlayerEnter

mossy crane
#

Excellent. Thank you! I figured out combat pretty good a few years ago, maybe ill poke at the depreciated stuff a bit before making own lol

brazen epoch
#

Yup. Another thing is there is no standard way to kill someone other than to Teleport them to a desired location and use a screen space shader to display a death graphic

mossy crane
#

why 😦 the ragdolls were so good lol

hushed gazelle
#

I swear I've seen ragdolling used in an Udon world though.

mossy crane
#

Well

#

I got the combat working, everything but ragdoll

brazen epoch
#

Ragdolls imply Rigid Bodies which can cause performance issues

mossy crane
brazen epoch
#

Perhaps there is a way to do that at runtime, but I haven't bothered

mossy crane
#

25 dmg per bullet, 100 hp, after 4 shots you freeze and respawn a few seconds

#

on my proj

#

other object

brazen epoch
#

Oh wait. Do those methods actually work

mossy crane
#

I just tested and they seemd to

brazen epoch
#

I swear the docs say deprecated

mossy crane
#

weather intentional or not lol

brazen epoch
#
mossy crane
#

without ragdolls its so sad ;_; I can probably test for 0 hp int and play a death sound at least

#

this thing has no docs

#

so i took a gamble and just activated it

#

i think thats the old Vrc_Combat script

brazen epoch
#

Seems to be not recommended so it might be deprecated and removed at some point

mossy crane
#

lol probably

#

Hope we get a new system soon

brazen epoch
#

I'll just stick with my jank implementation for now for sake of support

mossy crane
#

exactly lol, future proof

hushed gazelle
#

I enabled it in my toy store just for the particle collision, because now all my paintgun-equipped toy vehicle avatars splatter over people while in the world.

brazen epoch
#

The collider on players should be sufficient for checking that kind of stuff although cyan emu says VRC spawns a collider at the player's feet which isn't that large in test mode

hushed gazelle
#

Nah, that's only for world particles, I'm talking avatars.

brazen epoch
#

Ah okay

mossy crane
#

plz work lol

#

it does not ;_; but the player sees themselves ragdoll

#

Ayy close enough lol

night viper
timber mortar
#

ok thank you

hushed gazelle
#

Don't tie audiosource to both branches, it can get a bit buggy I've found. Make a separate copy of AudioSource to connect to Play and Stop.

night viper
#

really? Does this happens with any variable ? I have been doing this a lot hmm I hope it is a bug that will be fixed in the future

cedar iron
#

I have a gun that fires rigidbodies, how do i remove them after a bit?

hushed gazelle
#

What're the rigidbodies actually doing?

mossy crane
#

This would work for a long while putting it on the object you fired

#

cant find destroy for some reason

timber mortar
wise quarry
#

@fierce verge do you know how to use the unity profiler for optimization?

slim hound
empty mantle
#

ok is there a node that plays animations like audio nodes on how theres a play and stop

fierce verge
#

How do I make a late player sync the current integer in an animator?

mossy crane
#

Oh, or make a int variable in the udon graph on the left, and get/set that int

fierce verge
mossy crane
#

It looks like you have a int inside your animator, but that animator will default once someone new joins, so I think you need to create another variable called Speed in the graph and make it synced, then instead of setting the int directly you set the udon int and use that number as your animator int reference so there’s a universal number referenced no matter when someone joins

fierce verge
#

ahhhhh

#

thanks!

mossy crane
#

And if that doesn’t work, you can add one of the OnPlayerJoins event and set that animator to the synced variable

fierce verge
#

I cant find the int as a variable?

#

nvm I was in another tab xD

mossy crane
#

Ahh kk lol. Goodluck!

fierce verge
#

wait huh

fierce verge
fierce verge
#

I think I got it

fierce verge
#

nvm

#

This works but doesnt sync

scarlet lake
#

I have inserted this udon script of the menu for worlds.
It works perfectly for PC but on VR it doesn't allow to click, can I know if it's my problem and if I can fix this thing?

cedar iron
#

Can a udon behavior toggle items that are not a child of the object that owns the behavior?

fierce verge
cedar iron
#

Ok, can a "SendCustomNetworkEvent" node be activated from an "OnPickup" or "OnDrop" node?

fierce verge
#

sendcustomnetwork can be activated by anything that has the Action Triangle

fierce verge
cedar iron
fierce verge
#

hmmmmm

cedar iron
#

i had this for my pickups and drops

#

but it didn't function properly

fierce verge
grand temple
cedar iron
#

ah, good to know, thank you
i was under the impression that any name would work as long as it matched between the network, and the custom event

grand temple
cedar iron
#

ah well oki

scarlet lake
#

the buttons have a trigger box.

grand temple
#

also it will break things if you name a custom event exactly the same as something else, so call it like NetworkedOnPickup

cedar iron
#

oki :3

fierce verge
#

@grand temple since you helped me out yesterday with the sync, got any idea why this doesnt sync the integer?

#

Mode is a Synced variable that gets set by a button

grand temple
#

sending a network event onplayerjoined does not guarantee which one will arrive first

fierce verge
#

so instead of onplayerjoined I should have a ondeserialization that updates integer as a networkevent?

grand temple
#

no network event at all

fierce verge
#

so on deserializations just update the mode locally?

grand temple
#

yeah

#

also when setting the value, make sure to take ownership first and if it's manual sync, do RequestSerialization after

fierce verge
#

I dont quite understand that

#

I want it to sync when someone joins, because when the value changes it does that in a networkevent so that syncs, only late joiners dont get it atm

grand temple
#

network events are a very basic way to sync that is prone to breaking. You should use synced variables

fierce verge
#

and what about the ownership and manual sync?

grand temple
#

that's what you need to do for synced variables

#
  1. Take ownership
  2. Set variable
  3. RequestSerialization
fierce verge
grand temple
#

that will make it so everybody has the same variable and they will receive OnDeserialization when they get it

fierce verge
grand temple
#

no it is not

fierce verge
#

so after setting a variable I only need the requestserial

grand temple
#

if it is manual, yes

fierce verge
#

and when someone joins they trigger a receive serializations

grand temple
#

yes

#

there are two different ways to sync: manual and continuous. You can only have one type per gameobject, even if you have multiple udonbehaviours on the same object. If an objectsync is on the object you are also limited to only have continuous

Continuous syncs the variables automatically about 5 times per second and you are very limited in how much data you can sync. About 120 characters if it's a string.

Manual syncs the variables when you requestserialization and also when a player joins. It has a much, much larger limit on data (like 60kb)

fierce verge
#

ahhh thanks

#

So this would change the value of the synced variable "speed" and save it?

#

and then when a player joins it gets it automatically? or do I need to call deserialization?

grand temple
#

You're doing that inside a network event so this will run for everyone

#

and only the owner can call requestserialization

fierce verge
#

only the master is able to run this command anyway

grand temple
#

but it's a network event

#

so everyone will be running it

fierce verge
#

ahhh

#

I see

grand temple
#

you should separate the logic so that the master is setting the variable, then everyone is applying that variable to the objects

fierce verge
#

Like this?

#

forgot to connect For to SetInt tho

grand temple
#

yes, but don't use a network event. That creates a race condition where it depends on which one arrives first. The synced variables take a different path across the network than network events so you can't guarantee which will arrive first

#

That's what OnDeserialization is for

fierce verge
#

so replace the event custom by Ondeserialization

grand temple
#

yes

#

though the owner won't get OnDeserialization, so you'll need to call this function after the requestserialization

#

or you can replace it with an OnVariableChanged of the value which will happen for everyone

fierce verge
#

I cant click the Event Ondeserialization in the add menu???

grand temple
#

do you already have that event somewhere in here?

fierce verge
#

no?

grand temple
#

are you sure?

fierce verge
#

yes

grand temple
#

I don't know what to say other than check again ¯_(ツ)_/¯

#

scroll all the way out, look at the minimap

fierce verge
#

I added it but removed it afterwards, does that cause trouble?

grand temple
#

shouldn't

#

might cause problems if it's not compiling properly

fierce verge
#

I dont get any errors

#

I reloaded and compiled again but to no succes

#

I can add other nodes just fine

outer goblet
#

Hi All! Does anyone know if there is a way to switch scenes on a collision or button trigger?

fierce verge
#

I tried it in another script and I can add it, remove it and add it, but for some reason I cant add it

grand temple
outer goblet
#

Damn 😞

fierce verge
#

Use teleport instead

outer goblet
#

Ty phasedragon. Will do

fierce verge
#

Is there a way to search in the udon graph? because I cant find the OnDeserialization but I cant add it

grand temple
fierce verge
#

I cant see the OnDeserialization in my graph but I cant place a new one

grand temple
#

idk, try a new graph

fierce verge
#

I tried in another, that works fine

#

but this graph is linked to my entire system 😦

grand temple
#

so move everything you have to a different graph

fierce verge
#

I used ctrl+A did copy

#

and I still cant place it hmmmm

#

so its probably somewhere in there but I cant see it

#

I got it... it was behind a larger node

#

@grand temple this should work right?

grand temple
#

the animator is not plugged in

fierce verge
#

ah yes

grand temple
#

also this won't work for the owner because they don't receive OnDeserialization

fierce verge
#

so behind the Customevent I need to trigger the setinteger aswell right

grand temple
#

just have some way of applying the value for the owner, yeah

fierce verge
#

okay, let me fix it up and test, thanks in advance!

fierce verge
tribal elm
#

I have a button setup and I'm trying to make it toggle the music. This looks like it should work yet when I push it the button disappears and the music keeps playing?

night viper
tribal elm
#

Nice I attached it to a cube and it worked, thank you.

hollow smelt
#

is it normal for a pickup item to shake violently when you pick it up?

paper galleon
#

Nope

#

Is it on the right layer?

#

Is it colliding with something

hollow smelt
#

mmm not sure

#

ill send you a screenshot

gusty dune
#

I think I need to place the destination cards on the board and assign positions, or if I place dummy destination cards and replace them with the cards from the pool, that might also work

#

Made two object pools destination groups, one for blue and one for red, now to figure out the udon logic

wind atlas
gusty dune
#

Appreciate the help!

wind atlas
#

I'd have some way of retrieving the next position, and then use that as your destination for that particular spawned object.

#

The way you would do that then is: GameObject (from TryToSpawn) -> transform -> SetPositionAndRotation

#

The next destination depends on the rules of the game. But I feel like that could get advanced quick. Are you familiar with arrays? Ideally you would save the state of your board in some kind of dedicated game manager script using arrays. That script would provide the next destination to spawn that's free because it would track which ones are occupied.

wind atlas
gusty dune
#

Aye, basically the game will be semi manual, so knocking down cards is done by the players themselves

#

The automated portion is populating the board from the pool

wind atlas
#

I see, yeah you can do it kinda like I said with the: GameObject (from TryToSpawn) -> transform -> SetPositionAndRotation
except that instead of managing it in some complicated way, you can go through each destination and do the above.
I'll make an example in a bit, hope that will make sense then.

gusty dune
#

Thank you! I dont know if there's some good way to collaborate udon logic easier via a website

frigid magnet
#

Hello,udon beginner here. I am making a control panel for a lab experiment for school but I am not able to change the Ownership of the buttons so every user can change the values of different parameters. I was wondering if there is an easy way to change the ownership of an object?

wind atlas
gusty dune
#

There may be some extra complexity I just realized. After filling each board from the pool, each player has one secret identity selected from the board to be their person the opponent needs to guess

wind atlas
#

Honestly, in my example, you could even make an array of ALL people, not just red.

wind atlas
gusty dune
#

Thank you for going through so much trouble to help, I'll dig into your example and get back to you

wind atlas
gusty dune
#

I see you don't have an interact button but a "custom event", is this something one would call from another script with an interact button?

#

Like a function

wind atlas
gusty dune
#

Ah alright

wind atlas
#

I've realized a problem btw, I'm assuming you will have an animation that will flip those cards down, right?
My solution has the limitation that you can't move them after they are out of the pool. I'd need to find something for that.

frigid magnet
gusty dune
#

I figured making flipping manual, it would add more player randomness and emergent gameplay

wind atlas
#

So when you want to flip red card number 5, for example, you wouldn't know which one of the people it is.

wind atlas
wind atlas
#

For this to work, you will need to create GameObjects in the middle of the destinations (the white images) that you already have. The people cards will be parented onto them, which means you can animate the parent and the children will move with them.

#

The second one is for resetting the game, which you probably also need.

gusty dune
#

What do you put in the destination transform variable?

wind atlas
#

Basically, this will be the start state of your hierarchy:

gusty dune
#

Ah so you dont use an object pool for the destinations, just the position and rotation parameters from the game object

wind atlas
gusty dune
#

This is the object and variable setup currently, havent started with the graphs yet

#

I've gotten lost in the complexity but I set this up but it doesn't do anything when hitting the button

#

Does transform Set localPosition and localRotation sync between players or just locally?

wind atlas
#

An easy solution would be to do a SendCustomNetworkEvent after the For loop Exit.

#

Then on that event, you loop over every Transform and reset the local position and rotation.

#

Enable/Disable is handled by the pool already.

gusty dune
#

Right now it's not doing anything. I'm not good at debugging udon using unity

wind atlas
#

If it crashed, then the console probably has a message. You could try posting that.

gusty dune
# wind atlas

Its not crashing. In your video you are able to run the script directly in Unity, how is this done?

wind atlas
gusty dune
#

Right now I'm using the Build & test option

wind atlas
#

Get that, it will save you so much time.

gusty dune
#

Installing

#

I got it installed and was able to run around and run the _Interact script manually, but there are no errors in the console when doing so. Any clues what to try next?

hollow smelt
#

same i have that problem too

#

not sure if your fixed yours?

scarlet lake
hollow smelt
#

ok!

gusty dune
#

After running it did populate the game objects

#

But nothing is showing up

#

ahh

#

The parent is disabled, so the child is also disabled

wind atlas
#

Yeah, pool will disable them automatically. Do they have to be pools?

gusty dune
#

If I manually enable they were moved

#

So question is, can the objects be placed without being the child of the destination?

wind atlas
gusty dune
#

I'm not actually sure what disables them by default in the first place. The pool I thought was required

#

They are enabled in the editor

wind atlas
#

To do that, the VRC Pool disables each objects until you need one of them.

#

In your case, the card destinations are static, you only have a specific amount. That's why I don't think you need a pool for them.

gusty dune
#

Ah sorry. Hm, I did read in a previous discussion that pool are required for syncing. I'll try removing it

wind atlas
gusty dune
#

Nice I got populating the red cards working in the emulator! Now to get this synced for all players before doing the same with blue and the "who" cards for both

gusty dune
#

I shuffled the cards and joined on another account testing and the cards are in the same position for both. Also when shuffling it shows the same for all players!

#

Only the first joiner (the instance owner I assume?) can shuffle the cards however, if another player shuffles the cards reset to their original positions

wind atlas
#

Yeah, I was fearing that.

gusty dune
#

Its not actually bad to only have the instance owner be allowed to shuffle cards though

#

However, the other players shouldnt be able to do so at all

#

Avoids someone joining and ruining an ongoing game

wind atlas
#

Yeah, check for the owner (Networking -> IsOwner) right at the beginning, before you do anything.

gusty dune
#

Hmmm something strange. Getting some penrose triangle weirdness for the populated objects when trying to pick up and move them afterwards. Any clues what this is about?

#

This just happens for the instance owner, for other players it shows correctly

shy cipher
wind atlas
#

Ahh, nevermind. The cards look fine (they transform with the frame).

#

I'm not sure why exactly it happens, this is definitely some kind of issue with Pickups.

shy cipher
#

whenever i export it just shows the camera instead of the menu

#

can anyone help?

#

i have reinstalled the sdk and unity

#

still doesnt work

gusty dune
wind atlas
#

Show the transform of the pickup parent.

#

Scaling there can't be weird.

shy cipher
#

can somebody help?

wind atlas
# shy cipher can somebody help?

Do you have the right Unity and SDK version? Did you follow the steps of whatever packages you are installing properly? Is the scene truly fresh?

gusty dune
wind atlas
#

Your issue sounds like some camera is overriding your view.

gusty dune
shy cipher
#

i have unity 2019.4.31f1

#

and the latest ver of sdk2

#

avatars work just fine

wind atlas
# gusty dune

I was talking about the parent of your pickup. I assume it's DestinationCardsRed.

shy cipher
#

just when ever i upload a world it happens

#

picture of it

wind atlas
# gusty dune

General rule of thumb, do not have weird scaling on Pickups, or any container game objects. Only scale the actual meshes, and separate them from pickups.

wind atlas
# shy cipher

I have no idea about SDK2. Make sure you do everything that's written in the documentation.

shy cipher
#

yup

gusty dune
#

Oh like here, it should be 1,1,1 for x,y,x scale?

shy cipher
#

its just a vrc world and a floor

#

nothing else

wind atlas
#

But yeah, I don't remember what the solution for that exactly is, just play around with the scale and follow my guidelines. Should be fixed then.

gusty dune
#

At least in the emulator

shy cipher
#

welp guess im screwed

wind atlas
gusty dune
#

@wind atlas I'm not sure about the UDON logic here, do I split the output from the Shuffle node? I'm going to use the same cards for both Blue and Red side but there is only one output

#

My For loop is going through all the redDestinations but I need another For loop for the blueDestinations

#

Do I need to save them in a variable for each loop?

wind atlas
#

Is that what you are saying?

#

There are no duplicates for the same player, right?

gusty dune
#

I think both the red and blue board should be the same if I remember the rules right

wind atlas
#

If you want duplicates, then you want to create 2 pools (just copy paste your current one). That's probably the easiest way.

#

Then do the logic you have twice for each pool/destination pair.

gusty dune
#

Trying to remember exactly the rules, I think both boards can be different, but the 1 chosen "who card" needs to be one from the opponents board, otherwise it would be impossible to guess it. If both sides are identical it makes the game easier but you risk both picking the same person.

#

So I should shuffle each side individually, then pick one random card from the opponents shuffle.

#

I figured out how to check the instance owner.

wind atlas
#

Since you assign the Transforms in the editor, you know which ones are which sides. So you could just check for a specific index in the for loop and use that card for the other person.

#

Here is what I mean by the way:

gusty dune
#

I can do that in code but not in this node system. Thank you, I was searching for old examples

wind atlas
#

It's a bit ugly, but I'm trying to solve this without many extra steps. This is where using udon sharp is better.

gusty dune
#

Yeah

wind atlas
# gusty dune Yeah

Are you aware of UdonSharp? Get it and you can write C# like code for udon.

gusty dune
#

I know of it, but I'm rusty on object oriented programming and would have even more trouble doing that I think so trying out the node system.

wind atlas
#

You always need the machine code to be compile so the scripts actually work.

wind atlas
blissful shore
#

any good tutorials on making a video player with multiple URLs? like avideo juke box kinda

wind atlas
gusty dune
#

Thank you so much for all the help I'm learning a lot ! ❤️

blissful shore
#

Need help making a video player, I tried to use a simple toggle switch to change the url of youtube videos but only getting audio for 1 and both audio and video for the other.

thorn wolf
#

How would one change multiple Floats into a Vector2 in Udon

blissful shore
#

dont know if this answers your question but Momo the monster said this a while ago . I hope this helps

#

Momo the Monster — 08/09/2021
Yeah, variable serialization/deserialization order is not guaranteed. If you absolutely need variables to be updated at the same time, you'll need to use a struct that can include them both, or an array. This is how the new Video Player Example works, keeping two floats in a Vector2 to ensure they are always updated together: https://docs.vrchat.com/docs/udon-video-sync-player#update-time-and-offset

thorn wolf
#

Thanks for the help!

blissful shore
#

@thorn wolf high5!

#

Hi everone, I hope all is well this week. I'm trying to make one video player that plays 1 video at a time but changes the video according to which toggle is clicked . any pointers, udon graphs tutorial videos?

blissful shore
#

I'm going to attempt to convert this tasty music player script to make a scrumptious video player script...

cedar iron
#

I have a gun that shoots rigidbody pucks. How do I tell if the pucks collide with something?

blissful shore
#

that sounds awesome @cedar iron

#

I wish I could answer that

mossy crane
#

The event lets you grab the player that was hit as a reference to do stuff to that player

#

And heres a example to test if it hits anything else

#

Im getting the layer of the thing it collided with, and all layers are numbered in order from 0-20+ so if you want to test if it was on Default layer you test Layer = 0

#

the DeflectLayer is just a number which for me is 23

cedar iron
#

I have a gun that shoots, but one of the two instances has the ammo freezing in place...

mossy crane
#

is it object pool or instantiate?

#

or a animation

cedar iron
#

neither, it's a cloned rigidbody

mossy crane
#

is the ammo visible on the gun? Like live rounds just sitting there until you move it and fire it?

#

or is the ammo and the puck a different object

cedar iron
#

they're elsewhere in the world

#

separate objects

mossy crane
#

And do each gun have their own ammo they take from, or is it a shared pool

cedar iron
#

it's one gun. The puck on the floor is the one that is duplicated

mossy crane
#

does the puck have its rigidbody with Is Kinematic checkmarked or unchecked?

cedar iron
#

no

mossy crane
#

and what happends when it collides with something, is it suppose to freeze?

cedar iron
#

"nebula animations" is the one who is developing this, keep the conversation with him

#

he's typing now

fossil parrot
#

Heyo! Currently the object work on the host client but stutters on the secondary clients. will send video

mossy crane
#

do you use Object Sync on your rigidbody to handle the syncing of position?

fossil parrot
#

Yes

#

Left is the host

mossy crane
#

Hmmm, the Object Sync is probably gunna look choppy just because its not very good at updating moving stuff like that. but the fact it just freezes for 1 client and functions properly for another is weird, looks to be something to do with your collision event. what all happends after the puck hits the cube

fossil parrot
#

Here is what powers the gun

#

And here is what happens on the hit

mossy crane
#

and what does the puck look like in the inspector?

fossil parrot
#

The second chunk of code is placed directly on the cube

mossy crane
#

Udon usually prefers a "Manual Sync" on the udon behavior vs a continuous for syncing stuff, especially for guns and firing stuff like that try making a blank gameobject called ManualSync or something

#

then a new Udon Graph called like ManualSync

#

and add that to the Manual Sync Object

#

heres my gun i use for instance that syncs well

#

the SpawnBullet1 is just a Public UdonBehavior variable on my gun, that i point to the ManualSyncs Udonbehavior to call a event

#

Then basically this on the ManualSync except add whatever you want it to do after instantiate

fossil parrot
#

Setting it up rn.

mossy crane
#

Its a bit much, but once familiar will help alot with syncing stuff. Imagine SendNetworkEvent as a 1-3 second timer based on latency

#

And a Manual Sync Serialize/Deserialize, is a .3 second reaction

#

bit more to set up, but worth

fossil parrot
#

Holy cow, yeah. Im trying to wrap my head around how you set this up. Getting slightly confused on where to put the manual sync script

mossy crane
#

and i dont use Object sync on my bullets

#

and it looks good for everyone still

#

manualsync just has its own Udon Behaviour and i use the ProgramSource as the new graph

fossil parrot
#

Ohhhhhhhh ok, i gotta incorporate this into my current setup

mossy crane
#

maybe backup/save a prefab of what you got

#

in case

fossil parrot
#

If you would be interested in a VC id be down.

mossy crane
#

That would work

vernal magnet
#

Hi everyone. I'm trying to make a script where the default Unity fog changes locally when a player walks into a trigger collider, and changes back when I exit. This is what I have so far and it doesn't do anything. What am I missing?

tepid salmon
#

You not conectet the onplayertriggers with the branch

vernal magnet
#

Ah pff that would help, thank you.

vernal magnet
tepid salmon
#

No idea inam no expert i only seeyet that you not conectet the branch sorry

vernal magnet
#

Ah okay, thanks.

tepid salmon
#

Np

blissful shore
#

@mossy crane do you by chance know how to make a video player that plays different youtube url's according to which ever toggle button is clicked?

vernal magnet
#

Okay, got the colliders working properly and even set a nice transition, but when I enter the world immediately transitions to no fog and the transition doesn't work properly until I enter the collider once. Any idea as to why?

mossy crane
indigo finch
vernal magnet
wind atlas
# blissful shore thanks anyway

What video player are you using? Usually, they should've some sort of method you can call to start a specific url. A VRCURL variable (or whatever it's called) is usually used for that.

vale skiff
#

Does anyone know where I can get an asset that would allow players to fly ing my vrc world?

thorn wolf
#

are there any lists/tables in Udon?

vestal mist
#

im having a issue with udon sharp and its aborting the Upload something about udonsharpbuildcompile

wind atlas
wind atlas
vestal mist
#

i just fixed it i just reimported the UdonSharp

#

Its it easy to add a Animated Image in to the World?

#

Like a Gif

wind atlas
junior vortex
#

This maybe random but is there a record for most bottles balanced in vrchat?

dapper lion
hollow smelt
#

so for some reason when i pickup this item here it starts to shake violently

#

when i check is trigger in box collider it stops but then the object just falls thru the ground

#

so you need to act fast to get it before if falls thru tthe objectt

#

mmm it stops when i dont use gravity

#

weird

visual elm
#

can i get some help with particles for Udon?

#

i want it to be a sequence when playing the first partickle, the second one plays, is it possible?

primal ocean
#

Is my SDK broken? I am using the new sdk but I am missing udon behavior. Is there a fix for this? I was able to upload the world and I can create graphs with this project. What am I missing?

dapper lion
primal ocean
#

Ah... I added it to the canvas but not the slider as well. Thank you

dapper lion
#

only slider should need

scarlet lake
#

A script that locks players in xyz axis?

#

to be activated or deactivated with a button, do you know where I can find it?

visual elm
#

can i delay the particle to play?

gusty dune
# wind atlas Here is what I mean by the way:

Can the same object from a VRCObjectPool only be spawned once per script?
I'm continuing working on the "Guess Who" board of cards from a shuffled pool. But when the same card is being placed via a transform SetLocalPosition and SetLocalRotation a second time, it doesn't seem to get placed. I could be mistaken though of what is wrong.

night viper
visual elm
#

ohhh, hmmm, i'll give it a try

wind atlas
#

We could create a duplicate ourselves just to display it for the user.

#

I'll write some udon code for that, might as well. Just getting kinda annoying working with Udon, this is exactly when I'd use UdonSharp.

gusty dune
#

Could it work by having a secondary pool? That might not be as elegant though

wind atlas
#

So if you look at red side, select one to show to the blue player, we don't know which one it would be in a pool.

gusty dune
#

Can you make a copy of the child from the destination pools after it has been picked from the pool?

#

For example duplicating the child contained inside
DestinationCardsBlue\GuessWhoCardDest (1)
and
DestinationCardsRed\GuessWhoCardDest (1)
and place the duplicate at the opposite side

wind atlas
gusty dune
#

Ah damn

wind atlas
#

Are you okay with using UdonSharp?

gusty dune
#

I can try, it's already gone way above my head so I'm pretty much dependent on your help anyway. I do appreciate it but I understand if you dont want to help with most of the work

wind atlas
#

Just going to do it in UdonSharp real quick. Will be a lot easier for me.

gusty dune
#

haha ok thanks again

brazen epoch
#

is set Transform.rotation additive? I'm trying to rotate an object over a Time.fixedDeltaTime, but supplying the previous values of the Quaternion to a new Quaternion seems to be additive

#

This code causes the Object to follow multiple axis' of rotation when the code should only support 1 axis

public void Start()
{
    previous_interval = interval_min;
    RecalculateStep();
}

public void FixedUpdate()
{
    if (interval_min != previous_interval)
    {
        previous_interval = interval_min;
        RecalculateStep();
    }

    if (rotation > 360 || rotation < -360) rotation = 0;

    float finalStep = axis_negative ? -step : step;

    rotation += finalStep;

    if (axis == "x") transform.rotation = new Quaternion(rotation, transform.rotation.y, transform.rotation.z, transform.rotation.w);
    else if (axis == "y") transform.rotation = new Quaternion(transform.rotation.x, rotation, transform.rotation.z, transform.rotation.w);
    else if (axis == "z") transform.rotation = new Quaternion(transform.rotation.x, transform.rotation.y, rotation, transform.rotation.w);
}

private void RecalculateStep()
{
    step = ((interval_min * 60) / 360) * (Time.fixedDeltaTime / 60);
}
#

Transform.Rotate is not additive, but this doesn't sync which is what my goal is

brazen epoch
#

seems like I just had to mess with eulerAngles instead

wind atlas
#

You don't need a VRC Pool anymore (it wasn't necessary anyway). You can just remove that one, and just assign the parent Transform of all the cards to Cards Pool:

gusty dune
#

Awesome, will take some time for me to digest. Does that not network desync though?

wind atlas
#

Oh yeah, and to make sure: You have to remove the VRC Pool component otherwise the script won't work.

wind atlas
#

And yes, it's a lot to digest, it got more complicated than I thought it would.

#

I can answer questions, if you have any.

gusty dune
#

Hmm I'm looking at it, don't you need to declare an event to interact for it to show up in the Udon behavior script?

wind atlas
#

Just create a UdonBehavior and call SendCustomEvent after interact on that udon.

gusty dune
#

Im confused about mixing graphs with UDon Sharp, when I add multiple Udon behavior scripts to the same object you get this warning

#

Or do you add it to a different object?

grand temple
#

you can have multiple udonbehaviours on the same object, you just can't mix continuous and manual

wind atlas
grand temple
#

if one of those behaviours does not have any synced variables then it doesn't matter what sync method it's set to

gusty dune
#

Hey Phase, nice seeing you here 👋

#

In the methodName variable for the script how do you reference the other Udon behavior? As it's a string, do you enter the name of the UdonSharp Program in the local folder?

#

Sorry if I'm not understanding it properly

wind atlas
#

You drag the script into the udon variable.

gusty dune
#

Oh you have to drag from the script property in the inspector from the GameObject, not the script in the heirarchy editor

wind atlas
gusty dune
#

Holy heck its working. Thank you so much

#

Doubt this map will ever get popular but I'll add a thank you note to you in the map description

wind atlas
gusty dune
wind atlas
#

Well, glad it fullfills that purpose then.

feral valve
#

When I unpack ukeyboard prefab to delete thinks I dont want, the chat canvas no longer works. It doesn't go on the board for others to read.

blissful vapor
#

how would you make a spectator UI like in jar's worlds?

mossy crane
#

So im using rigidbody instantiation for my projectiles(I know its shameful). Would I be able to do a decent raycast favor the shooter style hit detection... but simulate a believable bullet still "travelling" to the person hit

indigo finch
# empty mantle ok is there a node that plays animations like audio nodes on how theres a play a...

Here's a tutorial on how to make an animation play when you click an object. This particular example covers firing a trigger on an animator, but hopefully this covers enough to help those wanting to change a int/ float/ bool on an animator as well.

So hopefully this is helpful. As always, if you have any questions, feel free to ask in the comme...

▶ Play video
brazen epoch
# blissful vapor how would you make a spectator UI like in jar's worlds?

Use a camera and a Custom Render Texture. CRTs can go on any material where any other texture can. If you want icons to follow objects in the spectator screen but not show to the players, you need to set the icons in the Mirror Reflection layer and make sure the camera is showing that layer.

#

you should set the update frequency of the CRT to something reasonable like 0.2 0.3 instead of 0.0 as the default since updating every frame is usually in-perceivable and wasteful of system resources.

topaz sorrel
#

So I need multiple cameras that all sync up to their own individual monitors, like I need 5 cameras and have each one show on two different monitors, so like 10 monitors total, two of each showing the perspective of one camera

keen crystal
#

I made interactable doors and want them to only be usable by certain players, can i filter by usernames in udon? Ideally i‘d like to use a hard coded list of players

iron vault
#

I'm having an issue with avatar pedastals in my world. Seems like no matter what I do they stop working. If I drag in one, it works fine, I can remove it's base & all that no worries. If I duplicate it, they all stop working. If I drag in 10 individual ones none of them work. A friend sent me a prefab of a working one from their work, works fine till it's duplicated, then it all dies again

#

It seems like all my settings are correct & nothing else has changed but nothing makes them function

#

They all appear in the game, have the right icons in them, but clicking them does absolutely nothing

#

Nothing appears in the console, and their doesn't appear to be any actual errors in the debug in-game

#

They're all on the environment layer but, even on default or any of the others it just doesn't function

#

Any ideas appreciated. This has been doing my head in cause it seems to be broken for no reason at all

keen crystal
#

could it be that the id for each pedestal stays the same when you copy paste them, and that causes conflicts?

iron vault
#

and if I drag in the default ones that all have the same ID for the robot, they all work & change your avatar

#

until I modify them at all, it seems

iron vault
#

E V E N better

#

made a backup of my project

#

followed the instructions on how to update the SDK which is legit "close it, delete the files, re-open it"

#

and now the project will not open so, I guess I never get to update my sdk again

mighty fjord
#

Did you try unpacking the prefabs after placing them into the scene?

iron vault
scarlet lake
#

There’s this weird bug on the Quest and Quest 2 where the default viewing method for avatars is set to fallback. Is there a way to change this?

#

I know I can change them individually but idk how to set it so I can see all user-made avatars server-wide

dapper lion
scarlet lake
#

Oh

iron vault
mighty fjord
#

You can't make the user switch to an avatar of a pedestal which is turned off, could that be what's causing what you're describing?

iron vault
#

Nah so, theres a button that enables a bridge & platform, with the avatar pedastals on that platform, the button turns them all on at once

#

if the pedastal is placed out there & left on, it functions fine. if it's put under the same toggled game object as the platform, it doesn't work

#

it's turned on, visible in game and you can click the object, but it will not change avatars

ripe crescent
#

does anyone has examples to toggle seperate objects at FX layers on VRC avartars?

modest rapids
#

hello all, would someone please spend 10 mins or so to walk me through some udon graph stuff, (i struggle to understand videos or explanation so id like to share my screen) i only need toggles for on and off and a sleep mode (so lights dimming and screens off and a few things changing via the toggle like my roof changing to a different roof and sky box changing)

dapper lion
lean herald
#

is it possible to call a variable from another udon script? If so how?

modest rapids
dapper lion
#

make cube, click cube in hierarchy, go to inspector, add component -> udon behaviour, add toggle graph into the empty slot in component, put game object you what to toggle in the toggle object box, move thay cube in your scene to where you wanna be able to click it, and build and upload/test and see if it toggles the thing

modest rapids
dapper lion
#

send ss of inspector of cube and whole unity window

modest rapids
dapper lion
#

no

modest rapids
#

thanks :/

scarlet lake
#

how crap is nav pathfinding performance? Does udon create any overhead?

peak ether
#

does anyone know how to make like a car or like a surfboard or those kind of physics on a gameobject in unity with like udon or scripts to then upload in your world ??

#

or like does anyone know any tutorials Because I cant find any

long lark
#

Hi, trying to make an audio stop when toggled again this is the script so far, what do I add?

wispy scaffold
#

Hi everyone, I gotta probably simple issue that I just can't figure out. Whenever I make an interactive object, and use it in testing it disappears out of the map.

#

Anyone know why?

long lark
#

omg thank you so much

dapper lion
mossy crane
#

You can go into a graph and top left add a Udonbehavior variable, and then click the drop down and make it public, then compile. Then in the inspector on that gameobject you can drag the gameobject with the other udonbehavior you want into the blank space, then you can GetUdonbehavior or set udonbehavior variables

#

And it will have a drop down of valid variables

long lark
# topaz jetty

I don’t know where to find the playing and set playing nodes? I’m very new udon sorry :(

topaz jetty
#

on the left it says variables

#

press the plus and then type in bool, set the name to playing by double clicking the name

#

then drag the name playing in, and then drag it in again but this time while holding CTRL

long lark
#

Thank you your a life saver!

uneven sphinx
#

Is there any documentation on creating worlds/games using script instead of the graphs?

mossy crane
#

Look up UdonSharp, it’s a C# style scripting that uses Udon behaviors. It’s a separate download but it’s highly recommended

#

U#

uneven sphinx
#

Cheers

#

Is it the git repo by merlinvr?

wind atlas
#

Yeah, you can find some useful information in the wiki there too.

uneven sphinx
#

Nice

wind atlas
#

But honestly, most of scripting is about knowing the Unity API too.

lean herald
wind atlas
uneven sphinx
wind atlas
wind atlas
#

Hard to figure out some stuff, so just ask people or search the discord.

uneven sphinx
#

Will do, cheers.

scarlet lake
wispy scaffold
wind atlas
dapper lion
wispy scaffold
#

It compiles correctly.

#

Console is clear

#

It quite literally deletes the object.

uneven sphinx
#

When a player leaves the instance, if they are the owner of an object, does it automatically transfer to a new person? Or is that something you have to do your self?

wind atlas
#

It shows this

#

So of course it disappears.

wind atlas
wispy scaffold
#

So this

#

Gotcha

uneven sphinx
uneven sphinx
#

Hmm, are lists not supported by udonsharp?

blissful vapor
#

ok, I had a question

#

How would you make audio sources play if an event happens? (ie, Player grabs objective, time is running out, team A or B is in the lead, or Team A or B is losing)

fiery yoke
blissful vapor
wind atlas
#

You can enable/disable it using animations or udon scripts.

#

You could also call AudioSource -> Play in an udon script instead.

blissful vapor
#

ok thanks

wind atlas
# blissful vapor ok thanks

Also, you can do AudioSource.PlayClipAtPoint. It doesn't even need an AudioSource for that, it will be spawned and deleted for you.

blissful vapor
#

nice

wind atlas
#

Not as optimized, but sometimes get the job done.

blissful vapor
#

thanks

blissful vapor
#

ok sorry for asking too many questions, how do i make game options, and a start game button

uneven sphinx
#

When a player enters a trigger, how you you know it was the player?

modest rapids
wind atlas
night viper
# modest rapids whats wrong?

How are you calling the custom event called "toggle"? If you are just trying to "click" on an object/cube you would use the event "Interact" instead of a custom event.

modest rapids
wispy scaffold
#

It says udon graph can not be used in play mode, yet I'm not in play mode? Any fix or do I just have to reopen the project every time this happens?

grand temple
wispy scaffold
#

I'd have to run into it again, I just restarted the project to use it.

#

Sorry, But for sure I will @ you when it happens again at that point.

#

@grand temple

grand temple
#

oh, can you go to the console and take a look at that error? Something looks broken

wispy scaffold
grand temple
#

are you using udonsharp?

wispy scaffold
#

No, yet they're sharp errors

grand temple
#

did you intentionally import udonsharp yourself or did it come included in some other package?

wispy scaffold
#

Included I would assume

#

I did not do it intentionally.

grand temple
#

ah, whoever made that package that included it should not have done that. It will definitely break things

wispy scaffold
grand temple
#

yes it is

wispy scaffold
#

Okay thankyou

visual elm
#

i need someone with full knowledge in Keypads

#

when i want to enter the correct passcode, the sound should play, i can't figure it out how

#

can someone assist me?

flint urchin
#

What do you have so far?

visual elm
#

i don't know if onenable is the right option

#

and the sound file is parented to that file

#

when i put in the right code, game object plays within several udon graphs, but the sound

visual elm
#

@flint urchin is there anything that needs changing?

flint urchin
#

OnEnable requires the object to have been enabled once first.

visual elm
#

hmmmmm

flint urchin
#

Idk what this single object does, but you could remove it all together and use PlayOneShot in the one that triggers this behaviour

visual elm
#

one sec

#

on the keypad switch, most were normally toggles as i switched out from interact to OnEnable

#

like this?

flint urchin
#

No, sorry, depending on how your main udon behaviours are set up, you could use that in there

#

As you want to use this, you'll need to trigger it with Start, as the object is disabled in the beginning

visual elm
#

oooh, i see, one sec

#

so when i set that to start, when the object turns on, it plays right away?

flint urchin
#

It should yeah

visual elm
#

ok, i'll test it

flint urchin
#

(Don't need to use PlayOneShot then, so you can revert back to the other one)

visual elm
#

but when the game object is parent to the keypad switch, when it gets turned on, the object that is already on plays with start event, correct?

flint urchin
#

yeah

visual elm
#

ok, gotcha

flint urchin
#

Why I recommend you look up how PlayOneShot works, as you'll be able to reduce the amount of active audio sources you have at any given time (as we only have a limited amount).

But that does require a bit of rework of your graphs. So for a later time ^^

visual elm
#

i see

#

i tried it, sound played, but it cut out quickly

#

most of these udon behaviors in this keypad switch are set like each of these objects

#

@flint urchin anything needs changing?

flint urchin
visual elm
#

the thing is, the audio's lenth of a sound is 00:00.5, it only played to 00:00.1

#

length

#

yeah, it's not playing the whole thing

#

what do i do?

elder frigate
#

is there a basic combat system for Udon?

visual elm
#

i just improvised an idea

#

make a trigger to play the sound within the trigger box

valid totem
#

Is there a built in way to handle sorting arrays? Array.Sort doesn't seem to be available unless I'm mistaken

slate orchid
#

how do i make it so when i pick a item up it plays a sound

mossy crane
#

Audio source on game object you want to pick up

#

Some sound clip in your project

#

New Audioclip variable in the graph, make it public

#

Drag the reference in

#

@slate orchid

slate orchid
#

can someone show me how to do this in udon graph

#

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

#

@mossy crane

mossy crane
#

Hmm gunna need to clarify the intended function

#

Collide with something, see if that something has a certain component, if it does, get that game objects behavior and decrease health?

#

@slate orchid

#

and as long as the object being collided with has a matching Custom Event to your string it should fire

slate orchid
mossy crane
#

This should do that

#

if you put this on the bullet

slate orchid
#

do i put it on the box or bullet

#

oki

mossy crane
#

and the box is existing in the scene

#

with another graph with a Custom Event named for instance DecreaseHealth

slate orchid
#

there is some udon# my friend wrote for the bullet tho

mossy crane
#

I dabble in graphs more than U# so I wont be able to help much i feel, but this first request seemed easy enough to understand lol

slate orchid
#

can i put too udon behaviors on it

#

cus i do not understand udon# and do not want to rewrite what works

#

@mossy crane where do i get the set other behavior

mossy crane
#

the variable on the left named OtherBehaviour, when you drag it into the graph, holding ctrl and dropping will set

#

instead of use

slate orchid
#

ooooooo oki

#

soo how would i set it so that it set off another udon Behaviour

mossy crane
#

you have your bullet, with a collider, looking for the cube collider

#

thats the graph

#

then as long as the cube that got hit has its own graph

weak violet
#

What's udon

mossy crane
#

start with that on the cube