#udon-general

59 messages · Page 81 of 1

fading prism
#

Well i've been uploading this stuff before, it just sometimes to add scripts to something it says it's needed. I'll keep it in mind

wind atlas
#

I found the solution on the udonsharp discord: The script used PropertyToID, which changes when in game.

dreamy gorge
#

Anyone know how to reference Udon programs from U# programs? I would like to access variables from a udon script

grand temple
#

The thing you're trying to do is only available for U# behaviours, so for anything that's not udonsharp you have to do it the regular udon way which is public UdonBehaviour movie_data and then movie_data.GetProgramVariable("movie");

dreamy gorge
#

That's what i needed, thank you :D

#

One issue though,

#

I am using the udon namespace.

#

Although IDK if this is messing with it

grand temple
dreamy gorge
#
The type or namespace name 'UdonBehaviour' could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp]csharp(CS0246)
#

Ill send more context, maybe it'll be easier to tell why

#define USE_SERVER_TIME_MS // Uses GetServerTimeMilliseconds instead of the server datetime which in theory is less reliable

using JetBrains.Annotations;
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Components.Video;
using VRC.SDKBase;

namespace UdonSharp.Video
{
    [AddComponentMenu("Udon Sharp/Video/USharp Video Player")]
    [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
    public class USharpVideoPlayer : UdonSharpBehaviour
    {
        // Video player references


        public UdonBehaviour movie_data;
// continued...
grand temple
#

you need using VRC.Udon;

dreamy gorge
#

AH

#

thanks

grand temple
#

it should automatically add that if you type it in yourself, instead of pasting it

dreamy gorge
#

thank you

peak thicket
#

can someone send me a video on how to make a button that plays audio files

dreamy gorge
#

?

#

it was 9 months ago, idk if udon updated too much since

peak thicket
#

ok i just need help with the graph stuff for toggling music

#

thanks

dreamy gorge
#
        public void movie_selector(){

            GameObject dataHolder = (GameObject) movie_data.GetProgramVariable("target");
            UdonBehaviour data_ = dataHolder.GetComponent<UdonBehaviour>(); // System.Exception: Method VRCUdonCommonInterfacesIUdonEventReceiver.__GetComponent__T is not exposed in Udon
            // How can I get the UdonBehaviour from the GameObject?

            VRCUrl url = (VRCUrl) data_.GetProgramVariable("url");
            PlayVideo(url);
        }

Hello again. I have an issue with my method. Is there anyway to get the udon componenet from a GameObject with U#?

grand temple
#

you can't use the generic getcomponent with <brackets> you need to use this version (UdonBehaviour)obj.GetComponent(typeof(UdonBehaviour));

dreamy gorge
#

oh sorry didnt mean to block ur message

#

that did work tho

dreamy gorge
#

How come my variables don't get added to the inspector when I change the source code of a script?

#

When I look at the UdonSharp object thing, i can see the new variables. but not when i add the script to a gameobject

grand temple
#

That's because this particular script is using a custom inspector in order to have fancier custom-made elements. You'd have to add your variables to that too. It's USharpVideoInspector

dreamy gorge
#

Oh my god you are very helpful !

#

Fixed it

brazen epoch
#

Is OnPickupUseUp sent to all clients?

fiery yoke
brazen epoch
#

I suppose it's also not safe to send a custom network event inside that scope since the logic isn't running

grand temple
#

huh? totally safe

#

what do you mean by "logic isn't running"?

brazen epoch
#

The logic in Shoot isn't running on Master or clients

public override void OnPickupUseUp()
    {
        SendCustomNetworkEvent(VRC.Udon.Common.Interfaces.NetworkEventTarget.All, nameof(Shoot));
    }

public void Shoot()
{
    if (reloading) return;
    reloading = true;
    audiosrc.PlayOneShot(shoot);
    KillBox.SetActive(true);
    SendCustomEventDelayedSeconds(nameof(Reload), 0.5F);
}
grand temple
#

it is if you sendcustomnetworkevent

brazen epoch
#

Not in my case. The variable reloading is default false and is reset to false after 1 second, but none of the events are triggering. The in game debug log also isn't showing anything. I also have visualizations on the KillBox and it never showed up. I can reload to try again and look more closely, but idk

grand temple
#

is this object instantiated?

brazen epoch
#

Yes. Both the clients and the Master can see the Pickup in the Owner's hands

grand temple
#

instantiated objects cannot be synced

brazen epoch
#

They're not instantiated through VRC_ObjectPool. They're awake on Start

grand temple
#

objectpool is not instantiation, that's not what I mean

#

what I mean is, are you using the Instantiate or VRCInstantiate functions to create any of these objects?

brazen epoch
#

Oh sorry no. I am not instantiating it any way since they're prefabs that are awake on Start

#

Reloaded just to confirm and nothing happens

grand temple
#

Do you get [Behaviour] <object> executing Shoot at the behest of <player> in your log?

brazen epoch
#

No

grand temple
#

did the udonbehaviour crash from something else?

brazen epoch
#

Not that I can see. Both logs from in game and U# are not throwing any exceptions

grand temple
#

this udonbehaviour is on the same object as the pickup, right? Not like on a child or something?

brazen epoch
#

Correct

#

Commenting out a GetComponent(typeof(VRC_Pickup)) to test to see if that's crashing the script

grand temple
#

I can't think of anything else off the top of my head but if you share some screenshots of more of the script and the inspector maybe I'll see something

brazen epoch
#

Sure one moment

#

In game client logs
https://cdn.discordapp.com/attachments/405285983794364417/928102768252710982/unknown.png

Gun script

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;

public class Gun : UdonSharpBehaviour
{
    [SerializeField] GameObject KillBox;
    [SerializeField] AudioClip shoot;
    [SerializeField] AudioClip reload;
    private AudioSource audiosrc;
    private VRC_Pickup pickup;
    private bool reloading = false;

    public void Start()
    {
        audiosrc = this.GetComponent<AudioSource>();
        // pickup = (VRC_Pickup)this.GetComponent(typeof(VRC_Pickup));
    }

    public override void OnPickupUseUp()
    {
        SendCustomNetworkEvent(VRC.Udon.Common.Interfaces.NetworkEventTarget.All, nameof(Shoot));
    }

    public void Shoot()
    {
        if (reloading) return;
        reloading = true;
        audiosrc.PlayOneShot(shoot);
        KillBox.SetActive(true);
        SendCustomEventDelayedSeconds(nameof(Reload), 0.5F);
    }

    public void Reload()
    {
        KillBox.SetActive(false);
        audiosrc.PlayOneShot(reload);
        SendCustomEventDelayedSeconds(nameof(ResetReloading), 2.7F);
    }

    public void ResetReloading()
    {
        reloading = false;
    }

    public void Drop()
    {
        pickup.Drop();
    }
}
grand temple
#

and the inspector?

brazen epoch
#

The Unity console?

grand temple
#

the window where you add components

brazen epoch
grand temple
#

oh, you have synchronization method set to none

#

that disables syncing

#

including network events

brazen epoch
#

Oh wow. I did not know that. That might explain a lot of the bugs I've been experiencing.

#

Would manual suffice?

grand temple
#

you should have continuous because there is also an objectsync on this

brazen epoch
#

Okay. Thanks for the info. Guess I'll see if that fixes it

grand temple
#

objectsync is only compatible with continuous

brazen epoch
#

Seems like that works now. Thank you

dreamy gorge
#

How would you pass arguments through this?

#

oh i am too stoned for this nvm

#

wait nvm that

#

i have a question

grand temple
#

the way I like to do it is to have a text component hidden somewhere. The button sets the text then sends the event to the udonbehaviour. The udonbehaviour then reads the text as the argument

dreamy gorge
#

hey phasedragon

#

say I have this method

grand temple
#

no

dreamy gorge
#

is there a good way to do this

dreamy gorge
#

but that wont work for any other objects other than strings

#

right?

grand temple
#

correct

dreamy gorge
#

so i couldnt pass a VRCUrl object through events

grand temple
#

you can use the string to identify what object you want, like as an index of an array

dreamy gorge
#

my mind is blown

mossy crane
#

Hey, me again...internet was down all day so couldn't test anything 😦 currently routed through a VPN but just curious on this manual sync object as to why my custom OnEvent is triggered and the instantiate works for the person holding the gun, but the OnDeserialize custom event is not firing for everyone else

#

Phasedragon listed the 3 typical steps for syncing but I lost them in the chat history...

grand temple
#

do you have any synced variables? I don't think sync does anything if you don't

mossy crane
#

Hmmm.. how would i sync these? since theres no event I can fire to everyone to start collecting these variables

#

or should it just be on the pickup as continuous?

grand temple
#

create new vector3 and quaternion variables on the left. set them to synced. after taking ownership, take all the info you need to instantiate, move into position, etc and put that in the synced variables. then when you instantiate, use those variables instead of pulling from transform psotion and stuff

#

not on the continuous object, on the manual

mossy crane
#

How do i put my Transform Get Position of gun and store it into GunPos in Udons case?

grand temple
#

as a vector3

mossy crane
#

doesnt connect is there a middle node i need?

grand temple
#

set variables by holding shift while dragging them into the graph

mossy crane
#

aha lol

#

tytyty

grand temple
#

put tbat after the setowner before requestserialization

mossy crane
#

Set pos > Set Rot > Set Velocity > serialize > instantiate event. then when spawning use the sync'd variables as reference?

#

and is sendchange important

grand temple
#

sendchange is used for when you want to detect a variable's change, you would need an ovariablechanged for that

mossy crane
#

Whats the difference in these parameters

grand temple
#

that interpolates a value over time rather than changing it immediately. you don't want that here

#

it doesn't work in manual anyway

mossy crane
#

Ah, just eases some networking instead of like every frame

#

Works!!!!!

#

Looks much cleaner and learned lots, thank you!!

grand temple
#

woo

mossy crane
#

Velocity doesnt seem to wanna work

#

pos and rot does

#

this is gun parent, is it able to send velocity with these paramaters while held?

grand temple
#

idk if pickup applies velocity

mossy crane
#

Whats a decent work around?

#

Player speed?

grand temple
#

I would calculate velocity by comparing position changes from one fixedupdate to the next

#

but player velocity would be a much easier alternative

mossy crane
#

Hmm what math node would i use in 2 FixedUpdates of gun position to calc the change in velocity?

high mural
#

why does VRCInstantiate work in Unity but not when I upload to VRC? i'm using udonsharp

mossy crane
#

How to control a loop of Fixedupdate to get 2 unique values of gun pos

#

Nvm lol

blissful shore
#

not a question but just something so funny... I was about to go out and get Ramen... with out thinking I asked everyone in they wanted any ramen... then it dawned on me that I cant hand people food in VRCHAT. I hope every one has the best day!

dreamy gorge
#

Pls help!!
I get this error when i make udon scripts

NullReferenceException: SerializedObject of SerializedProperty has been Disposed.**
#

oops nvm found issue

mossy crane
#

the subtraction goes into the Set Velocity of the instantiated object, definitely doing something wrong

#

Gets pretty close to the desired effect so ill run with that

#

Can Udon use tags for collision?

thorny silo
#

how would i write an udon script to assign info to a submenu via buttons

elder peak
blissful shore
#

I made a few teleporters all but one are working perfectly. it just shoots me off into space then I respawn. Can anyone tell me how to fix this?

scarlet lake
#

Would anyone know how to make a Key Object that's opens(animates the door from a trigger collider) a specific Door, because I'm at a complete lost from using Udon#

blissful shore
#

ohh I just saw a vidoe on that

scarlet lake
#

Can you please show me? ;-;

blissful shore
#

looking for it right now

scarlet lake
#

Thank you so much for helping me out, but sadly that's not what I'm looking for

blissful shore
#

ohhh from a trigger collider

scarlet lake
#

Yeah, you know those Hotel Keycards that you put near the door handle to open it?

blissful shore
#

I wish I knew how to do that

#

thats awesome !

scarlet lake
#

I know that's why I'm trying to look for how to do that

blissful shore
#

im sure some one on here will tell you

#

im having a weird teleporter glitch. All but one of my teleporters work perfectly . one of them just shoots you into space.

scarlet lake
#

That's sounds strange...is it clipping with anything or just shooting people like rockets?

blissful shore
#

It makes you fly backwards and then drops down

scarlet lake
#

That's very odd

blissful shore
#

im going to try to just recreate the building and see if that fixes it

scarlet lake
#

I hope everything works out in the end

blissful shore
#

uploading it now

#

brb VRCHAT

weak zephyr
#

how can i get hand velocity in udon?

#

if not

#

is there a delta math node?

blissful shore
#

Thanks , now there is more weird stuff... on of my animations dissappeared. it worked perfectly on the last upload and now its gone???

#

im going to restart my comp

mighty fjord
weak zephyr
fiery yoke
#

v = s / t

t = Mathf.deltaTime
s = (currentPosition - lastPosition).magnitude

midnight kelp
#

is it possible to make an object move randomly throughout the world with udon or UdonSharp?

cold raft
#

yes

obsidian pebble
#

But how? How can i make it that an object follows a Path on my World? I tryed to use the PathCreator from the Assetstore but when i try to test the world nothing happens - the Object just lays on the floor. I think the script isn´t working with Udon (?)

cold raft
#

yeah most things you get on asset store wont work, as udon only allows very specific things

#

there are two ways to do this, one would be to update the objects postition every x seconds of frames with udon. those can be random positions if you want incase of kezzers question

but if you want actual pathing, like moving npc's or such you might want to look into navmesh
https://www.youtube.com/watch?v=xVXXS7HX7Og&t=568s

obsidian pebble
tight glade
#

I'm just starting out so I have some big-picture question about development set up. I'm familiar with Blueprints in Unreal -- is Udon similar? Is it integrated into Unity? I'd REALLY like to avoid developing in Windows as this is what pushed me out of VR development years ago (can't stand the windows UX). Love using Blender on my M1 Mac, and I can fast-transfer files between it an my windows PC. I also like Linux, but it runs on the same PC as my Windows install, so switching involves a reboot. I'm guessing Udon/Unity development on the Mac is a no-go, what about on Linux?

obsidian pebble
shell tangle
#

how do I teleport a player from one room to another?

cunning basin
tight glade
#

@cunning basin ooh, this is making me hopeful 🙂 I'm going to look into cyanemu and .. that emulator, thanks! I'm fine moving content over to windows for testing as long as it's not stuff that needs constant testing during the development and creation process. In other words, if I can spend hours on my Mac (or LInux), and only need to occasionally pop over to Windows to test, that's totally tolerable.

cunning basin
cold raft
obsidian pebble
#

oh its already in udon i see

weak zephyr
#

i kno how to get the positions but how whould i do the timing to get it

#

this what is what i got so far

#

doesnt seem to work

#

when i send a log

jaunty dagger
#

I'm not too deep in the subject, but I would suggest to store the position each frame and override it the next frame. Then, when you need the last position, you access the variable where you stored it last frame before overriding it this frame.

#

I got a general question about the physics in VRChat:
I am working on a world where players can play soccer but after testing the physics for a bit and tweaking it here and there, seems I can't get proper synced collisions running. The ball bounces for the owner, but all other players see is an oscillating wave like movement, rather than real collisions.
Is this an issue that can be reduced by any means or is the problem inherent to how the networking works and the ping of people on different locations of the planet?

#

Another Program I came across are world space menus. I am using a PC in VRChat. My cursor seems to properly recognize the UI (I change the layer to default, as UI is not interactable) but buttons wont react to clicks or mouseOver. Is there anything I forgot?

obsidian pebble
#

ok got a new problem xD anyone know how to fix that..? I cannot upload my world anymore...

jaunty dagger
#

Looks like a temp file is missing.

obsidian pebble
#

but how...??

jaunty dagger
#

Save the project, close the editor, maybe even just do a quick PC reboot.

#

That solved similar problems for me with other unity game projects I worked on.

jaunty dagger
#

Your PC will be much faster in compiling and testing, than my brain in understanding the map haha

#

I never worked with currentFrame. What does it do?

weak zephyr
#

its just a variable

jaunty dagger
#

Ah, koay

weak zephyr
#

i think it works

#

let me check

jaunty dagger
#

I would call it different

jaunty dagger
#

currentFramePos

#

and lastFramePos, so it's more clear

#

Yeah, I thikn it cannot work

#

The bottom part: Bool and UnaryNegation.

#

It does nothing

weak zephyr
#

cleared a bit

jaunty dagger
#

Ok, lemme have a look.

Just let me know in a few sentences, what exactly the script is supposed to do and on which gameObject it is attached

weak zephyr
#

track hand velocity

#

or any other velocity

#

with positions

jaunty dagger
#

Ok, I understand

#

It's attached to the gameObject with Rigidbody that is Pickup?

weak zephyr
#

any way to apply impulses?

#

heres the second part

#

that gets the velocity

#

n stoff

jaunty dagger
#

You maybe need to send the changes?

#

like check the boxes at "Send change"

weak zephyr
#

why tho?

#

i got what i need thanks

jaunty dagger
#

Not sure, but the variable needs to be synced with the server, no?

weak zephyr
jaunty dagger
#

Ah okay

#

So it works now?

weak zephyr
#

every player is gonna have their hand velocity tracked

jaunty dagger
#

Okay, I understand

weak zephyr
#

and it seems accurate

jaunty dagger
#

The second map looks okay though. Should work like it is

#

Not sure why the first one doesn't.

weak zephyr
#

i hav a problem now

jaunty dagger
#

Me too

weak zephyr
#

oh

jaunty dagger
#

Do I set the owner in the transform

#

or in the game Object?

#

I mean in general

weak zephyr
#

im pretty new to udon im not sure

#

owner of what?

jaunty dagger
#

I see that SetOwner from Network class has obj input, but I dont know what is the input, transform and gameObject, both seem to work

#

The gameObject owner. The object is physical, has rigidbody and VRCObjectSync

#

Documentation for Udon is quite sparse :/

elder peak
jaunty dagger
#

Thank you, I realized how silly the question was like a minute after solving it by just testing.

#

But I got a more pressing question, if you don't mind?

#

It's related to the physic synchronisation

jaunty dagger
#

And a second question:
For the soccer world, I would need every player to get a third person camera over their shoulder, once they sit on the Robots. I managed this by activating a secondary camera with higher depth, which overrides the original camera.
Problem is, that any player in the world now sees through this camera rather than only the local player that drives the robot.

#

What approach would you take in giving each player an individual third person camera?

#

And is there a function to eject a player from a vehicle/seat that has disabled exit? Can unity distinguish players using VR controllers vs. players using Keyboard and asign a button/key to do so? What would be the Input names of VR controllers?
Also I can't get World Space UI and Menus working properly. My cursor in the center of the screen turns into a mouse cursor when looking at the menu, but I can't interact with buttons. I set the layer from UI to Default, so that should not be the problem. Did the same for all children of the Canvas. Any idea what might cause the problem?

wind atlas
jaunty dagger
#

Hm, let me check that and thank you for the hint!

#

This is the camera script. No syncing to other player I guess. But the camera IS a child of a VRChair, and that one is part of an vehicle object that actually gets synced with other players via VRCObjectSync

#

As I understand it, the camera with highest depth, is being used above all other cameras. As the camera is part of the world, I believe every player sees through the camera with the highest depth, no?

wind atlas
jaunty dagger
#

As a grandchild, yes. I'll send you a hierarchy screen, one second

wind atlas
#

Do you enabled/disable the cam?

jaunty dagger
#

BluePlayer1 is the Vehicle. It has a VRCObjectSync attached to it as well as movement script which gets enabled upon entering the VRCChair and disabled upon exiting the VRCChair.
All the other GOs are just bits and pieces of the robot that shatter, when the vehicle is destroyed.

#

The VRCChair3 is the actual chair the player enters the vehicle with. Upon entering, the movement script gets enabled and Camera with higher depth gets enabled.
This will cause every player to have this camera as their view

wind atlas
#

Afaik OnStationEnter - or whatever it was called - will be called on every client.

#

That might be it.

jaunty dagger
#

Oh damn, that reall might be the reason if its called on every player

wind atlas
#

Yeah, try checking if the local player set down.

#

See if that work.

jaunty dagger
#

I was wondering, how can I get the occupying player?

#

Is there a getter method in VRCPlayerApi or Networking?

wind atlas
#

I have to check, but it must be somewhere in the VRCStation or VRCPlayerApi.

jaunty dagger
#

Okay, thank you very much! I will give that approach a try.

Btw, do you know if Physics can be prioritized on certain objects?

#

Aaaah! There the player is!

#

thank you!

wind atlas
#

I thought you already used that method since we were talking about how it might be the issue.

jaunty dagger
#

Yep, I used it, but actually didn't realize that it hands me the occupying player on a silver platter

#

facepalm

wind atlas
#

Not sure what you mean by prioritize, rigidbodies have different modes to increase accuracy.

jaunty dagger
#

yeah, I use the VRCObjectSync for the Ball in my soccer world

#

Problem is, that only the owner is seeing it really bounce off walls. Other players rather see an oscillating motion with significant delay.

#

So I was wondering if at the current state with ping and physics handling in Unity, it is even possible to have a World revolving around physics, accuracy and speed, as all three of these factors experience botlenecks

wind atlas
#

Good question, I'm curious about that too. I think I've seen people do their own sync for stuff like that. Not sure if there are easier ways to increase accuracy in that regard.

wind atlas
#

I don't remember if I visited this world, but I think it's similar idea. You could try asking the owner if it is.

wind atlas
weak zephyr
#

what the opesite of the constructor in vector3?

jaunty dagger
#

Yep, got the UIShape object on the canvas. Does every button and panel need it as well?

wind atlas
jaunty dagger
#

Yup, but what should I do for the VR controllers?

#

Okay, weird. Because I added the UI Shape to the canvas but it wont react on clicks, only on mouse position.

wind atlas
jaunty dagger
#

About the Soccer Map. The video only shows a single client in the world. I highly doubt that the ball movements and collisions will be as accurate for other people from around the globe. At least that's the issue I am experiencing here

#

There is a collider around it, Does it have to be a trigger?

wind atlas
jaunty dagger
#

Its the Default layer

#

because in some tutorial somebody said it has to be anythign but not the UI layer and then went on giving the default layer as an example.

wind atlas
jaunty dagger
#

the collider is on my canvas gameObject

#

Ah you are right!

#

I placed it over a monitor screen which also has a collider I forgot about

#

Maybe that one is blocking it

#

Thank you for your help puppet!

wind atlas
#

I'm glad that it worked.

jaunty dagger
#

Still testing out, but you gave me at least an edge to work on. I was at the end of options 🙂

golden kayak
#

can anyone make this in vrchat im sure if u look at instructions on the paper u will make it
it needs dice

jaunty dagger
wind atlas
#

In your case, you probably want to create an extra game object for the collider.

jaunty dagger
#

Okay, I understand. So theoretically I dont really need to use a collider, if I don't mind players walking into the UI element?

#

Do the buttons also need a UI Shape componemt or only the canvas gO?

dapper lion
#

canvas

wind atlas
dapper lion
#

well - the main parent

jaunty dagger
#

Weurd, when I attach the VRC Ui Shape, it doesn't add any colliders (in the case there are no other colliders on the gO i mean)

dapper lion
#

you might have the z scale on your canvas at 0 (or x)

jaunty dagger
wind atlas
#

Just tested it with my own and yeah, it does create the collider at runtime.

#

If you use windows, use Ctrl+Shift+S please.

unborn hornet
#

VRCUiShape add a collider at runtime yes. Set the Z scale to 0 on that canvas object to avoid VR weirdness.

Alternatively, add a BoxCollider manually and adjust it yourself.

jaunty dagger
#

Ah sorry, I cant use discord on the PC eight now. Despite being longer than 10 mins in discord, I seem to have a bug here where it doesnt allow me to post from my computer for the next 4 hours -_-

dapper lion
#

slim

unborn hornet
#

No?

#

I mean, I use a custom script to guarentee that the collider behaves anyways.

dapper lion
#

hmm ok, id still just do the istrigger box collider to garentee it to not be too wonky

jaunty dagger
#

Hm, when setting z of the RectTrabsform to 0, button text disappears

dapper lion
#

ye. youre using rotations so id keep it at 1

jaunty dagger
#

Ok

dapper lion
#

um, wait, is it still not working tho?

jaunty dagger
#

Let me compile n check for a second.

dapper lion
#

k

wind atlas
#

What kind of VR weirdness are we talking about? Does the normal Ui Shape not work correctly?

unborn hornet
# unborn hornet I mean, I use a custom script to guarentee that the collider behaves anyways.
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;

namespace MyNamespace
{
    [UdonBehaviourSyncMode(BehaviourSyncMode.None)]
    public class UiShapeFixes : UdonSharpBehaviour
    {
        void Start()
        {
            var canvases = GetComponentsInChildren(typeof(VRC_UiShape), true);
            foreach (Component c in canvases)
            {
                var box = c.GetComponent<BoxCollider>();
                if (box != null)
                {
                    var rect = (RectTransform)c.transform;
                    box.isTrigger = true;
                    box.size = new Vector3(rect.sizeDelta.x, rect.sizeDelta.y, 0);
                }
            }
        }
    }
}

Feel free to use this code or remake it graph if you want.

jaunty dagger
#

Thank you!

unborn hornet
jaunty dagger
#

Ok, so my pointer definitely turns into a mouse cursor, but the buttons still dont react to it.
I will check if the onClick event might just not work properly but even then I would expect the button to change color on mouseOver.

unborn hornet
#

It more so feel unintuitive due to certain expectations of Unity UI. Ergo why I flatten the colliders with that script.

jaunty dagger
#

Makes sense. I was thinking of using a 2D box collider but the lack of a third dimension makes it impossible to properly adjust in space

#

Okay, so to sum it up:

  • I need a GO with Canvas, collider and VRCUiShape script.
  • The GO with Canvas, collider and script needs to have a different layer than UI

That's all that is needed for it to work?

unborn hornet
#

Yes.

#

Specifically BoxCollider.

jaunty dagger
#

Okay.
Then the error must be somewhere else in my setup I guess.

wind atlas
jaunty dagger
#

I'll try n debug a bit, then will be back in case I can't find the issue

#

Thank you ArchiTechAnon and Puppet for your time and help!

unborn hornet
wind atlas
unborn hornet
#

technically distance doesn't matter, but proximity makes the jank more apparent.

wind atlas
#

Yeah, that's what I was assuming, so maybe I know what you mean, but I'll definitely check it out.

unborn hornet
#

For example, looking down at the canvas from above, and pointing at the canvas from the side.

jaunty dagger
#

I think I know what jank u mean. When u have a big cube as collider, your mouse cursor on the canvas will extrude out closer to the camera when crossing the canvas, following the actual shape of the collider.

unborn hornet
#

Pretty much yup

jaunty dagger
#

But that means that the layer of the object is no issue, as the pointer is recognized and turned into a mouse cursor, right?

unborn hornet
#

The layer does matter

#

Somewhat

jaunty dagger
#

Yep I mean in my case

unborn hornet
#

the UI layer is ignored until the VRC menu is open.

jaunty dagger
#

It seems to work, I get a mouse cursor when looking at the canvas

wind atlas
#

I feel like I was misunderstand what you wanted earlier.
For a canvas that player can't go through, all you need is a default layer canvas with a UiShape. That should already work for a regular canvas.

jaunty dagger
#

But interaction wont work

wind atlas
#

It should work though. Did you manage to make it work with the things you were trying earlier?

jaunty dagger
#

Wait, does Udon support TextMesh buttons? Maybe thats the problem here

wind atlas
#

It does support them, as I said, there might be something else interfering with it. Like a huge trigger zone around the canvas.

unborn hornet
#

for TextMeshPro? It should yes.

jaunty dagger
#

I get the cursir but cant click the buttons

unborn hornet
#

What's the component look like in the editor?

jaunty dagger
#

I think I found my idiocy. The buttons were children of the panel element.

#

When dragging them under the panel, by accident I made them the children of the panel

#

Ok didn't work after changing the order. This is how the canvas looks right now:

dapper lion
#

what does the inspectpr of the panel and a button look like?

jaunty dagger
#

All highlighted elements are on Default layer

fierce verge
#

how do I make a delay between 2 actions?

jaunty dagger
#

Button

fierce verge
jaunty dagger
#

Time.deltaTime

dapper lion
#

so its turning another button off?

fierce verge
wind atlas
dapper lion
wind atlas
jaunty dagger
#

Yup, the canvas got one, only the rest doesnt

fierce verge
wind atlas
jaunty dagger
fierce verge
wind atlas
fierce verge
#

buttt

wind atlas
fierce verge
wind atlas
fierce verge
#

Ive been looking at it for like one minute

jaunty dagger
fierce verge
#

for some reason the delayedevent doesnt do anything

#

it turns on

#

but not off

night viper
#

Did you compile the script before testing? Also make sure there is no space after the "Smoke_OFF " The newest SDK will give you a dropdown instead so you dont make that mistake by accident.

fierce verge
#

I think that was it

#

the compiling

#

buttt

#

I turned of the smoke but that looks kinda silly as particle

#

can I just like stop emitting particles so the remaining ones just diffuse so to speak?

night viper
#

Oh, if it is a particle you can use "emit" instead.

fierce verge
#

I see

#

how do I make it so if I press a button it just shoots aprticles for 5 sec and then stops hmmmmm

night viper
#

But if it is timed, you can stop the particle too. I dont remember the name of that. I believe it is "play" to play the particle, and "stop" to stop the emissions. I dont have access to pc right now so i cant check.

fierce verge
#

I have a flamthrower that shoots a few particles only once

#

but I cant seem to find what setting xD

#

nvm I had looping on in the particle editor

wind atlas
fierce verge
#

that should fix it

#

yeah

#

and then I need the delay in udon

#

just a toggle

#

how do I go from the gameobject to the particlesystem?

#

nvm

#

dumb question I just had to use a particlesystem input

jaunty dagger
obsidian pebble
#

anyone have an idea why that happens all the time...?

#

everytime i try to upload my world the file is missing

granite basalt
#

Annyone knows why disabled instanciated gameobjects have an overhead in vrc. (thay dont in the editor)

elder peak
elder peak
obsidian pebble
#

but where do they come from? i didn´t change anything

elder peak
#

either way, some imports are unresolved there

#

did you import anything?

obsidian pebble
#

a few assets - but so far i always worked with them

elder peak
#

delete the files if you do not use them anyway

obsidian pebble
#

hmmm... i think i found the trouble maker! thank you!

granite basalt
# elder peak what do you mean?

well I'm making a dungeon generator and I'm running in to the later levels into frame rate issues, I only have these in vrchat not in the editor so I'm asking myself the question where they come from.

high mural
#

anyone recommend a good place to get help with udon?

#

like somewhere that I can find people to talk to about udon?

grand temple
#

right here!

high mural
# grand temple right here!

see i thought that at first too, but seeing as how my questions here so far have gone completely unanswered, this must not be a great place to ask for help

grand temple
#

that's because they posted when I was asleep 🙂

high mural
#

i'm trying to figure out why VRCInstantiate works in Unity but not when I upload the world to VRC

#

i'm using udonsharp

#

i also have several other questions about it.

grand temple
#

could you share a bit of the code that tries to instantiate?

high mural
#

the bot won't let me copy and paste it...

#

I'm just using VRCInstantiate(_thing) in the start event

#

also tried using in the interact event, but that also did not work

grand temple
#

are you getting any errors in the log? Is the udonbehaviour crashing maybe?

high mural
#

no errors

grand temple
#

try adding a debug log right before the instantiate to see if the code is getting to that point

high mural
#

does debug log show up when you're in VRC?

grand temple
#

in the log, yes

#

rshift + tilde + 3

high mural
#

nothing shows up in the debug; but i know the script is at least partially working because the cube it's attached to is rotating

grand temple
#

when you put it on interact and you hover over it, do you get the blue outline?

high mural
#

yeah but nothing happens when i interact with it

grand temple
#

If you see the blue outline, interact should work. I've never heard of getting to that point and not working unless the behaviour has crashed

high mural
#

that's the script

scarlet lake
#

so i open up my file to my world and it pops up as a udon prefab example scene

grand temple
#

so navigate to the scene you want and open that

high mural
#

well i'm about ready to just give up on trying to learn udon

grand temple
#

if you put the instantiate on interact, does the cube continue to rotate after being clicked?

high mural
#

yes

grand temple
#

wait, dumb question but are you sure it's not just like putting the object inside the cube? Is the object being instantiated smaller than the cube?

high mural
#

i'm pretty sure. when i play it in Unity the object instantiates on top of the cube. plus if I clip through the cube nothing is inside. i flew all around the level and the object doesn't appear anywhere

grand temple
#

you... flew? Using what? Because if it's a modded client then who knows what they modified, maybe they removed instantiation as an "anti crash measure"

high mural
#

it still didn't show up even before i used the mod

high mural
#

?

#

i just double checked on my other PC which doesn't have that installed. same problem

grand temple
#

is there anything weird about the object you're trying to instantiate? If you just put it in the scene directly, does it show up ingame?

#

What is on it, anyway?

high mural
#

it's a static cube, and a prefab

#

made with probuilder tools

#

not sure if that's "weird" or not

grand temple
#

oh, I think you need to bake probuilder meshes into a regular mesh or something

#

maybe they call it join or something

high mural
#

this is what it looks like in Unity; it works. the item spawns and the debug shows up

grand temple
#

yes, in unity. But when you uploade, probuilder scripts are removed

high mural
#

alright... i'll try a basic 3D shape then...

grand temple
#

so you need to make sure it's a regular mesh that does not rely on probuilder

high mural
#

ok; seems like that works with simple geometry. pretty annoying that i can't use probuilder though

grand temple
#

you can use probuilder to create meshes, just convert them to regular meshes before you upload

high mural
#

ok next question, the rotation is not globally synced. i put the object sync script on it, but that doesn't work. how can i globally sync it?

grand temple
#

only set the rotation if you are the owner

#

if (networking.isowner(gameobject))

high mural
#

oh i see. i'll try that

#

is this not the correct syntax?

grand temple
#

it's the right words, wrong capitalization. If you start typing it and hit tab, your editor should correct it

high mural
#

ok got it

#

that doesn't seem to work

#

.IsMaster doesn't work either

#

is there a scripting reference for this stuff?

grand temple
#
#

are you sure it's not syncing? If it's behind by like half a second that's normal

high mural
#

pretty sure it's not. testing with a friend rn

grand temple
#

well if you're relying on player sync that's going to be multiple round trips

#

best way would be to launch multiple clients and observe both

high mural
#

i'm just trying to make sure the cube appears in the same place for all players.

grand temple
#

oh, well if you're instantiating on start that's too early to have received sync

#

also objectsync will do nothing on an instantiated object

high mural
#

the rotating object isn't being instantiated, i

#

the rotating cube exists in the world from the start

grand temple
#

instantiating on start is too early for you to receive sync

high mural
#

ok; but is rotating the cube in Update not going to sync either?

grand temple
#

that's not the problem

#

rotating in update should sync the cube just fine

#

but when you join a world, it takes some time before you receive all the synced positions. Start happens very early, before that has finished

high mural
#

ok; let's forget Start and Instantiate; they're deleted. i rotate the cube in Update. I'm using the Network.IsOwner like you suggested. it is not synced with other players

grand temple
#

and how are you measuring that?

#

by a player standing underneath it?

dusk ingot
#

yes

grand temple
#

and is it wrong by a few seconds, or is it on the totally opposite side?

dusk ingot
#

off by a noticeable few seconds

grand temple
#

then that's just normal latency

high mural
#

so you're saying what I want to do is simply not possible due to the limitations of VRC?

grand temple
#

the method that you are doing to measure it is adding multiple round trips of latency

#

I have no idea what you want to do, I can only tell you that is expected behavior with the current method that you are using

high mural
#

i just want the rotating cube to appear in the same position for all players; that's all i'm trying to do. it's just a test. i guess it's not possible though

grand temple
#

it is in the same position for all players. But by the time they send their position back to you it has moved on to a different position

high mural
#

i.e. impossible

grand temple
#

pretty much. That's just how the internet and the speed of light works

#

now, realistically, if you wanted to reduce the latency so it is a smaller problem, you have options. But if you expect it to be absolutely perfect you'll be disappointed

#

objectsync when it is not being held has a lot of extra latency because it is not "important"

#

if you were to use a manual sync quaternion, it would be much much lower latency, but you would have to program the interpolation yourself

shell tangle
#

how come I can't get the audio to toggle on?

paper galleon
#

You need to invert the boolean

#

Currently your setting the state of the clip to be its current state

austere seal
#

sorry if this has been asked a thousand times, but approximitly how much time will it take so that i can upload a world? (i just downloaded the sdk)

paper galleon
#

So you have to set it to the opposite

paper galleon
#

Can't give any sort of estimate

shell tangle
#

@paper galleonso add an unary between the interact and set clip?

paper galleon
#

Yeppers!

shell tangle
shell tangle
paper galleon
#

Are you reading the mirrors gameobject activate state and inverting it via an unary?

shell tangle
paper galleon
#

It would go into the value node for set active

#

Can you take a screenshot of what your setup

shell tangle
paper galleon
#

Wait are you ever playing the audio clip?

shell tangle
#

yeah it should play on awake

paper galleon
#

You might need to route the "Event" node from SetClip to play

obsidian mountain
#

Would anyone know why SetActive would turn off the object the script is attached to instead of the object attached to the instance?

paper galleon
#

I don't see it playing on awake

paper galleon
#

So you need to set that

obsidian mountain
shell tangle
paper galleon
shell tangle
#

yeah I just want a box that toggles the music on and off

paper galleon
#

That may stop the current audio source as changing track

shell tangle
#

ah

obsidian mountain
paper galleon
#

What object are you feeding in with that object doe

#

Its probably the script object

#

"gameObject" indicates the scripts current object

obsidian mountain
#

Just a random GO

paper galleon
#

You probably need to have a parameter being a gameobject

#

And feed that in instead

obsidian mountain
#

No I brought in the GO manually

#

That sounds way more complicated then it needs to?

paper galleon
#

This at least to me appears to be a Object of name GameObject, that represents the object the script is attached to

#

So you need a reference to the object you wanna toggle, via a parameter and use that instead

obsidian mountain
#

No I just renamed the variable.

#

I did everything properly in terms of bringing in the object, trust me. But for some reason it doesn't recognize the instance of that object is what I'm assuming is happening

#

Which makes no since

shell tangle
#

@paper galleon is there a good tutorial you know of for this audio stuff I'm still having trouble and I don't wanna take all your time

paper galleon
#

Not that I know of sadly

shell tangle
#

yeah I found one but that was broken

obsidian mountain
#

If that helps better demonstrate what I mean

paper galleon
#

What object are you feeding into CoolGameObj via the actual script itself

#

I find it odd that it would default to the default gameobject (Script)

obsidian mountain
#

CoolGameObj from inspector = CoolGameObj

#

That's what I'm saying

#

Like it should work

paper galleon
#

I mean what object are you actually feeding into the script in the actual editor

obsidian mountain
#

But for some reason it doesn't recognize the instance?

paper galleon
#

I'm unsure then

paper galleon
shell tangle
#

yeah thats what I want to do I just don't understand how :?

paper galleon
#

So you have the onInteract for the buttons right?

shell tangle
#

yeah

paper galleon
#

In the variable tab you can specify the Audio Source, and the Clip. Basically each "Button" you'll have to say "Where the sounds coming from" and "Which sound will I play"

#

On Interact you'll set clip as your doing, using the Clip you bring in as the parameter along with the source

#

Then next you'll play the audio source using that as a parameter

paper galleon
#

Its this little area in the lower left of your graph

#

You can add/remove them here

#

Variables you add can be fed into the script from elsewhere, allowing you to adjust each instance of the script to your needs

shell tangle
#

ok added

honest vault
#

This is just me guessing hoping that it somehow helps, cause I am not quite sure how you're doing it and what possibilities exist for teleporting.
All the other objects are working, are you making it so it teleports to the object itself or to something close to it?

#

If noclip makes it so it's fine till you turn it off maybe it's cause the avatar is going inside such object, colliding with it and it freaks out sending you flying

#

if anything you could redo/delete the teleport that isn't working, copy one that is working and modify it and see what happens

obsidian mountain
#

Wait is there a way to not have to use the udon graph?

#

Aka using MSVS instead/writing the script?

obsidian mountain
high mural
#

yep

obsidian mountain
#

Dude hells yeah, I love writing in a editor much more then visual scripting

high mural
#

yeah i hate visual scripting

obsidian mountain
#

hate visual scripting so bad lmao

#

@high mural Wait damn it's in 2018.4.20

#

Does it work for you in 2019? Or did you find a way to allow upload at 2018.4?

grand temple
#

no, udonsharp supports 2019

#

where are you seeing 2018?

obsidian mountain
#

It does? For some reason it retrograde my project to 2018.4 for some reason

grand temple
#

what

obsidian mountain
#

Hmm okay so I'm still trying to get used to the API, are arrays different in udon?

grand temple
#

depends where you're coming from

obsidian mountain
#

Like can you not index your arrays? It's acting like it's a single instance like you would any normal variable

grand temple
#

yeah you can. Are you working in graph or U#?

obsidian mountain
#

U#

grand temple
#

then if you have public float[] myFloats you would access it like myFloats[1] = 5

valid sonnet
#

has anyone encountered this error:
Timeout while updating assemblies:Assets/Udon/Editor/External/VRC.Udon.Graph.dll (Output: C:\Users\micha\AppData\Local\Temp\tmp6f767d29.tmp)
[7:57 PM]
I've tried many things and can't figure out the cause of this
[7:57 PM]
using the newest SDK, and the matching Unity as recommended by the VRchat site

obsidian mountain
#

Ah wait so you can't use something like Vector3[] as an array

grand temple
#

hm? of course you can

obsidian mountain
#

Ah okay yeah it works normally, it seems the problem is that I'm using a variable as the index (I'm trying to loop through the array)

grand temple
#

that should also work fine

#

if you want to loop through the array you would do something like for (int i = 0; i < myFloats.length; i++) { myFloats[i] = 5; }

obsidian mountain
#

Oh I see what went wrong lmao, I accidentally put my variable to an array didn't realize it

#

My other variable, the one trying to collect the element

blissful bear
#

does anyone know what "Timeout while updating assemblies" means? ive been trying to test my world and it always fails. ive cleared all the errors except for this one "Timeout while updating assemblies:Assets/Udon/Editor/External/VRC.Udon.Graph.dll (Output: C:\Users\Asus\AppData\Local\Temp\tmp2f99977d.tmp)"

obsidian mountain
#

Do you have to use a rigidbody for collisions in vrc? I presume the player object already has a rb, but I'm not sure

mossy crane
#

Hmm struggling with a simple 5 second countdown to send a custom event, rather than OnPickupUseDown.. I want the gameobject to instantiate once every 5 seconds.

#

What kinda loop do I do on false to keep subtracting 1 then checking

obsidian mountain
#

If you want to run a timer/countdown, just do it the simple way. Take your variable and subtract it by Time.deltaTime

mossy crane
#

Timeleft starts at 5, Resettime puts it back to 5

#

I just need to constantly sub 1(or deltatime) from the Timeleft

#

on infinite loop

obsidian mountain
#

Ah so your wondering if there's a way to run a conditional?

mossy crane
#

Yeah but like always

obsidian mountain
#

Honestly after realizing UdonSharp, I recommend just using that lol, it's way better then the visual scripter

mossy crane
#

I tried update/fixedupdate to check a branch for true but it just spawned every second

obsidian mountain
#

You'll have an easier time in VSC doing a timer then you would in that

mossy crane
#

yeah my C is rusty so ive been lazy, just wanna test some stuff right now so dont wanna go down that rabbit hole lol

#

I just need a constant way to test this branch, and on false go back and sub 1

#

Needs a wait() function ;_;

obsidian mountain
#

Ah even so, I still recommend it. A timer is like 5 lines of code compared to figuring out how the hell to do a conditional in the visual scripting.

float timer = 5;

void Update() {
  if (timer > 0)
timer -= Time.deltaTime;
else {
// Do stuff
timer = 5;
}

}```
mossy crane
#

Understandable, still would like to figure out the worse udon work around just for the learning experiance

#

How does 1 add a udonsharp

#

to a object

dry shadow
#

Does anyone know what this avatar name is

jaunty dagger
#

Not sure, but he looks very pious

unborn hornet
#

knocking on doors intensifies

vast blade
#

Anyone know why this wouldnt work? It throws "Object Reference not set to an instance of an object"

#

Wait I used the wrong prefab

cold raft
#

well it can fail at two places with that error, either spawned is null or it cant find a component of type PaciIdleTileButton

vast blade
#

I used the wrong prefab it works now lmao

cold raft
#

that is really wierd. i dont know what happening then'

#

seems about right

tawny kite
#

Hello, I am trying to make a mirror toggle switch (local), and when I join the world, the mirror is already on, when I click the toggle button, the button disappears but the mirror stays on. I was just following a tutorial on youtube, can someone help?

grand temple
#

you didn't assign it in the inspector so it defaults to itself

indigo finch
#

Just for clarification, by oculus, do you mean:
quest/android,
oculus clients (aka not through steam),
or those playing on an oculus headset?

tawny kite
narrow falcon
#

Is there a way to create reusable functions in Udon? Or call Udon scripts from other Udon scripts? Like, I want to create a custom type of block that takes a bunch of inputs and makes some outputs, and inside it is a "sub-graph" of behavior... does something like that exist?

wind atlas
narrow falcon
#

Ah, hmm. Ok that's helpful, thanks!

#

I think that captures part of what I want to do (multiple things can independently trigger a sequence of behavior that's defined in one place)

#

You can't actually return a value from that though, right? Really what I want to do is define a function which takes some inputs, performs a calculation, and returns an output, without actually changing anything about the world.

#

A "pure function" for the functional programming nerds out there.

wind atlas
#

Not sure if there is another way, as I said UdonSharp is better for those kind of things.

wind atlas
# narrow falcon A "pure function" for the functional programming nerds out there.

I feel like I wasn't specific enough. But basically, you have a variable called "returnValue", then inside your event, let's say it's a simple addition method, you do something like valueA+ValueB and then store the result in returnValue. After you call that event, you can read that returnValue. Basically a "pure function" lol.

narrow falcon
wind atlas
fierce verge
#

Why cant I put the TextMeshPro text object in my udon variable?

night viper
#

Is it a Text Mesh Pro from a UI? or is it a 3D text? (yours is a 3D text, not UI)

fierce verge
#

ahhh

fierce verge
night viper
#

yes, it will be the TextMeshPro UGUI

fierce verge
#

So like this?

#

but my text doesnt change

fierce verge
grand temple
#

open your console and see what it says

fierce verge
# grand temple

An exception occurred during EXTERN to 'TMProTextMeshProUGUI.__set_text__SystemString__SystemVoid'.
Parameter Addresses: 0x00000000, 0x00000001

Object reference not set to an instance of an object

grand temple
#

it looks like it's assigned, not sure why that's happening. If you clear your console and try again, do you get the same error?

fierce verge
#

no

#

that was an old error

fierce verge
#

fixed it 😄

zenith hatch
#

Any idea how far we are from getting List, Dictonary and other stuff like this?

scarlet lake
#

Hi, I'm trying to set a timer to call an event I made, but the dropdown for the event name seems to be locked/greyed out. Do I have to make a literal string?

mossy crane
scarlet lake
#

Ahhhhh, yep, that was it. Thanks.

mossy crane
#

Does SDK 3 and udon still support the standard asset C# scripts on gameobjects?

grand temple
#

"still"?

#

it never did

mossy crane
#

Swear it did on sdk 2

grand temple
#

ok yeah "never" isn't quite right but it's been a very long time

#

was removed a while ago

mossy crane
#

Ah kk. Thank you

grand temple
#

oh wait sorry, you said "standard asset C#" and for some reason I interpreted that as "standard C# scripts"

mossy crane
#

the like LookAt and stuff

grand temple
#

but you are referring to the C# scripts which are in the standard assets package

#

yeah, SDK2 still allows those

#

but SDK3 does not

#

there's nothing they do that can't be built in udon though

mossy crane
#

Agreed im just recalling how I did it back in 2018 and was feeling to lazy to recreate lol

#

Whats the best way to slow the speed of a Transform.Lookat?

#

I dont want it to be instant, needs a variable speed

grand temple
#

use quaternion.lookrotation instead and quaternion.slerp from the current rotation

mossy crane
#

That follow speed

scarlet lake
#

Does this assign the players to the variable as well?

#

Also, I'm looping through an array and I'm trying to filter out null entries but whether I use IsValid or check if its null, it still gives me an error saying " Object reference not set to an instance of an object."

#

Anyone have a clue what I might be doing wrong?

grand temple
scarlet lake
#

Makes sense.

grand temple
#

this is the one you want

scarlet lake
#

ahh..Goddamnit haha, that's exactly what I was using.

#

yeah that makes more sense

mossy crane
#

Would it be pretty simple convert from this standard asset C# into U#?

scarlet lake
#

looks more like the blueprint node I'm used to 😛

mossy crane
#

Also I cant find any U# options in my project, is that a separate download?

grand temple
grand temple
mossy crane
#

Ahh makes sense, thank you

brazen epoch
#

is there some work around to move a VRC_Pickup with Object Sync for the LocalPlayer only

granite basalt
#

yes have your sync object as the main object, than add a object below taht you move yourself

brazen epoch
#

I might need to remove the component and then add it back once the LocalPlayer picks it up since I only want to disable movement until the LocalPlayer picks it back up

grand temple
#

you can't dynamically add and remove components

mossy crane
#

Do you want it to work both ways so sometimes everyone sees it sync and sometimes only local player? or just local player always

brazen epoch
#

ah. Hm. Then that might be problematic

#

Everyone sees it when someone has it picked up

#

the LocalPlayer needs to meet a condition to get the Pickup and it spawns in a centralized location everyone can see but not everyone has met those conditions

grand temple
#

so sync the spawning but not the pickup

granite basalt
#

yes so have a subobject (part that renders) than you can say hay you need to folow player, or set it to local 0 to folow sync

brazen epoch
#

I might be a little bit lost. Apologies

granite basalt
#

you also could disable the pickup script no

#

on the clients that dont have access

brazen epoch
#

I only want the LocalPlayer to see the Pickup

grand temple
#

it's kind of a weird question tbh. It sounds like you're skipping some steps by asking how to do one specific thing that you think would accomplish the goal, without explaining what the actual goal is

granite basalt
#

than only spawn it on the local player

brazen epoch
#

then everyone sees it when they pick it up

#

Okay. I'll explain the logic a bit more in detail

#

This will include game mechanics

mossy crane
#

how does Get hasChanged work for a transform, is it a constant true/false based on last frame pos of transform? Or if it has moved ever does it lock true

brazen epoch
#

Each player needs to retrieve 5 clues to unlock a gun which spawns in the middle of the map. The first player to unlock 5 clues gets the gun but nobody else should be able to see it before the Player who got 5 clues picks it up

mossy crane
#

Ahhh

grand temple
mossy crane
#

local gun spawn, global once pickup it sounds like

grand temple
#

if that's the case you should disable the pickup, not the objectsync

brazen epoch
#

Correct. I do realize I could just have everyone else disable pickupable, but I am trying to recreate an old SDK2 world where the gun did not show for everyone but the player who got 5 clues first until on pickup. Might be a limitation due to differences from back then which is fine, just exploring options

grand temple
#

that sounds like a weird sticking point

#

why would you want that?

brazen epoch
#

Trying to be faithful

granite basalt
# brazen epoch This will include game mechanics

what you can do is disable pickup at spawn (.enable on the script), have the rendering on a subobject, than enable that subobject when thay find the clues and enable the pickup for that client, than when thay pickup the gun enable the render for all (transfer ownership)

grand temple
#

but is it actually part of the game design or is it just a bug?

brazen epoch
#

It wasn't a bug since it never got fixed in the 2 years the world was up before it got deleted

#

then again. Some bugs are too mentally taxing to try to fix

grand temple
#

anyway, if you want to make it so people can't see it then that's just a matter of enabling/disabling the gameobject. Again, not disabling/enabling the objectsync

indigo wagon
#

If a game object has been moved before it is activated on a client it will not sync till someone regrabs it

mossy crane
#

this is close to working, but needs to be smoothed a bit more so every hasChanged, waits .3 or whatever seconds to Lookat

#

Right now it works like once smooth then just lookats on update instead of clearing flag

brazen epoch
#

Okay. I think I know what to do now. Thanks

mossy crane
#

Unless theres a way to just disable the flag every .3 seconds so constant movement is still effected

mossy crane
scarlet lake
#

Sure 🙂

mossy crane
#

🙏

scarlet lake
#

What are you trying to do exactly?

mossy crane
#

Fire this event at timed intervals rather than update

scarlet lake
#

oh

#

well

#

what you're doing now is making an event on a timer every update

#

which means that after the first 0.3 seconds, you'd basically be getting an event that would finish after each update

#

you're basically making a loaad of timers

mossy crane
#

Yeah, its a initial delay, but the update will fire on frame after that

scarlet lake
#

yea but you dont want that right?

mossy crane
#

no, ideally a real .3 seconds of delta time

#

fire

#

and so on

scarlet lake
#

yea

mossy crane
#

i tried a bunch of int and float math but hit a wall lol

scarlet lake
#

Instead you probably want to make one timer on start, and then set another timer in lookat

#

optionally

#

you can make a cooldown in the update itself instead of using a timer

#

first one is probably simpler for now though

mossy crane
#

What would the process look like to start

scarlet lake
#

1 sec

mossy crane
#

I hear people using

scarlet lake
#

you could use that if u wanted a cooldown

#

honestly you might as well

#

I'll write it in psuedo code

mossy crane
#

I guess yeah, just get current time, add 5, test if time == newtime and firevent?

scarlet lake
#

yes

#

after you call lookat just do

#

cooldown = LookAtCooldown + TimeSinceLevelLoad

#

then each update do

#

if(TimeSinceLevelLoad >= Cooldown)

#

if true, that means its been longer than LookAtCooldown

mossy crane
#

Ahh I see now!! Thank you ill give it a shot

scarlet lake
#

This is the other method I was implying before

mossy crane
#

oooh i like that logic too

scarlet lake
#

but stuff like this has overhead and I generally only use it for things that take longer

mossy crane
#

Yeah seems expensive

scarlet lake
#

i'm not sure how much overhead it has, in UE4 this is how the studio I work at usually does gun firing etc

#

Can you make a player invisible to other players?

scarlet lake
#

How do I get the udon behavior of a game object?

#

In another udon behavior

#

I have a ref to the game object

mossy crane
#

I think I made it work by making a UdonBehavioir variable in the top left of graph, make it public, then drag the gameobject with the udonbehaviour

#

Back at work so can’t actually look at my graph atm

grand temple
#

the thing that checks the timer and calls delayed events happens outside the udon VM so it's not too bad

#

relatively

autumn birch
#

this isn't syncing properly. Anyone have the proper node layout for synced animator toggles?

grand temple
scarlet lake
#

Is it possible to mess with the pitch of a player's voice or otherwise mess with the audio to make them sound demonic or anything like that?

grand temple
#

no

scarlet lake
#

ah, unfortunate

narrow falcon
#

Is there a way to get the location of the local player's camera?

grand temple
#

yes, get tracking data of the head

narrow falcon
#

That comes out of PlayerApi?

grand temple
#

yes

narrow falcon
#

Nice, thank you!

scarlet lake
#

I'm having some issues with my lobby. I'm getting an exception about the player I'm referencing to being invalid, but I have an isvalid and it seems to work for one of the players

#

I'm not sure how it can be invalid if I have a valid check right before there

narrow falcon
scarlet lake
#

isvalid is a null check p. much

narrow falcon
#

I'm a lot more familiar with C# than I am with Udon, so I'm still trying to unpack what the specific nodes mean...

scarlet lake
#

and some other checks

narrow falcon
#

hrm

scarlet lake
#

For some reason, executing requestserialization just before the for loop prevents the issue but that makes zero sense to me as this event is only running on the owner

narrow falcon
#

Is the exception happening on the owner?

scarlet lake
#

And hell, you can't even sync playerapi arrays

narrow falcon
#

oh rip

scarlet lake
#

I think so. I'm not sure how to check

narrow falcon
#

Well if you're the only player and it's happening for you, then you must be the owner, so then yes.

#

I wasn't sure if you were testing with multiple players, and maybe this error was just happening for them or something

scarlet lake
#

It only runtimes on the second player

narrow falcon
#

Ohhh

scarlet lake
#

The first player gets frozen correctly, the second is invalid for some reason

lament pike
#

anyone know where i can find the base vrchat video player tape? i think the tutorials version of udon may be a bit outdated. If not then what should i put in the last space?

scarlet lake
#

change the dropdown to type

#

rest is the same

lament pike
#

like this? or did i mess up

#

sorry if im being dumb

scarlet lake
#

click on the dropdown in GetComponent

#

turn it into "type"

#

then drag from the input and look for video player

lament pike
#

ooooooooooooooh

#

im sorry for the small brain but thank you so much

narrow falcon
#

Kind of a niche question maybe... is it possible to dynamically create a RenderTexture in Udon? I don't see a constructor for it.

narrow falcon
#

😭

#

ok thanks

fiery yoke
#

You can pool them

#

But thats about it

#

I dont know why you would really need to dynamically create them.
Thats not something you would usually do in Unity in general.

narrow falcon
#

I was trying to make a portal prefab (not like a VRchat portal, like a Portal-the-game portal) that you can actually look through, so I'd need to be able to dynamically create a camera and a rendertexture for each portal that's in the world.

#

but alas

#

I totally understand why this is not allowed, it would be an easy way to consume resources and crash games

#

But I just love playing with foot guns 😭

fiery yoke
#

There is other ways to do that, and its unavoidable.
Its not that they dont allow it, its just not something you should do

#

You cant have a hundred portals all rendering at the same time

#

Having two portals render recursively is already very expensive

#

Especially in VR

scarlet lake
#

yeah render textures tank performance really hard

#

(because you're essentially rendering the game again)

#

Seeing as you're here right now, Is this the case for methods like immobilize?

fiery yoke
scarlet lake
#

pain

fiery yoke
#

indeed

scarlet lake
#

i figured teleporting would not be client authorative

fiery yoke
#

Not necessarily an authorative thing, but more of a "logistical" thing

scarlet lake
#

oh well, atleast you saved me some time

#

thanks 😄

fiery yoke
#

Did I? As I said, Im not sure.
My guess would be that anything that "effects a single player" usually needs to be done locally and cant be done remotely.

#

But thats not always the case

scarlet lake
#

yep

#

I'll experiment a bit more

#

but i think youre right

obsidian mountain
#

Is there a supplement to lists in udon? Cause arrays aren't good since you can't add to them dynamically really as you could with lists

#

And apparently generics aren't allowed

fiery yoke
# obsidian mountain And apparently generics aren't allowed

Generics are not supported, because of how Udon works. Its technically not capable of supporting generics at the moment.
Which is also why Lists dont exist. You can make your own implementation of an Array-List (which is how Lists are actually implemented behind the scenes) in Udon, but its rather complex.

So in short: No there are no Lists in Udon.

obsidian mountain
#

Wait can you add to an array (within udon) like you can with a list?

fiery yoke
#

No, but lists are implemented with Arrays

obsidian mountain
#

Oh yeah your referring to as in making a makeshift version of a list

fiery yoke
#

The other common alternative is a Linked List

obsidian mountain
#

using arrays

fiery yoke
#

yes

#

Its technically possible

obsidian mountain
#

Yeah that's the only thing I can think of doing as well

fiery yoke
#

But not in a generic reusable way

#

Luckily, you dont usually really need lists

#

Because arrays suffice, as long as you know how to work with them

#

It really depends on what you need

scarlet lake
#

Is it possible to make a player invisible?

fiery yoke
#

Nope

#

At least not in a supported way

rough mesa
#

help

#

someone pls. im trying to make teleporters but i only started udon today and i cant enter the eventname

#

i will be super grateful

#

ik its probably some thing i dont have enabled but im at a loss

mossy crane
#

Make a node called Event Custom, type in any name, then make the event do something, then it will show in your send custom event drop down @rough mesa

narrow falcon
#

damn the helpful helper really is helpful

#

A+ name

#

Lots of good insights above, thanks for sharing!

#

I was definitely thinking about udon networking from the wrong perspective, I assumed the server had authority, but I guess it makes sense given the nature of the game that the local client has all kinds of freedom over the player and the avatar.

rough mesa
#

ok so i typed something in the event custom node but when i attach it to the sendcustomevent node nothing happens/drops down... what do you mean by "make it do something" @mossy crane

mossy crane
#

There’s a specific node called Event Custom, and in that node you type in the name you want for custom event. But Udon doesn’t compile just a lone custom event. It has to flow into something, then it can drop down from a send custom menu

#

I dont know if even custom going into the sendevent can see itself?

tepid salmon
#

why is that so befor the older sdk version you could add it with out work around. like adding samthink to the custom event so you can check the name in the sendcustom event why its now so?

stable thicket
#

Can anybody lend me a hand with something?
Trying to make a breakaway platform that disappears then reappears after a set amount of time using Udon graph.
I have this which...seemed pretty simple, where after a set amount of time after player enters the trigger the box would wait 5 seconds, become inactive, then after another 5 becomes active again.

mossy crane
#

To me it looks like the first send event and the second, would happen within a frame of eachother instead of 5 seconds apart, since the graph isnt waiting 5 seconds to go to the next send event

#

Change your second send event to 10 seconds maybe? @stable thicket

inner wagon
#

when i imported the sdk, it said something about obselete apis

#

is this normal? it loaded up everything fine, i think

mossy crane
#

Try closing and re opening the project after your first import

#

alot of errors go away after

#

as long as your unity version is

inner wagon
#

ohh okay my unity is a little behind

#

would i need to fix anything if i update

#

mines just 2019.4.29f1

mossy crane
#

oh i doubt theres any big change that will effect you

#

worst case is some scripts might have become obsolete but will be easy to identify if any errors pop up

#

Vrchat avatars or worlds would still function

fickle blade
#

I have some disobedient fans that won't turn. Someone else set them up and sent me a world copy.
I have only added static and pickup objects since, so they shouldn't have been altered.

#

That's hooked up to this:

mossy crane
#

Pretty sure static disabled movement

tepid salmon
#

if its on static it cant move

mossy crane
#

it will make it so cameras dont render it if its behind something

#

usually for scenery and background

fickle blade
#

Ah crap, missed the obvious there.

#

I made all the props static and it's bundled with those. Silly me.

#

Thanks :)

stable thicket
mossy crane
#

did you try just changing the second event to 10 seconds?

#

Cuz i think its litterally happening in 1 frame so it looks like nothing is happening

#

Otherwise your graph looks good to me, im big noob tho so definitely wait for a more seasoned response lol

stable thicket
#

I did actually tried to but it still didn't activate.
What I did try to test if it was going off was making it try to disable the collision box when a player touched it, which worked...in resulting in an error about permissions.
I'm gonna try an external triggerbox on top with a reference to the floor.

#

Also, even with all the C++ and C# I know...Udon is a nightmare for me to figure out. XD So don't worry, I'm a noob too.

#

Actually...I'm a derp.

#

Ya know what I forgot?

#

I was adding the Udon script to the wrong object.

#

It worked. Yay~ =D Also @mossy crane you were right about the timers.

full sparrow
#

trying animation for the first time, anyone know why the door render doesn't update it's rotation but the interaction outline does?

cunning mist
cunning mist
#

👍

scarlet lake
#

towards the back of the item it just sorta vibrate shakes

cunning mist
#

That could just be physics, though the fact it took about two seconds to pull to your hand indicates something else is probably acting up.

scarlet lake
#

possibly colliding on the player?

#

will try making it ignore the player and see if that changes the jitter 🤔

cunning mist
#

The "Pickup" layer automatically avoids the player, so unless you changed what layer it's on it shouldn't be causing any problems.

scarlet lake
#

ah yeah it is on Pickup layer

#

weirdly when I bump it against another object and it force moves it then it doesn't jitter

#

but only when its held in hand does it do it

cunning mist
#

You may want to set it to be "kinematic" while held so that it ignores physics in your hand. If you're using Object Sync, you will have to toggle it there instead of on the Rigidbody itself directly.

scarlet lake
#

will give it a go, ty :)

tall vault
#

The blueprint id has to be an id that has already been published on your account which you can get from the Content Manager tab in the SDK Control Panel if you want to update a project, otherwise it should be left blank for a new project being published which will generate an id for it

indigo cape
#

what is udon

#

udon spaghetti

jaunty dagger
#

Arg, anyone can assist me for a sec?

#

I tried to update Udon SDK3. Since I didn't know how to do, I deleted the Udon SDK folders in my project and reimported them, but now I get flooded with error messages. What is the proper way to replace an older Udon version with the current one?

#

Problem solved. Forgot to replace the UdonSharp with its newest version.

jaunty dagger
#

Does anyone see a reason why after switching off the first light, the meshRenderer does not change its material to lampOFF and instead the script breaks?
Expect all input variables to be correct and both, MeshRenderer[] and Light[] having the same amount of elements.

grand temple
jaunty dagger
#

Where can I find the log?

grand temple
#

ingame it is rshift tilde 3

jaunty dagger
#

okay, I will do. Thank you!

#

Tilde is this one? --> ^

grand temple
#

and the whole file is at appdata/locallow/vrchat

#

it's the key below esc

jaunty dagger
#

Ah okay 🙂 the typical "console" key for most games. Got it

#

Thank you!

grand temple
#

~