Jetdog's tips and tricks

archiving different pieces of information here. in the future it might be more organized.

3 Likes

when instantiating a object since there is no input to set the position. to make the object appear you must set position after.

1 Like

for people that know Boolean logic a screenshot of the equivalent in udon.

6 Likes

self referencing component variables like rigidbodys will return null.

you must use get component to save the reference to the variable.

1 Like

dont think about trying to link every event after another.
image

if you decide to use branches(if statements) you wont be able to link the next set of events.

use branches to help separate sections of code.

4 Likes

Vrchat due to security have to protect objects players should not access. if you try to access these objects udon will return the object null. this will cause exceptions breaking your code. to solve this you will need to add null checks.

one good example of this is trying to use on trigger enter with a player entering the trigger. image shows a good way to solve the issue.

copy string

application/vnd.unity.graphview.elements ALVT24rbMBD9lTDPltHFsq1AXvZSCIXdQrd5KcFI9jh1q8hbX7YN3nxZH/aT+gtVGrNtkqWEwjIvGs3tzDnSzx9PAzxo2yNMPw5Q9tbe6LV34PoBXZfdurumWq2wuXYdNhBAXxU+mJRFzBkzRHIek4gpSpTSgtBYGYUouU/wyfd1W3VV7WA6wHeYEi5ZSAPY+GPMQrkNwNUFfphftX76MoDS1t9GD1QuWMK4JKmkSCJapiTFBEkiSs1pmmqRSFjuOyx2C/zusQ0OlrhotMs/PcM+q+cJ7H+ihpyqROsyIhEWhe9ZxMSkBSNxjhRVJJKC5o8UDrc7xj1A76puc2s+Y94t9nIMULm28/hxfgVT6se2XVO51RiG95u2w3V4UdcWtQsm6zavG1uZYLLApvXwZ1FIdxZMLnvb9Q3OHPZdo20wedcbW+VvcXNXf0E3M0miZS5jpkSENFWPb7RtEbbHdO5H7lGGWVbfZ3OHX3ttPfYs+zt66IzeCPVZjnOoO5VDpKMaTJyIcc679GIEkBeCc218jqAliYwyxLBCE17GscRYSsXwVVSDHaX/U3asxWXtC7Ibf/GHzzOWeuFXMpGMjL7wvF+FgqW3Xw==

a way to get player information from triggers. you can get the object string from protected player gameobjects.
for the local player the string you will get will look something like this:

VRCPlayer[Local] 12774204 1 (UnityEngine.CharacterController)

The beginning will look like “VRCPlayer[Remote]” when you see other players inter the trigger.
what makes this useful is cause you can get the player apis id from who enters the trigger(the last number in the string).

example case of using this information:

Summary

application/vnd.unity.graphview.elements AM2W227jNhCGX8XgtSiQHB4N5GKTbItggWbRpLlpDIOiqFStIgWSnNZw82S96CP1FTq2YndtZ1thkS1i3ZjiQeT/zT/Dv/74c0UefbWIZPrjihSLqvrO32OD3Hx/dnX+4dR3Ef99rPwytu8eynQ+/zb2Q/N0eZHP51fLro/3F3UPYj5/eRJJyKLMcU3DQsy1ySnwQlCpuafe+UBBKBmyqMCFiIMfmq7sy6Ym0xX5jUyV0Cm3UjEnjAEJNiFLMjUm1VJZYYU0zDDgTwmpmzz+cHHe4VmIdZzZ4CxlxjAqDWTUhqKgXGgFhbQqMv47I7OEFFXz6/Os2bDGzVqQbqPIoi775WX2cwz9zSDTipR11/s6xItzMmX42a5vy/ruuZsMgqQbRZLJfReatiqzZHIT2w4PdSJTtn6Sydmi6hdtPKnjom99lUw+LrKqDB/i8rr5JdYnmTFeBaW5AxmZdbjbp9lTskdp+NhZUz/Gtkc4180ziaHjarOzPUg7GGMEOoYBXG5ggDNOOsHdKBguiqh8NDQoC1Q6k1FvMkUL57TlOQBw81VgfE6xQZh3beuXQ0gfBPKno3aKjTnFsWJcsFRqKVEZwaXdxi9nLMUuy8ACMGbsoWY+1zpaJmlAranMWUFtAZ46ZrwBbRiPa80S8lVkS95W6It/B4kMrx6qst8Ht8G792Yz6PJhTad7YeyO9Bjtj0lTLnmqQCklnLGKKw0jUePXQFlJC85zKlUU1OdCUpUHW3AtjPbFgPoN0h70w428KvDV7VCWbvFMt2RyS2ZPX7jNz0XOsMgmZ+6nyQPXj4HzQiyA42h77bh1mC25UJtQoJynzHLMosxin2QaDmOBax9tZqhTRlIJHpMMaEF5pq3OlTbRwv+eKFElrDG9Lw9ts22dNk0Vff2PaE4GH7C+h4IFKnnBqQUXqcC3IZcMf/mLBjIpODSYNgpt8oloXAgBlivHDSZb+wUGerveeV3n7G5ex0hPW9zRTztIWK+gAMEogMd6lmFRs1E5WghusuhzpiAcQ8JSluLNQXAFOBeXGBhZkUq8OliHic6tq9whojERsc9nm+5e60r2HKSvK/c3vurisdTvH2Pdzy/r67a8u4vt+7pHIDt3jPH4sTu2yhuNDuHWbN3xH+XlQNRR1A9Vn+EB/wY=

if you use string.split and set it to split from a singular “space” string the the third element in the array will be the players id.