#udon-general
59 messages · Page 84 of 1
??
same graph
you could make a sendcustom event behind the graph that enables it
and then a custom event before this one
calling it like "UpdateButton"
i tryd both, with and tihout connecting with setactive
and clicked before compile
it doesnt work
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?
but then the mirror stay active but without the button get the coloring
hahaha so it trys to color nothing
how to do it?
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
there is no button
aaaahh you mean the toggle xD
yes
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
oh this would be cool too lol but i try first to make it work how it should be xD
xD
xD
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
yeha that probably the alpha
Yesss
its workiiinnng
whuups
lul
and now you can copy the component and paste as new on the other one
oh you could actually use this xD
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
the thing is, actually i need the connection from "set Active" to make the LQ Mirror disabled if HQ is on, but i remembered that i can make more "Set Actives" and connecting it
yess
No problem
if you have any other questions just post them here 🙂
i think i have the problem what i thought xD
how to connect both?
just do one then do the other
as long as they have the same name they trigger both
the white line indicates the order in which things happen
could also do that
you can't have two things happen at the same time
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
and no, that does not work. I just checked
ah I tought it did xD
my bad
even if that did work it'd be so messy and please god don't do that
short: i cant make both? xD only color change or object toggle?
no, just make it flow from one to the next
yeah
every event has an input and an output arrow
the line is just the order of actions
so you can do Event > SetActive > SetActive > Color
i dont understand how to do it now, xD
if i do this, then the button stays red
🥳
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
so basically both buttons turn a color but you only want one to turn a color?
if i click "HQ" then it is red, then if i click on "LQ" this is red too, but it should be that hq automatically turns to green because its deactived because "LQ" is now turned on
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
What do you mean with 2 Variables?
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
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
legacy locomotion has nothing to do with MMD animations
seems like every MMD world I have recently Played in forces you in it
then agian I could be wrong
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
the problem is now, if both are deactived they are so xD
I have tried to get VRC animator script working but it seems to not like being alone without all of the other avatar scripts
i think i give up with color thing, the main things works for now, thats enough for me xD thank youu for your help
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?
you may have to compile it
"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???
should I put my onplayerjoin on the same input as the customevent?
what?
I want to sync this toggle basically
just don't share variables between flow paths
but its derived from a pool
I have no idea what you're asking, all I can say is that dragging the line from there makes no sense
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
are all these objects going to have the same state?
then just grab the state of the first one
ahhh thats smart!
but how do I make it so that when that branch is true, it sets them all to active?
copy this part
thanks!
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
I got like 80 gameobjects I need to toggle at once
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
hmmm
I made everything in my world based on that pool idea
where it takes all items in a pool and toggles them
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
this one?
that's the node you would use to pull from a gameobject array
you need to have a gameobject array in the variables list on the left
yeah
Like this right?
yep
And then this would be my synced toggle
yep
why doesnt this do anything?
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?
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
but this doesnt work
the pool works but the gameobject array doesnt
try debug logging stuff
print the length of the array, print each item in the array
how do I even do this xD, I never had to debug since everything always worked except this array stuff
debug log
how?
where do I see the output?
What is Debugging? Debugging is how you learn about what's going on under the hood in the VRChat client and your world. It's a key skill to develop for programming in general, and for building your worlds. VRChat Logs When you use the VRChat client, it saves logs about things that happen like worlds...
if I do this my button object gets dissabled instead of my array
because you left setactive blank
ah yes
leaving a gameobject, transform, or udonbehaviour blank will always self-reference
im scared since i cant find a tutorial or anything that can help me with this
Anyone know how to teleport everyone with an event?
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
Not entirely sure how to do that....
Can you help me through the process?
watch some tutorials on networkin
right click the VRCSDK folder and click reimport
nah, it's a normal issue that just happens sometimes
but you said SDK3?
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
alright i gotta update all my worlds and avatars anyways
yeah thats what i thought
anyways ima go finish my world now
so i restart unity now?
is my sdk broken??
it did nothing
I'm trying to get a custom avatar, but my Unity wont work. Anyone know any solutions?
How can I make a synced integer in an animator?
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?
which packages are you trying to enable? That doesn't sound like a step I'm familiar with in installing the SDK
You might have better luck asking in #avatar-help since this channel is all about worlds
hold on
gotta reopen the menu
okay so packages and vrc examples
what files did i forget to delete when i updated?
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
oki
also what files do i have to remove just the sdk folder?
ima just load the backup before i updated
anything related to vrchat
I forget everything in sdk2, but it might have had examples too
there were two things in the assets folder so-
yup, didnt work.
since sdk3 doesnt work, do you know how to fix my sdk2 problem?
whenever i export it just shows the camera instead of the menu
what do you mean by that?
like the game view doesn't have all the build and publish input?
you have some camera that is overriding the view?
nope
what camera? what view?
what do you mean by export
build and publish
then how is that not what I meant here?
so you've got some camera somewhere that is rendering to the game view
just disable that camera
what exactly are you clicking to get to this point?
build and publish for android on the sdk
do you get any errors in the console?
idk, something is wrong with your SDK and I'm not getting enough information. Try a fresh install
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
I'm looking to check to see if a player is in a trigger, and if not, the door closes
Is that possible?
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
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?
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!
The CombatSystem isn't implemented into Udon iirc
I had to make my own implementation of Kill Boxes and such
Even ragdolling on 0 hp like back in SDK2?
Correct. That doesn't exist
big sad, thank you for the reply tho!
Of course. If you do find something official or supplementary, do tell please!
How did you manage size of avatar for your hitboxes if you ever went that route?
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
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
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
why 😦 the ragdolls were so good lol
I swear I've seen ragdolling used in an Udon world though.
Ragdolls imply Rigid Bodies which can cause performance issues
Perhaps there is a way to do that at runtime, but I haven't bothered
25 dmg per bullet, 100 hp, after 4 shots you freeze and respawn a few seconds
on my proj
other object
Oh wait. Do those methods actually work
I just tested and they seemd to
I swear the docs say deprecated
weather intentional or not lol
You can interact with Players in your world through the VRCPlayerApi. Each Player has a VRCPlayerApi Object, and your world fires the OnPlayerJoined / OnPlayerLeft events on any UdonBehaviours that listen for them when a player joins or leaves. This page includes info on using some general nodes. Si...
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
Seems to be not recommended so it might be deprecated and removed at some point
I'll just stick with my jank implementation for now for sake of support
exactly lol, future proof
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.
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
Nah, that's only for world particles, I'm talking avatars.
Ah okay
plz work lol
it does not ;_; but the player sees themselves ragdoll
Ayy close enough lol
?
This is what he meant in the comment
ok thank you
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.
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
I have a gun that fires rigidbodies, how do i remove them after a bit?
What're the rigidbodies actually doing?
This would work for a long while putting it on the object you fired
cant find destroy for some reason
thank you, i finally finished downloading all the songs my friends recomended lol and it works perfectly
@fierce verge do you know how to use the unity profiler for optimization?
It is possible to have ragdolling for remote players if setup correctly
ok is there a node that plays animations like audio nodes on how theres a play and stop
No sorry
How do I make a late player sync the current integer in an animator?
You should be able to find your Speed int variable and in the drop down it will have a “sync” checkbox
Oh, or make a int variable in the udon graph on the left, and get/set that int
I am doing that on the right?
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
And if that doesn’t work, you can add one of the OnPlayerJoins event and set that animator to the synced variable
Ahh kk lol. Goodluck!
wait huh
So I made an Int variable, but how can I change that int?
I think I got it
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?
Can a udon behavior toggle items that are not a child of the object that owns the behavior?
if its in UI make sure that the buttons are just in from of the canvas, so they cant be obscured, I had this problem once
yes, using a variable
Ok, can a "SendCustomNetworkEvent" node be activated from an "OnPickup" or "OnDrop" node?
sendcustomnetwork can be activated by anything that has the Action Triangle
I mean have the objects a little bit off the canvas
hm, ok. It doesn't seem to function properly though
hmmmmm
Like this, as you can see the button is a bit on top of the canvas, this was my case, the canvas image blocked the UI buttons
network events don't work on events that start with an underscore. This is for security reasons so you can lock down key functions
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
that is normally the case, but starting with an underscore means something special
ah well oki
the buttons have a trigger box.
also it will break things if you name a custom event exactly the same as something else, so call it like NetworkedOnPickup
oki :3
hmmmm I have no idea then sorry
@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
you should be using OnDeserialization, that is an event that happens when you receive synced data
sending a network event onplayerjoined does not guarantee which one will arrive first
so instead of onplayerjoined I should have a ondeserialization that updates integer as a networkevent?
no network event at all
so on deserializations just update the mode locally?
yeah
also when setting the value, make sure to take ownership first and if it's manual sync, do RequestSerialization after
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
network events are a very basic way to sync that is prone to breaking. You should use synced variables
and what about the ownership and manual sync?
that's what you need to do for synced variables
- Take ownership
- Set variable
- RequestSerialization
I could only find a tutorial for one using networkevent xD
that will make it so everybody has the same variable and they will receive OnDeserialization when they get it
Is takeOwnership needed when only the master controls it?
no it is not
so after setting a variable I only need the requestserial
if it is manual, yes
and when someone joins they trigger a receive serializations
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)
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?
You're doing that inside a network event so this will run for everyone
and only the owner can call requestserialization
only the master is able to run this command anyway
you should separate the logic so that the master is setting the variable, then everyone is applying that variable to the objects
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
so replace the event custom by Ondeserialization
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
I cant click the Event Ondeserialization in the add menu???
do you already have that event somewhere in here?
no?
are you sure?
yes
I don't know what to say other than check again ¯_(ツ)_/¯
scroll all the way out, look at the minimap
I added it but removed it afterwards, does that cause trouble?
I dont get any errors
I reloaded and compiled again but to no succes
I can add other nodes just fine
Hi All! Does anyone know if there is a way to switch scenes on a collision or button trigger?
I tried it in another script and I can add it, remove it and add it, but for some reason I cant add it
you cannot have multiple scenes in a vrchat world whatsoever
Damn 😞
Use teleport instead
Ty phasedragon. Will do
Is there a way to search in the udon graph? because I cant find the OnDeserialization but I cant add it
yeah, space opens the quick search. Tab opens the full search which is laggier but does not require you to go through categories
I mean from nodes I already placed
I cant see the OnDeserialization in my graph but I cant place a new one
idk, try a new graph
so move everything you have to a different graph
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?
the animator is not plugged in
ah yes
also this won't work for the owner because they don't receive OnDeserialization
so behind the Customevent I need to trigger the setinteger aswell right
just have some way of applying the value for the owner, yeah
okay, let me fix it up and test, thanks in advance!
When I activate Swing, the objects start swinging but not for another player that joins later
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?
Make sure the gameobject "Synth" is not empty on the inspector of the script. If you leave it empty it will reference itself (toggling itself off)
Nice I attached it to a cube and it worked, thank you.
is it normal for a pickup item to shake violently when you pick it up?
Udon beginner here. Trying to make a "Guess Who" map and figuring out how to randomize objects in an object pool so that all the "cards" can be randomized on a Udon button press. What I got so far is just random cards spawning everytime I press the button. Not sure about the logical next step, appreciate help and suggestions https://cdn.discordapp.com/attachments/722760686605697064/933447220617936926/udon_randomize_cards_derp.mp4
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
You get a gameobject when you spawn from the pool. You can assign any position and rotation to that using your dummy destinations.
This is my current udon graph. I think I have too much of a knowledge gap to understand how to do that
Appreciate the help!
Yeah, that could be a bit rough then. There are some small details like you have to check if it's the owner of the pool, before you spawn anything.
I wouldn't use a pool for the destination, if you simply want to place those cards there.
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.
I just checked out how the game is played. So it looks like what you want is go through each of the destinations and populate it with a person from the pool of people?
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
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.
Thank you! I dont know if there's some good way to collaborate udon logic easier via a website
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?
I don't think so, it's possible to exchange code though. I'll just use screenshots:
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
That would be part of the destination array.
Honestly, in my example, you could even make an array of ALL people, not just red.
Do you mean Networking.SetOwner?
Thank you for going through so much trouble to help, I'll dig into your example and get back to you
Yeah, feel free to ask if anything is not clear. In my example, I'm assuming you will create an array of empty objects that are only used as positions and rotations for the people.
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
Yeah, it's like a function, but you can just connect an interact node, or a pickup node, or a player entering a collider node, etc., directly.
Ah alright
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.
Yes, I looked into it but I dont understand what I Am supposed to connect to each node
I didn't plan to, can you not move them manually?
I figured making flipping manual, it would add more player randomness and emergent gameplay
What I mean is, we don't know which person card is where in the board, we just put that to that position.
So when you want to flip red card number 5, for example, you wouldn't know which one of the people it is.
Look at the screenshot above for an example. You can also leave out gameobject if you want to setowner of the current udon object.
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.
What do you put in the destination transform variable?
The GameObjects list I mentioned above.
Basically, this will be the start state of your hierarchy:
Ah so you dont use an object pool for the destinations, just the position and rotation parameters from the game object
Yeah, basically. This will happen after populate:
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?
No, it does not. You are right, this needs to be handled. Usually, people just attach VRCObjectSync to each pool object, but I feel like that's not necessary in your case, since the cards won't be move around that much.
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.
Right now it's not doing anything. I'm not good at debugging udon using unity
If it crashed, then the console probably has a message. You could try posting that.
Its not crashing. In your video you are able to run the script directly in Unity, how is this done?
Right now I'm using the Build & test option
Get that, it will save you so much time.
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?
I forgot but will check now
ok!
After running it did populate the game objects
But nothing is showing up
ahh
The parent is disabled, so the child is also disabled
The destinations are pools?
Yeah, pool will disable them automatically. Do they have to be pools?
If I manually enable they were moved
So question is, can the objects be placed without being the child of the destination?
I currently don't see why the destinations have to be in a pool and disabled by default.
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
Ehm, I wrote why, it's the pool. The way a pool works is, you have a bunch of objects that are already defined in memory. Then you can take one out whenever you need it. For example snowballs for a snowball spawner. You have a specific amount of snowballs predefined so they don't have to be created each time you need one.
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.
Ah sorry. Hm, I did read in a previous discussion that pool are required for syncing. I'll try removing it
They are only required for syncing if you want the enabled/disabled state to be synced.
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
Have you tried: #udon-general message
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
Oh, so you must've the VRCObjectSync component on your cards, right? Try shuffling the cards with both players. I'm not sure how the non master will behave.
Yeah, I was fearing that.
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
Yeah, check for the owner (Networking -> IsOwner) right at the beginning, before you do anything.
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
ive reinstalled: the sdk, unity, and made a new map with nothing but a platform. and it still doesnt work
Are your cards pickups?
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.
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
Could it be that Unity doesn't register that the rendering for the object has moved so its being drawn from the initial perspective?
The issue shouldn't be positions, it's scaling.
Show the transform of the pickup parent.
Scaling there can't be weird.
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?
Your issue sounds like some camera is overriding your view.
I was talking about the parent of your pickup. I assume it's DestinationCardsRed.
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.
I have no idea about SDK2. Make sure you do everything that's written in the documentation.
yup
Oh like here, it should be 1,1,1 for x,y,x scale?
Maybe, I still don't know where your pickup is exactly. The parent of that list also should be 1,1,1.
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.
Looks like this fixed it! Awesome thanks
At least in the emulator
welp guess im screwed
Nice, transforms should work in game too.
@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?
So there are duplicates between the two players?
Is that what you are saying?
There are no duplicates for the same player, right?
I think both the red and blue board should be the same if I remember the rules right
Well, if you say that there are no duplicates at all, that's the easiest to do because you can just create a single Destinations array for both blue and red.
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.
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.
Yeah, getting a specific card from the opposition is slightly more tricky. But it's possible with both solutions.
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:
I can do that in code but not in this node system. Thank you, I was searching for old examples
It's a bit ugly, but I'm trying to solve this without many extra steps. This is where using udon sharp is better.
Yeah
Are you aware of UdonSharp? Get it and you can write C# like code for udon.
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.
You always need the machine code to be compile so the scripts actually work.
Many of the OOP concepts aren't even supported though. The old version can't even have custom classes.
any good tutorials on making a video player with multiple URLs? like avideo juke box kinda
Either way, I hope what I posted helps. It's a bit hacky but should do the job. I'll be unavailable for a while.
Ah, last time I wrote C# was in 2005 when about Microsoft Visual Studio came out so I'm very rusty
Thank you so much for all the help I'm learning a lot ! ❤️
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.
How would one change multiple Floats into a Vector2 in Udon
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
Thanks for the help!
@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?
I'm going to attempt to convert this tasty music player script to make a scrumptious video player script...
I have a gun that shoots rigidbody pucks. How do I tell if the pucks collide with something?
Make sure the pucks have a Trigger collider on them, and that their layer is either default or can hit player/playerlocal in the collision matrix. then on that puck you can put a udon graph with OnPlayerTriggerEnter event
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
I have a gun that shoots, but one of the two instances has the ammo freezing in place...
neither, it's a cloned rigidbody
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
And do each gun have their own ammo they take from, or is it a shared pool
it's one gun. The puck on the floor is the one that is duplicated
does the puck have its rigidbody with Is Kinematic checkmarked or unchecked?
no
and what happends when it collides with something, is it suppose to freeze?
"nebula animations" is the one who is developing this, keep the conversation with him
he's typing now
Heyo! Currently the object work on the host client but stutters on the secondary clients. will send video
do you use Object Sync on your rigidbody to handle the syncing of position?
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
and what does the puck look like in the inspector?
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
Setting it up rn.
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
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
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
Ohhhhhhhh ok, i gotta incorporate this into my current setup
If you would be interested in a VC id be down.
That would work
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?
You not conectet the onplayertriggers with the branch
Ah pff that would help, thank you.
Is there a way I can check for the original fog density and set it back to that, instead of using another variable?
No idea inam no expert i only seeyet that you not conectet the branch sorry
Ah okay, thanks.
Np
@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?
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?
Sorry was still in call, unfortunately i havent messed with VideoPlayers yet 😦
you want a event start node to change targetDensity to = defaultDensity when the game begins
Thank you! It's actually yours and Juice's conversation back in November (good ol' keyword search) that I used to make this code in the first place, so I appreciate it! 😄
Ah, neat ^^
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.
Does anyone know where I can get an asset that would allow players to fly ing my vrc world?
are there any lists/tables in Udon?
im having a issue with udon sharp and its aborting the Upload something about udonsharpbuildcompile
People usually mean different things by those words. Udon does have arrays. Generics from C# like List or Dictionary are not supported.
Look at the console, it should tell you what the error is.
Good to know 👍
i just fixed it i just reimported the UdonSharp
Its it easy to add a Animated Image in to the World?
Like a Gif
I heard people do it as sheet animations using shaders.
This maybe random but is there a record for most bottles balanced in vrchat?
no but my personal record is like 7 and a wine glass. also wrong channel
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
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?
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?
add component -> udon behavior to slider
Ah... I added it to the canvas but not the slider as well. Thank you
only slider should need
A script that locks players in xyz axis?
to be activated or deactivated with a button, do you know where I can find it?
can i delay the particle to play?
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.
I believe the particle system has a "Start Delay" setting you can use
ohhh, hmmm, i'll give it a try
Hmm, you are right, that was an oversight. My script just uses the card for the other person and skips it (leaving it empty). You can't really have duplicates like that, unfortunately.
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.
Could it work by having a secondary pool? That might not be as elegant though
You can't really get a specific card in a pool. The whole idea behind a pool is to have generic objects.
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.
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
That was my idea as well. The only unfortunate thing here is networking it to all users.
Ah damn
Are you okay with using UdonSharp?
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
Yeah, I also feel like I'm to deep to quit. But that's okay, I think it's an interesting problem.
Just going to do it in UdonSharp real quick. Will be a lot easier for me.
haha ok thanks again
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
seems like I just had to mess with eulerAngles instead
This works in testing, I made it a bit different from before.
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:
Awesome, will take some time for me to digest. Does that not network desync though?
When do you think it will desync?
Oh yeah, and to make sure: You have to remove the VRC Pool component otherwise the script won't work.
Ok, use this one please. Just a small thing got changed (last version should also work, just will spawn some cards at the beginning).
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.
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?
Check if object exists and is not to be destroyed If ( gameObject != null && gameObject.name != “ToDestroy” ) Check if gameObject exists and that the name is not equal to ToDestroy Keep in mind that == / != checks are slow Graph CodeAMVVyWrbQBh+FTNnjZlNoxlDLlkooZAUslyKEbO6ahUp1dLWuH6yHvpIfYWO7NhpLDvokKQIBP+v0Wi+7defX78X4JvKWwcmHxfAt3l+o...
Oh yeah, you can create a separate udon graph for interact.
Just create a UdonBehavior and call SendCustomEvent after interact on that udon.
I did it like this:
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?
you can have multiple udonbehaviours on the same object, you just can't mix continuous and manual
I put it on a different object. And yeah, it's referring to the Synchronization Method field.
if one of those behaviours does not have any synced variables then it doesn't matter what sync method it's set to
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
Method name is just a a string of the method name. So _Populate or _Reset in this case.
You drag the script into the udon variable.
Oh you have to drag from the script property in the inspector from the GameObject, not the script in the heirarchy editor
Yes, the hierarchy. You can just drag the gameobject that udon script is on and it should work.
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
Hey, I appreciate it. I am a bit afraid that the script I wrote isn't the best for learning though, if that was your goal. I just saw how your world is almost finished, with 3D models and all, and wanted to help.
Even though I can't follow along all the code I think I have a good idea how to get started and learned how to declare variables and connect Unity components together. I really do appreciate it! It was an idea from Zzyzzx of the Gator Crew to make a Guess Who of all its members and now there is one, its not the prettiest but it works!
Well, glad it fullfills that purpose then.
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.
how would you make a spectator UI like in jar's worlds?
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
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...
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.
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
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
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
could it be that the id for each pedestal stays the same when you copy paste them, and that causes conflicts?
i've changed all their ID's and nothing
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
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
Did you try unpacking the prefabs after placing them into the scene?
Yep, they still break if I modify them
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
this is normal for performance reasons, this is also a world scripting channel
Oh
Issues seems to come from turning them off in the game? I have the pedestals & the platform they're on disabled by a button, if I put a pedastal out there & leave it enabled, and put the exact same one on the switch, it breaks.
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?
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
does anyone has examples to toggle seperate objects at FX layers on VRC avartars?
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)
there is toggle graph inside the vrchat-examples folder
is it possible to call a variable from another udon script? If so how?
i know that but i dont know where to place things or what to replace or how to connect it all via a button, i have no idea, ive been on youtube but the things they search i dont have so im not sure if they outdated or whatever
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
okay done all that and it doesnt work 😦
send ss of inspector of cube and whole unity window
can i share my screen?
no
thanks :/
how crap is nav pathfinding performance? Does udon create any overhead?
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
Hi, trying to make an audio stop when toggled again this is the script so far, what do I add?
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?
omg thank you so much
if its a pickup, try turning off gravity, if you have occlussion culling, try rebaking with smaller settings, if its a pickup with occlusion, i would unstatic it if its static
Have you had this answered yet?
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
I don’t know where to find the playing and set playing nodes? I’m very new udon sorry :(
you have to make a variable on the left of type bool
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
Thank you your a life saver!
Is there any documentation on creating worlds/games using script instead of the graphs?
Look up UdonSharp, it’s a C# style scripting that uses Udon behaviors. It’s a separate download but it’s highly recommended
U#
Yeah, you can find some useful information in the wiki there too.
Nice
But honestly, most of scripting is about knowing the Unity API too.
thanks, but i did managed to do without using the int,(but this will help)
You won't find a specific step by step tutorial like that. Your best bet is to learn the Unity API, what's possible, probably check out other packages, take some of their ideas, and then implement your own thing.
True, I have some experience with unity (more personal projects) so hope I'll be fine.
The performance should be fine for the most part. As long as you don't want to do pathfinding each frame for lots of units. This is only from what I've seen though, I haven't done intensive stuff with it myself.
Yeah, if you already have experience, then the biggest challenge is learning some VRC specific stuff. The worst thing is that you need to put Triggers on the MirrorReflection layer because it will block the in game lazer otherwise.
Hard to figure out some stuff, so just ask people or search the discord.
Will do, cheers.
hmm well im not sure how unity pathfinding works but if the target is moving itd have to continiously recalc no?
Pickups work. It's whenever I script a button for some reason.
Hmm, no idea about specifics actually, it's been a while. But I do think it's fine for most use cases even if you calculate the path each frame.
Seems like you only calculate it once with this, for example: https://docs.unity3d.com/ScriptReference/AI.NavMeshAgent.SetDestination.html
is there any missing varibles/references in the behaviour?
It compiles correctly.
Console is clear
It quite literally deletes the object.
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?
That's what they meant, you don't have a reference to the mirror.
It shows this
So of course it disappears.
Yeah, it will transfer by itself.
Nice
Hmm, are lists not supported by udonsharp?
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)
They are not supported by Udon itself. UdonSharp can only implement things that Udon allows for. Lists (or more generally Generics) are not part of that.
so how would i do this? Im asking because im trying to make a game world
Different ways. If you already have an AudioSource, you can enable/disable it with PlayOnAwake turned on.
You can enable/disable it using animations or udon scripts.
You could also call AudioSource -> Play in an udon script instead.
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.
nice
Not as optimized, but sometimes get the job done.
thanks
ok sorry for asking too many questions, how do i make game options, and a start game button
When a player enters a trigger, how you you know it was the player?
whats wrong?
You'd use a regular canvas and put it in world space position, so people with headsets can see it.
The details depend entirely on your game.
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.
thanks
thankyouu, by default it was that hence why i didnt know what was wrong
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?
I haven't heard of that issue, can you take a picture?
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
oh, can you go to the console and take a look at that error? Something looks broken
are you using udonsharp?
No, yet they're sharp errors
did you intentionally import udonsharp yourself or did it come included in some other package?
ah, whoever made that package that included it should not have done that. It will definitely break things
You should try closing unity, deleting udonsharp from the project, then reopening unity. If you want to use scripts that require udonsharp, you can install it from here https://github.com/MerlinVR/UdonSharp/releases
How do I remove Udonsharp from the project? Is it in a folder in the project?
yes it is
Okay thankyou
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?
What do you have so far?
these 2:
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
@flint urchin is there anything that needs changing?
OnEnable requires the object to have been enabled once first.
hmmmmm
Idk what this single object does, but you could remove it all together and use PlayOneShot in the one that triggers this behaviour
one sec
on the keypad switch, most were normally toggles as i switched out from interact to OnEnable
like this?
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
oooh, i see, one sec
so when i set that to start, when the object turns on, it plays right away?
It should yeah
ok, i'll test it
(Don't need to use PlayOneShot then, so you can revert back to the other one)
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?
yeah
ok, gotcha
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 ^^
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?
If the audio clip is short, then yeah it will cut out quickly ^^
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?
is there a basic combat system for Udon?
Is there a built in way to handle sorting arrays? Array.Sort doesn't seem to be available unless I'm mistaken
how do i make it so when i pick a item up it plays a sound
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
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
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
i want it so when the bullet hits a box the box exposes
and the box is existing in the scene
with another graph with a Custom Event named for instance DecreaseHealth
there is some udon# my friend wrote for the bullet tho
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
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
the variable on the left named OtherBehaviour, when you drag it into the graph, holding ctrl and dropping will set
instead of use