#udon-general
59 messages · Page 81 of 1
I found the solution on the udonsharp discord: The script used PropertyToID, which changes when in game.
Anyone know how to reference Udon programs from U# programs? I would like to access variables from a udon script
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");
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
what does it say when you hover over it?
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...
you need using VRC.Udon;
it should automatically add that if you type it in yourself, instead of pasting it
thank you
can someone send me a video on how to make a button that plays audio files
Add networking to your world music controls
Unity Project Source https://www.dropbox.com/s/x3922f2dgu5haqf/AudioControls-master.zip?dl=0
?
it was 9 months ago, idk if udon updated too much since
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#?
this seemed to fix it #udon-general message
you can't use the generic getcomponent with <brackets> you need to use this version (UdonBehaviour)obj.GetComponent(typeof(UdonBehaviour));
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
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
Is OnPickupUseUp sent to all clients?
Nope
I suppose it's also not safe to send a custom network event inside that scope since the logic isn't running
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);
}
it is if you sendcustomnetworkevent
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
is this object instantiated?
Yes. Both the clients and the Master can see the Pickup in the Owner's hands
instantiated objects cannot be synced
They're not instantiated through VRC_ObjectPool. They're awake on Start
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?
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
Do you get [Behaviour] <object> executing Shoot at the behest of <player> in your log?
No
did the udonbehaviour crash from something else?
Not that I can see. Both logs from in game and U# are not throwing any exceptions
this udonbehaviour is on the same object as the pickup, right? Not like on a child or something?
Correct
Commenting out a GetComponent(typeof(VRC_Pickup)) to test to see if that's crashing the script
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
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();
}
}
and the inspector?
The Unity console?
the window where you add components
oh, you have synchronization method set to none
that disables syncing
including network events
Oh wow. I did not know that. That might explain a lot of the bugs I've been experiencing.
Would manual suffice?
you should have continuous because there is also an objectsync on this
Okay. Thanks for the info. Guess I'll see if that fixes it
objectsync is only compatible with continuous
Seems like that works now. Thank you
How would you pass arguments through this?
oh i am too stoned for this nvm
wait nvm that
i have a question
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
no
is there a good way to do this
^
correct
so i couldnt pass a VRCUrl object through events
you can use the string to identify what object you want, like as an index of an array
my mind is blown
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...
do you have any synced variables? I don't think sync does anything if you don't
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?
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
How do i put my Transform Get Position of gun and store it into GunPos in Udons case?
as a vector3
doesnt connect is there a middle node i need?
set variables by holding shift while dragging them into the graph
put tbat after the setowner before requestserialization
Set pos > Set Rot > Set Velocity > serialize > instantiate event. then when spawning use the sync'd variables as reference?
and is sendchange important
sendchange is used for when you want to detect a variable's change, you would need an ovariablechanged for that
that interpolates a value over time rather than changing it immediately. you don't want that here
it doesn't work in manual anyway
Ah, just eases some networking instead of like every frame
Works!!!!!
Looks much cleaner and learned lots, thank you!!
woo
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?
idk if pickup applies velocity
I would calculate velocity by comparing position changes from one fixedupdate to the next
but player velocity would be a much easier alternative
Hmm what math node would i use in 2 FixedUpdates of gun position to calc the change in velocity?
why does VRCInstantiate work in Unity but not when I upload to VRC? i'm using udonsharp
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!
Pls help!!
I get this error when i make udon scripts
NullReferenceException: SerializedObject of SerializedProperty has been Disposed.**
oops nvm found issue
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?
how would i write an udon script to assign info to a submenu via buttons
tags are ignored when uploading, therefore no
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?
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#
ohh I just saw a vidoe on that
Can you please show me? ;-;
looking for it right now
(Sorry, accidentally recorded this one in 1080p, whoops)
Two of my oldest videos, Contextual Buttons and and Door Animations, have both grown rather outdated, so I've combined the two into a brand new video to go over them!
Full Tutorial Playlist:
https://youtube.com/playlist?list=PLwEtUGCdQX7HMkFCVxiNvO4DS2CmHWbe6
00:00 - Intro
00:42 - Animat...
Thank you so much for helping me out, but sadly that's not what I'm looking for
ohhh from a trigger collider
Yeah, you know those Hotel Keycards that you put near the door handle to open it?
I know that's why I'm trying to look for how to do that
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.
That's sounds strange...is it clipping with anything or just shooting people like rockets?
It makes you fly backwards and then drops down
That's very odd
im going to try to just recreate the building and see if that fixes it
I hope everything works out in the end
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
You can calculate the delta yourself by taking the current position and subtracting the previous position of the hand
chould u show a screenshot example? i started with udon yesterday
v = s / t
t = Mathf.deltaTime
s = (currentPosition - lastPosition).magnitude
is it possible to make an object move randomly throughout the world with udon or UdonSharp?
yes
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 (?)
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
i already tryed that with an animation but its pain for such a long route to do every few seconds a keyframe
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?
that does work with VRC?
how do I teleport a player from one room to another?
Udon is part of the VRC SDK & you should be fine to publish from mac or linux...the only problem will be if you wanted to test your content with actual vrchat clients, but with cyanemu and lyuma's av3 emulator you probably shouldn't have to do much of that
@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.
emulators for testing in your editor -- cyanemu is for worlds, lyuma's is for avatars
Yes works
hmm okej :3 just need to find now the correct one xD there are many in asset store
oh its already in udon i see
how whould i get last position and current position?
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
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?
ok got a new problem xD anyone know how to fix that..? I cannot upload my world anymore...
Looks like a temp file is missing.
but how...??
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.
this gud?
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?
its just a variable
Ah, koay
I would call it different
didn´t worked :/
currentFramePos
and lastFramePos, so it's more clear
Yeah, I thikn it cannot work
The bottom part: Bool and UnaryNegation.
It does nothing
cleared a bit
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
any way to apply impulses?
heres the second part
that gets the velocity
n stoff
Not sure, but the variable needs to be synced with the server, no?
its suppost to be local
every player is gonna have their hand velocity tracked
Okay, I understand
ye theres a button that send a log
and it seems accurate
The second map looks okay though. Should work like it is
Not sure why the first one doesn't.
i hav a problem now
Me too
oh
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 :/
what's your actual question?
networking owners own game objects, if you want to set the owner of a gameobject, you must do so via SetOwner
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
^ that one
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?
The buffer is already a local value and should only affect the local player camera. Are you syncing it to everyone else or something?
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?
Is the camera attached to the vehicle too?
As a grandchild, yes. I'll send you a hierarchy screen, one second
I think what's more interesting for this issues is, where are you controlling the buffer?
Do you enabled/disable the cam?
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
Afaik OnStationEnter - or whatever it was called - will be called on every client.
That might be it.
Oh damn, that reall might be the reason if its called on every player
I was wondering, how can I get the occupying player?
Is there a getter method in VRCPlayerApi or Networking?
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!
I thought you already used that method since we were talking about how it might be the issue.
Yep, I used it, but actually didn't realize that it hands me the occupying player on a silver platter
facepalm
Not sure what you mean by prioritize, rigidbodies have different modes to increase accuracy.
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
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.
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.
And yeah, about the UI, do you have a UI Shape object on it? Otherwise, if you have a trigger around it, that will block the raycast, you have to set that collider to the MirrorReflection layer.
what the opesite of the constructor in vector3?
Yep, got the UIShape object on the canvas. Does every button and panel need it as well?
https://docs.vrchat.com/docs/input-events for inputs, you can also use regular Input.GetKey for Keyboard inputs.
No just the canvas.
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.
Is there a trigger collider around the canvas?
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?
Doesn't matter, what matters is the layer. If it's not set to MirrorReflection, than the ray will be blocked by the collider.
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.
The canvas? I'm talking about the gameobject the collider is on.
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!
I'm glad that it worked.
Still testing out, but you gave me at least an edge to work on. I was at the end of options 🙂
can anyone make this in vrchat im sure if u look at instructions on the paper u will make it
it needs dice
When using MirrorReflection layer on the gO that also has the canvas, the gO becomes invisible. Are you sure I should use this layer?
Yeah, that layer does affect rendering as well.
Just to be clear why you use MirrorReflection: Colliders/Triggers block the VRC ray, which prevents you from interacting with the Canvas. To circumvent that, people give colliders the layer MirrorReflection. This way, the ray still targets the canvas and the collider still functions like it used to.
In your case, you probably want to create an extra game object for the collider.
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?
canvas
Actually, afaik Ui Shape creates a collider for you.
well - the main parent
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)
Does it add it at runtime?
you might have the z scale on your canvas at 0 (or x)
Just tested it with my own and yeah, it does create the collider at runtime.
If you use windows, use Ctrl+Shift+S please.
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.
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 -_-
wait, wasnt that the issue that made the one panel not interactible tho
slim
hmm ok, id still just do the istrigger box collider to garentee it to not be too wonky
Hm, when setting z of the RectTrabsform to 0, button text disappears
ye. youre using rotations so id keep it at 1
Ok
um, wait, is it still not working tho?
Let me compile n check for a second.
k
What kind of VR weirdness are we talking about? Does the normal Ui Shape not work correctly?
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.
Thank you!
The VR pointer collision point must be between your view (headset) and the particular canvas element you want to interact with, in order for the interaction to work.
If you create a canvas with a BoxCollider that isn't flat, and test in VR, you'll kinda see what jank it is.
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.
It more so feel unintuitive due to certain expectations of Unity UI. Ergo why I flatten the colliders with that script.
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?
Okay.
Then the error must be somewhere else in my setup I guess.
Not sure if I understand properly, maybe I need to test it out myself to feel it.
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!
Yea that's the best. It's definitely a "see it for yourself" kinda thing to properly wrap your head around that particular jank.
So does the jank happen when you get to close?
technically distance doesn't matter, but proximity makes the jank more apparent.
Yeah, that's what I was assuming, so maybe I know what you mean, but I'll definitely check it out.
For example, looking down at the canvas from above, and pointing at the canvas from the side.
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.
Pretty much yup
But that means that the layer of the object is no issue, as the pointer is recognized and turned into a mouse cursor, right?
Yep I mean in my case
the UI layer is ignored until the VRC menu is open.
It seems to work, I get a mouse cursor when looking at the canvas
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.
But interaction wont work
It should work though. Did you manage to make it work with the things you were trying earlier?
Wait, does Udon support TextMesh buttons? Maybe thats the problem here
It does support them, as I said, there might be something else interfering with it. Like a huge trigger zone around the canvas.
for TextMeshPro? It should yes.
What's the component look like in the editor?
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:
what does the inspectpr of the panel and a button look like?
how do I make a delay between 2 actions?
Button
between these 2
Time.deltaTime
so its turning another button off?
??
The canvas doesn't have a UiShape component.
thsts panal
Ok 
Yup, the canvas got one, only the rest doesnt
this aint it chief
Use the SendCustomEventDelayedSeconds if you don't know what timeDelta is. Much easier to use.
No, I would create a counter and substract deltaTime from it.
that just sends an event after X amount of seconds right?
Yes. So you only need to create a custom event for the last SetActive
Honestly, I'm not sure what the issue is. My last resort is to create a basic example in isolation from scratch, no other variables, until it works.
this turns the object on but not off....
It does after 5 seconds.
Ive been looking at it for like one minute
I'll try that! Thanks for your help!
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.
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?
Oh, if it is a particle you can use "emit" instead.
I see
how do I make it so if I press a button it just shoots aprticles for 5 sec and then stops hmmmmm
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.
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
You can just disable looping, set the seconds.
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
Found the issue. The tutorial I used told me to delete graphics raycaster and canvas scaler. Without them it didnt work.
anyone have an idea why that happens all the time...?
everytime i try to upload my world the file is missing
Annyone knows why disabled instanciated gameobjects have an overhead in vrc. (thay dont in the editor)
check for the other erros in your console, that's just the last one
what do you mean?
yea, if these are c# files and not u#, you cannot have that in vrchat
but where do they come from? i didn´t change anything
a few assets - but so far i always worked with them
delete the files if you do not use them anyway
hmmm... i think i found the trouble maker! thank you!
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.
anyone recommend a good place to get help with udon?
like somewhere that I can find people to talk to about udon?
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
that's because they posted when I was asleep 🙂
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.
could you share a bit of the code that tries to instantiate?
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
are you getting any errors in the log? Is the udonbehaviour crashing maybe?
no errors
try adding a debug log right before the instantiate to see if the code is getting to that point
does debug log show up when you're in VRC?
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
when you put it on interact and you hover over it, do you get the blue outline?
yeah but nothing happens when i interact with it
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
so navigate to the scene you want and open that
well i'm about ready to just give up on trying to learn udon
if you put the instantiate on interact, does the cube continue to rotate after being clicked?
yes
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?
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
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"
it still didn't show up even before i used the mod
?
i just double checked on my other PC which doesn't have that installed. same problem
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?
it's a static cube, and a prefab
made with probuilder tools
not sure if that's "weird" or not
oh, I think you need to bake probuilder meshes into a regular mesh or something
maybe they call it join or something
this is what it looks like in Unity; it works. the item spawns and the debug shows up
yes, in unity. But when you uploade, probuilder scripts are removed
alright... i'll try a basic 3D shape then...
so you need to make sure it's a regular mesh that does not rely on probuilder
ok; seems like that works with simple geometry. pretty annoying that i can't use probuilder though
you can use probuilder to create meshes, just convert them to regular meshes before you upload
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?
it's the right words, wrong capitalization. If you start typing it and hit tab, your editor should correct it
ok got it
that doesn't seem to work
.IsMaster doesn't work either
is there a scripting reference for this stuff?
The three main concepts used for networking in Udon are Variables, Events and Ownership. Variables are containers for values - like a number, a set of colors or a 3D position.Events are things that happen at a moment in time.Ownership is the system that decides which user can update a variable, whic...
are you sure it's not syncing? If it's behind by like half a second that's normal
pretty sure it's not. testing with a friend rn
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
i'm just trying to make sure the cube appears in the same place for all players.
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
the rotating object isn't being instantiated, i
the rotating cube exists in the world from the start
instantiating on start is too early for you to receive sync
ok; but is rotating the cube in Update not going to sync either?
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
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
yes
and is it wrong by a few seconds, or is it on the totally opposite side?
off by a noticeable few seconds
then that's just normal latency
so you're saying what I want to do is simply not possible due to the limitations of VRC?
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
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
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
i.e. impossible
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
You need to invert the boolean
Currently your setting the state of the clip to be its current state
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)
So you have to set it to the opposite
Its variable and depends on how you play and where
Can't give any sort of estimate
@paper galleonso add an unary between the interact and set clip?
Yeppers!
hm ok
will do that and try compiling thx
yeah I tried using the same process as for mirrors but its not working
Are you reading the mirrors gameobject activate state and inverting it via an unary?
its not letting me plug get active self into any of the audio nodes
It would go into the value node for set active
Can you take a screenshot of what your setup
deleted it and started again but this is what I have
Wait are you ever playing the audio clip?
yeah it should play on awake
You might need to route the "Event" node from SetClip to play
Would anyone know why SetActive would turn off the object the script is attached to instead of the object attached to the instance?
I don't see it playing on awake
If you don't feed in an object to set active to it defaults to the scripts object
So you need to set that
I have the object attached to the instance though, that's the weird part
I set that on the audio source itself
So your playing the clip then setting the clip to something else?
yeah I just want a box that toggles the music on and off
That may stop the current audio source as changing track
ah
This is what I have setup, something as simple as toggling the object, however the object being interacted is the one that gets disabled for some reason
What object are you feeding in with that object doe
Its probably the script object
"gameObject" indicates the scripts current object
Just a random GO
No I brought in the GO manually
That sounds way more complicated then it needs to?
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
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
@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
Not that I know of sadly
yeah I found one but that was broken
If that helps better demonstrate what I mean
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)
CoolGameObj from inspector = CoolGameObj
That's what I'm saying
Like it should work
I mean what object are you actually feeding into the script in the actual editor
But for some reason it doesn't recognize the instance?
I'm unsure then
From what I know, you can set the AudioSource's clip to whichever you want, and play. You can add buttons to start/stop it, and a automatic clip load and play on Start (If you want it to be on by default)
yeah thats what I want to do I just don't understand how :?
So you have the onInteract for the buttons right?
yeah
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
whats the variable tab?
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
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
Wait is there a way to not have to use the udon graph?
Aka using MSVS instead/writing the script?
udonsharp
Oh wait this? https://github.com/MerlinVR/UdonSharp
yep
Dude hells yeah, I love writing in a editor much more then visual scripting
yeah i hate visual scripting
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?
It does? For some reason it retrograde my project to 2018.4 for some reason
what
did you grab the latest release? https://github.com/MerlinVR/UdonSharp/releases/tag/v0.20.3
Make sure you are using the latest VRCSDK
If you are upgrading from Unity 2018, follow the upgrade instructions https://docs.vrchat.com/v2021.3.2/docs/migrating-from-2018-lts-to-2019-lts pay specia...
Hmm okay so I'm still trying to get used to the API, are arrays different in udon?
depends where you're coming from
Like can you not index your arrays? It's acting like it's a single instance like you would any normal variable
yeah you can. Are you working in graph or U#?
U#
then if you have public float[] myFloats you would access it like myFloats[1] = 5
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
Ah wait so you can't use something like Vector3[] as an array
hm? of course you can
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)
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; }
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
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)"
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
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
If you want to run a timer/countdown, just do it the simple way. Take your variable and subtract it by Time.deltaTime
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
Ah so your wondering if there's a way to run a conditional?
Yeah but like always
Honestly after realizing UdonSharp, I recommend just using that lol, it's way better then the visual scripter
I tried update/fixedupdate to check a branch for true but it just spawned every second
You'll have an easier time in VSC doing a timer then you would in that
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 ;_;
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;
}
}```
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
Does anyone know what this avatar name is
Not sure, but he looks very pious
knocking on doors intensifies
Anyone know why this wouldnt work? It throws "Object Reference not set to an instance of an object"
Wait I used the wrong prefab
well it can fail at two places with that error, either spawned is null or it cant find a component of type PaciIdleTileButton
I used the wrong prefab it works now lmao
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?
you didn't assign it in the inspector so it defaults to itself
Just for clarification, by oculus, do you mean:
quest/android,
oculus clients (aka not through steam),
or those playing on an oculus headset?
Thanks! Now it works
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?
Stuff like that is a bit easier in UdonSharp.
But for graphs: You can't really create reusable functions like a subgraph, but you can create custom events with certain variables that you set before calling it. You can even move that logic into a separate udon and then reference that instead.
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.
Not sure if there is another way, as I said UdonSharp is better for those kind of things.
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.
Yeah, I get what you're saying. I'm still getting my head around how Udon actually executes, and if there would be any concurrency problems with doing that... like if multiple event handlers are executing at the same time, they both call that function, and then they both write to that variable, only one will win. But does that kind of concurrent execution even happen in Udon? idk...
Since udon runs in its own compiler, I assume it works like every other language and executes everything sequentially, unless you tell it not to.
Why cant I put the TextMeshPro text object in my udon variable?
Is it a Text Mesh Pro from a UI? or is it a 3D text? (yours is a 3D text, not UI)
ahhh
so I created a TMP text in a UI canvas, so is it then TMP-UI?
yes, it will be the TextMeshPro UGUI
So why doesnt my text change? I got the inputfield and text objects connected to the graph???
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
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?
If I put text in the inputfield and hit the apply button the text doesnt change
fixed it 😄
Any idea how far we are from getting List, Dictonary and other stuff like this?
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?
Soon™
Does the custom event flow into anything? It wont populate until the event does something
Ahhhhh, yep, that was it. Thanks.
Does SDK 3 and udon still support the standard asset C# scripts on gameobjects?
Swear it did on sdk 2
ok yeah "never" isn't quite right but it's been a very long time
was removed a while ago
Ah kk. Thank you
oh wait sorry, you said "standard asset C#" and for some reason I interpreted that as "standard C# scripts"
the like LookAt and stuff
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
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
use quaternion.lookrotation instead and quaternion.slerp from the current rotation
That follow speed
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?
It does modify the array so technically it does, but it doesn't have flow so you need to put it somewhere. It would be best to use it to set the array, even if it's effectively setting it to itself
Makes sense.
Make sure you're not using playerapi.isvalid. That is a special node that only handles a few specific cases where the playerapi is valid but has left the instance
this is the one you want
Would it be pretty simple convert from this standard asset C# into U#?
looks more like the blueprint node I'm used to 😛
Also I cant find any U# options in my project, is that a separate download?
Looks like that uses inheritance. It probably has a parent class that calls FollowTarget, and then this overrides it. You would have to combine the classes together into one, and remove the override. Aside from that, I think it would work
U# is not included in the SDK if that's what you mean. It's on github
Ahh makes sense, thank you
is there some work around to move a VRC_Pickup with Object Sync for the LocalPlayer only
don't have objectsync?
yes have your sync object as the main object, than add a object below taht you move yourself
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
you can't dynamically add and remove components
Do you want it to work both ways so sometimes everyone sees it sync and sometimes only local player? or just local player always
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
so sync the spawning but not the pickup
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
I might be a little bit lost. Apologies
I only want the LocalPlayer to see the Pickup
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
than only spawn it on the local player
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
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
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
Ahhh
but you do want other players to see that person holding the gun, right? You just don't want everyone to be able to pick it up?
local gun spawn, global once pickup it sounds like
if that's the case you should disable the pickup, not the objectsync
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
Trying to be faithful
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)
but is it actually part of the game design or is it just a bug?
true
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
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
If a game object has been moved before it is activated on a client it will not sync till someone regrabs it
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
Okay. I think I know what to do now. Thanks
Unless theres a way to just disable the flag every .3 seconds so constant movement is still effected
Sorry for the ping, you said you were working on a timer for firing events? Would you mind helping me get started with that?
Sure 🙂
🙏
What are you trying to do exactly?
Fire this event at timed intervals rather than update
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
Yeah, its a initial delay, but the update will fire on frame after that
yea but you dont want that right?
yea
i tried a bunch of int and float math but hit a wall lol
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
What would the process look like to start
1 sec
I hear people using
you could use that if u wanted a cooldown
honestly you might as well
I'll write it in psuedo code
I guess yeah, just get current time, add 5, test if time == newtime and firevent?
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
Ahh I see now!! Thank you ill give it a shot
oooh i like that logic too
but stuff like this has overhead and I generally only use it for things that take longer
Yeah seems expensive
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?
How do I get the udon behavior of a game object?
In another udon behavior
I have a ref to the game object
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
the thing that checks the timer and calls delayed events happens outside the udon VM so it's not too bad
relatively
this isn't syncing properly. Anyone have the proper node layout for synced animator toggles?
The reason it doesn't sync properly is because you're telling everyone to toggle it, you're not telling them what to set it to.
One way to fix that would be to simply have two events: one for off one for on.
However that won't send the state to late joiners. If you need that, you should instead set a synced variable. You could also use OnVariableChanged to apply the variable to the animator
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?
no
ah, unfortunate
Is there a way to get the location of the local player's camera?
yes, get tracking data of the head
That comes out of PlayerApi?
yes
Nice, thank you!
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
What does "Is Valid" do exactly?
I think what's happening here is, your CurrentPlayingPlayers variable is, let's say, 16 spaces long, but if you only have two players, then the last 14 spaces will all be null. The exception that you're getting is that you're trying to do something with one of those null objects.
isvalid is a null check p. much
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...
and some other checks
hrm
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
Is the exception happening on the owner?
And hell, you can't even sync playerapi arrays
oh rip
I think so. I'm not sure how to check
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
It only runtimes on the second player
Ohhh
The first player gets frozen correctly, the second is invalid for some reason
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?
mine:
click on the dropdown in GetComponent
turn it into "type"
then drag from the input and look for video player
Kind of a niche question maybe... is it possible to dynamically create a RenderTexture in Udon? I don't see a constructor for it.
No its not.
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.
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 😭
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
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?
Im not sure, but possibly. Since VRChat does not document this anywhere, you just have to trial-and-error
pain
indeed
i figured teleporting would not be client authorative
Not necessarily an authorative thing, but more of a "logistical" thing
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
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
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.
Wait can you add to an array (within udon) like you can with a list?
No, but lists are implemented with Arrays
Oh yeah your referring to as in making a makeshift version of a list
The other common alternative is a Linked List
using arrays
Yeah that's the only thing I can think of doing as well
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
Is it possible to make a player invisible?
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
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
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.
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
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?
This is someone’s pic from earlier https://media.discordapp.net/attachments/657394772603830360/928748766142562324/unknown.png
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?
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.
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
when i imported the sdk, it said something about obselete apis
is this normal? it loaded up everything fine, i think
Try closing and re opening the project after your first import
alot of errors go away after
as long as your unity version is
ohh okay my unity is a little behind
would i need to fix anything if i update
mines just 2019.4.29f1
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
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:
Pretty sure static disabled movement
if its on static it cant move
it will make it so cameras dont render it if its behind something
usually for scenery and background
Ah crap, missed the obvious there.
I made all the props static and it's bundled with those. Silly me.
Thanks :)
I didn't think of that. Although it looks as though it's not triggering at all. I tried to test the call, should the trigger not be a part of same object maybe? As in make a trigger box independent of the mesh object?
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
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.
trying animation for the first time, anyone know why the door render doesn't update it's rotation but the interaction outline does?
Your door is likely correctly animating, but was set to be "static" in the top right of your inspector. Setting something to static makes Unity's renderer assume it will never move, causing what you're seeing now.
thank you 🙂
👍
does anyone know what causes a pickup to shake like this while in hand?
https://gyazo.com/c14543a4ffe01cad3a33a15cebf1dfc8
towards the back of the item it just sorta vibrate shakes
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.
possibly colliding on the player?
will try making it ignore the player and see if that changes the jitter 🤔
The "Pickup" layer automatically avoids the player, so unless you changed what layer it's on it shouldn't be causing any problems.
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
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.
will give it a go, ty :)
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
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.
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.
check your log to see what the error is
Where can I find the log?
ingame it is rshift tilde 3
~