How to Make Object Follow a Player - Udon / VRChat SDK3.0

  Рет қаралды 13,193

PlayerBush001

PlayerBush001

Күн бұрын

Пікірлер: 127
@FunkbusterG
@FunkbusterG 5 ай бұрын
You've solved my problems so many times that I now click on your videos with full confidence that my thing will work by the end of the video.
@toonlegacystudios8529
@toonlegacystudios8529 5 ай бұрын
So I created the PlayerApi node on variables, then I renamed it to LocalPlayer, but when I dragged it onto the udon graph, it came out differently than what I saw in the video, it only had VRCPlayerApi for the output, and nothing else, how do I get the variable you made? (Update): I rewatched and listened very closely, I definitely should've held ctrl while dragging the variable onto the udon graph, boy do I feel dumb.
@user_friendly_9388
@user_friendly_9388 2 жыл бұрын
Between this and the respawn teleport/death tutorial it's slowly becoming somewhat of an Enemy AI/Combat System thing. Nice job!
@PlayerBush001
@PlayerBush001 2 жыл бұрын
Thanks! I know combat is a much requested item, but (amongst other things) there is a lot to cover ^^
@user_friendly_9388
@user_friendly_9388 2 жыл бұрын
@@PlayerBush001 Yeah I told you before I'm trying to mimic it with Udon somehow, someday we will have a proper prefab for it that will be compatible with SDK3, but on the positive side, if you couple this with the death/respawn and use a looping animation for "guarding" an area, it will look pretty convincing.
@seko1102
@seko1102 Жыл бұрын
Thanks so much for this tutorial. Ended up dropping the get/set rotation nodes and used this for optimised dust effects in a larger level :)
@PlayerBush001
@PlayerBush001 Жыл бұрын
Nice! Glad this was useful ^^
@DragonFang17
@DragonFang17 9 күн бұрын
Dunno if this was asked already, but how would you make it so the thing following the player gradually follows them instead of instantly locking on like the camera in this video?
@PlayerBush001
@PlayerBush001 9 күн бұрын
'Vector3, lerp' and 'quaternion, lerp' with the current position and the target position. For the float value, give it a value of 0-60 * 'time, get deltaTime'. Have a look at my fog transition tutorial to see an example of using a lerp node Hope that helps ^^
@DragonFang17
@DragonFang17 9 күн бұрын
@@PlayerBush001 I'll have a look see on that. Thanks for the quick response!
@gamezman709
@gamezman709 Жыл бұрын
Thanks for the tutorial. For the item I'm trying to have follow the person, its meant to have them wear it like a belt. The only issue is that it doesn't change its height to the avatar, since its position and rotation is to the player and not whatever avatar they're wearing. Is there a way to change the height too so it scales to wherever the waist of an avatar is?
@PlayerBush001
@PlayerBush001 Жыл бұрын
You can get the position of a characters hips by replacing the 'playerApi, get position' node with a 'playerApi, get bonePosition' node instead, and select 'hips'. That being said, that will only work if the avatar has a hip bone, so it won't work for any non-humanoid avatars. In that case, you will probably just want to do an average of the player's head and origin position/ rotation. You can get that with a 'playerApi, get tracking data' --> 'playerApiTrackingData, get position' nodes (as seen briefly at 1:55). Just plug the two position values into a 'Vector3,lerp' node at 0.5, and do the same for the rotation, just with a 'quaterion, lerp' node. That will give an average value of the two, that can be plug in as the new position/ rotation Hope that helps ^^
@strogonoff7653
@strogonoff7653 Жыл бұрын
Is there any way to YOUR own avatar follow OTHER'S person avatar like a pet?
@cozyvrc
@cozyvrc Жыл бұрын
is there a way to have an object not move position but always rotate to look at re player?
@PlayerBush001
@PlayerBush001 Жыл бұрын
Yup, just swap the node 'transform, set position and rotation' with the node 'transform, look at'
@TravisSutton-w8h
@TravisSutton-w8h 2 ай бұрын
Thanks so much for another great tutorial! I am looking for a tutorial where a set of game objects are randomly assigned/dropped to predetermined spots across a map at the start of a game---do you happen to have a tutorial or know of one? Thanks much!
@CL3NRcProductions
@CL3NRcProductions Жыл бұрын
I wonder if i'll be able to make the object only follow the instance owner 🤔
@PlayerBush001
@PlayerBush001 Жыл бұрын
The second script will, by default, only follow the instance owner, as they are the default owner of all networked objects in the world. The only time they are not, is if you add something that changes the ownership of the object, like using the node 'networking, set owner' or the object sync's 'transfer ownership on collision' setting
@GoldenBoi_Fazbear
@GoldenBoi_Fazbear Жыл бұрын
is there a way to make a spectator system where there's a menu, and there's buttons to switch between each players views with cameras following them? so you would see what they're seeing, but it would be on a screen in a world kind of like how some game worlds have that kind of spectator system, like the among us world for example i just can't figure out how to make one
@PlayerBush001
@PlayerBush001 Жыл бұрын
In this video, I show how to make an object follow a player. The object follows the player set by the playerApi variable called 'localPlayer' in the first script, and 'targetPlayer' in the second script. To do what you want, you will need to set this playerApi to be the player you want to follow. As to how to do that, well... this is a little much to explain via text, so let me just give you some leads. First, you will want to get an array of all the players in the world, and this can be done with a 'playerApi, get players' node. You will need to give it a playerApi[ ] to use, that is larger than the players in your world. Feel free to check out my 'change how far a players voice travels' video to see a use case of this (kzbin.info/www/bejne/nnSuZKJ3fZyKgMk&lc=UgzVFjFGBDN0nCTUYdl4AaABAg). Then, you will need to have an int that says what player in that list you want to follow. You will want to add 1 to that int each time you click 'next player', to go through said array of players. You will also need to reset the int if it gets too large, which could be done with either a branch node, or an 'int, remainder' node. Alternatively, you could do the easier method of it just getting a random player each time you hit the button. Have a look at my "Get a Random Object from an Array" to see that (kzbin.info/www/bejne/mp7Xl6eIabmYnKs) As for seeing what they see, you will just need to put your camera in the position of their head tracking. Most people miss it, but I showcase how to follow a players head at timestamp 1:53 in this video Hope that helps ^^
@TinkyWinky_Tele
@TinkyWinky_Tele Жыл бұрын
how do i make it so if i wanted an icon or text on somebodies screen even if they look around that text or icon will still stay on screen unless disbaled?
@PlayerBush001
@PlayerBush001 Жыл бұрын
You'll want to make an object follow the players head. I show how to do this briefly at 0:54
@Endy323_Memes
@Endy323_Memes Жыл бұрын
I have one question, how could I target one player all times? I'm trying to make player trails for my friends and I and it works but it isn't networked. Any idea how to make it networked so other players see the trail on me or my friends?
@Endy323_Memes
@Endy323_Memes Жыл бұрын
Also wanted to say thank you as your videos are helped me out so much for making my world. I didn't even consider putting some things in my world because I never though about it but watching your tutorials had me put them in my world for moderation, fun, vip stuff, etc. Thanks again!
@PlayerBush001
@PlayerBush001 Жыл бұрын
Sorry for the late reply ^^' The first half of the video is how to make the object follow the local player, while the second half is how to make it follow a particular player in the world. To do what you are after, you will need to make an object for each player in the world. Then, you will need to somehow give an object to each player. This will depend a little on your use case, and how your world is designed. This gets a little complicated, as you'll need to turn off any objects not being used, and ensure there is only one per player. Cyan laser made an asset called 'cyan object pool' for this, and I would recommend having a look if your interested. A more manual way could also be done (with a button in the world that a player can click. And a script with a synced bool call 'isInUse' on each object), but that would be a little bit much to explain via text. Either way, the way the second script works, is that it follows the network owner of the object. You can become the owner of an object by using the node 'networking, set owner', and giving it the local player (networking, local player) and the object you want to become the owner of. The owner of an object is networked, so if you become the owner, others will also see you as the owner, and thus the object will follow you for all players. A little late and complicated, but I hope this helps ^^
@PlayerBush001
@PlayerBush001 Жыл бұрын
Glad to hear they are helping ^^
@Endy323_Memes
@Endy323_Memes Жыл бұрын
@@PlayerBush001 I see. Thank you for the help and I'll be sure to look at Cyan Laser's object pool. Can't wait for your next video!
@haeslet
@haeslet Жыл бұрын
I have an idea for a more complex script but I maybe over looking it in a way. I want to spawn an object in front of my player. So I have an invisible block to act as the spawner or I have the objects in front of the player to toggle on and such but I need them to stay put when the player actives it and such it there away to make it drop the item from player the moment it is active and such?
@PlayerBush001
@PlayerBush001 Жыл бұрын
Sorry, but I'm a little lost as to what exactly you are after, but here's my best guess. From what I can tell, you just want to spawn an object in front of the player when they enter a trigger right? To do so, you will want to use an object pool, like I showed in my card pack of cards video (kzbin.info/www/bejne/qWqZl558Z7Kml7s) but you will want to change the spawn position of the card to be in front of the player. You will need to change the 'spawn' position, so that instead of it being at a target transform, you will want it to be at the players position, + an offset (you will need to rotate that offset so that it is in relation of the player too). To calculate where it needs to be, you just need this: //getPublicOffset, rotate it by players rotation, add it to players position// "OffsetVariable' --> 'Quaternion, (Dropdown:Vector3) multiply (targetPlayerApi, get rotation)' --> 'vector3.addition (targetPlayerApi, get position)" hope that helps ^^
@mundiplaga4436
@mundiplaga4436 Жыл бұрын
You're a legend mate thank you
@kazzness
@kazzness 2 жыл бұрын
is there a way to take something like this where the object is a world object and you can attach said object to player or self? so the object hence follows you around, but if you no longer want it to you can take said object off or put said object on someone else?
@PlayerBush001
@PlayerBush001 2 жыл бұрын
I think the typical method would be to give each player a collider that follows them around, and if the pickup is inside said collider when the pickup was let go of, it would follow that collider. I would look into something like cyan lasers object pool prefab, that gives an object to each player, makes them the owner and I also believe makes it follow them around the scene too. Then you just need some logic on the pickup that when 'event, OnDrop' makes it check if it's in a collider or not, and follow it if so
@the_stray_cat
@the_stray_cat 21 күн бұрын
so i have this admen list and im trying to make a thing to set people on my admen list as the owner of the instance and specific objects. i got the thing to check if they are on the admin list but i cant figure out how to actually transfer ownership of the world to one of the admin
@PlayerBush001
@PlayerBush001 20 күн бұрын
This is a harder question to get working, as it depends on what kinda networking you need. If you don't need networking (like trying to make an icon float above the player's head) the best way to do this is to instantiate a new object for each vip player, give the script on that object a playerapi variable, set it to be the player to follow, and use that with this follower script. You will also need to scale the distance above the player, with 'playerapi, get player height in meters'. You will also need to delete them when the player leaves, which can be done by simply checking each frame if the playerapi is valid, and if not, deleting the object. If however you need networked variables to be stored on this object, then you can't instantiate them. instead, i would use cyan's player pool to give each player an object, and then when it gets a new owner, check if they are an admin. If they are, then you can enabled a child object that will follow them around. If not, disable it. So yea, they aren't the easiest thing to show, thus why there is no video on it. There was an asset for showing icons above player's head for like $10 or so, but I can't remember it's name :/ hope that helps ^^
@the_stray_cat
@the_stray_cat 20 күн бұрын
thanks! i get what you mean, thank you this actually helps!
@taco_boi
@taco_boi 7 ай бұрын
Hey, I've looked at all of your comments by now, and I can't seem to find a detailed answer on how it would be possible to track a players rotation on the "Y" axis I've seen it in other worlds but I can't figure it out, for example, lets say that we have a 2d grass sprite, how would it be possible for it to always look at the player if the player moves around, and I dont want that grass sprite to move anywhere up or down, just left and right.
@PlayerBush001
@PlayerBush001 7 ай бұрын
Unity uses quaternions for rotations, which is great as it avoids rotation loc, but it makes the math a lot harder to understand (I'm still working on it myself). For what you are after, it will be expensive if you do this with udon. You really want to do this with shader logic as it will be more effecent. However, let's say you are making a head rotate or something, then you would want to use udon. For this, you will want to get the 'transform. Position' of the obj. Then use a 'vector3. Subtract' with the position of the player. Then use a vector3, getx and getz, and put those into the x and z of a vector3,constructor node. Then use a quaternion, look rotation node, to generate a quaternion looking towards that coordinate. Finally, use a transform, set rotation, and give it out new rotation. Alternatively, you could subtract the two positions, use quaternion look rotation, use quaternion eulerangles and then vector3 get y to get the y rotation, and then put that into a vector3 constructor of only the y value, and put that into a quaternion euler to make it back into a rotation for our transform set rotation So yea, rotation stuff is fun... But I hope this helps ^^
@taco_boi
@taco_boi 7 ай бұрын
@@PlayerBush001 It didn't really work, I'm not sure if I set it up correctly or what, but what am I supposed to plug into the set rotation nodes arrow (the arrow above instance and value)
@taco_boi
@taco_boi 7 ай бұрын
I think I put setlocal player is that right? If so the objects I wanted moved are just staying at a set position (also the grass was an example, I'm using a 3d flower model)
@PlayerBush001
@PlayerBush001 7 ай бұрын
Yea, from your comment, you sound completely lost. Flowers pose the same problem as grass. If you have many objects with a script to turn the object, it will be rather expensive. You really want to be doing this with a shader; or more ideally, design the flower models to not need to face the player, or be okay with them copying the players head rotation. One method would be to either do the cross cross method where they don't turn, or if it's like a sunflower, make the head of the flower a separate object and make that rotate towards the player. Also, the arrow just says when it will play, so just link it up to an event that plays every frame. I have a video on how to change when a node plays, that goes all over how events and 'arrows' work
@taco_boi
@taco_boi 7 ай бұрын
@@PlayerBush001 alr, this sadly won't really help, but tysm for trying
@exorio32
@exorio32 2 жыл бұрын
if anyone was having issues with the code (like it always being at the feet) then just use the code at 1:57 add a getrotation and attach the local player to instance on tracking data
@exorio32
@exorio32 2 жыл бұрын
btw use the code at the part the coding is done for optimization reasons.
@PlayerBush001
@PlayerBush001 2 жыл бұрын
Thanks for pointing out that timestamp, as a bunch of people tend to miss it as it was only mentioned in passing. ^^ The 'player tracking data' can be used to track different tracking points, other than just the origin of the player. This means that you can attach something to the head of a player, or one of their hands (works for desktop players too). You can use the later code the same way, just replace the 'playerApi, get position' node with the two trackingdata nodes shown at 1:57
@exorio32
@exorio32 2 жыл бұрын
@@PlayerBush001 thanks for replying dude, really like ur tutorials, since i have no idea what im doing with udon usually, but with ur tutorials i have a small idea of how to use it now!
@zoey_wicker
@zoey_wicker 2 жыл бұрын
does this automatically change its height dependent on the avatar you're using?
@PlayerBush001
@PlayerBush001 2 жыл бұрын
no, as the object is just referencing the avatar's origin point location, which is located at the player's feet. That being said, if you were to instead replace the 'playerApi, get position' part, with a 'playerApi, trackingData(head)' --> 'playerApiTrackingData, get position' node, you could make it reference the head of the player instead of their origin point
@zoey_wicker
@zoey_wicker 2 жыл бұрын
this is SUPPEERRRR helpful! now i can use a crown that follows the instance master :D thanks sooooo much for this
@PlayerBush001
@PlayerBush001 2 жыл бұрын
Happy to help ^^
@ucantguardo
@ucantguardo 2 жыл бұрын
@@PlayerBush001 can you do a more in depth video on crowns for instance masters or such
@PlayerBush001
@PlayerBush001 2 жыл бұрын
hmm... there's really not much to add to this script for that. The owner of an object will default to the instance owner, unless you define it otherwise. The only difference would be to swap out the 'playerApi, get position' node with a 'playerApi, Get tracking data (head) -->> 'playerApiTrackingData, get position' nodes, to better scale the crowns position to the head (as I showed as a comment midway on this tutorial). Funnily enough, I have a tutorial planned that's part of a series that will do this.. Out of curiosity, what exactly would you like to see me go more in depth with?
@Mad-Worx
@Mad-Worx 2 ай бұрын
@@PlayerBush001 genuinely wondering if you could have a whitelist of tags for admins and or staff or for patreons to have an indicator above their heads when they join
@rodrigopower11
@rodrigopower11 3 ай бұрын
Question here: What about an object like "NPC" roaming free in the World? How it would work?
@PlayerBush001
@PlayerBush001 3 ай бұрын
It would be done differently. Centauri did a really good talk at tlx about how to make ai's in vrchat. they also had a prefab to go with it with some examples ^^ kzbin.info/www/bejne/roe7iYZtfb1qhcksi=88P8svOFO0Rkqy6V
@rodrigopower11
@rodrigopower11 3 ай бұрын
@@PlayerBush001 Thank you once again Bush!
@RainbowiaPS3
@RainbowiaPS3 Ай бұрын
there is no download for this, I need it so i can edit it to work >:(
@JessyUwU
@JessyUwU Жыл бұрын
sry for asking but idk why, i can not this Udon skript Build & Publish. I can only Try it with try build on VRC. thats my fail code waht i become: "Exception Message: An exception occurred during EXTERN to 'VRCSDKBaseVRCPlayerApi.__GetPosition__UnityEngineVector3'. Parameter Addresses: 0x00000003, 0x00000001 "
@PlayerBush001
@PlayerBush001 Жыл бұрын
sorry, but the only advice I can give is to reinstall the sdk, and make sure everything is up to date. If you need some more detailed advice, I would recommend asking in the official vrchat discord, where you can post images that will greatly help the debug process
@TrayceInSpace
@TrayceInSpace Жыл бұрын
@@PlayerBush001 Funny enough I encountered the same problem and came to this video to double check and make sure I wasn't crazy. It actually works perfectly fine in game. I installed the VRWorld toolkit debugger to see if it could find anything, and it recommended me to turn off Error Pause, which has a simple "auto-fix" button in the toolkit. Idk why this has happened, maybe SDK update or the VRChat CC and the new sdk import system being funky, but turn off Error Pause and it should let you build. I had 2 scripts in a world cause this problem with uploading that otherwise worked perfectly fine with build and test. I disabled that function an it let me build and all the features worked fine. This is also the case with some prefabs that work fine in build and test but don't let you build and publish.
@PlayerBush001
@PlayerBush001 Жыл бұрын
​@@TrayceInSpace oh... so that explains it. There was just the Error Pause, and they didn't unpause the game. Yea, the reason the error message occurs, is because the script is set to follow the owner's playerApi; but when you go and build and test, the editor doesn't simulate a player so there is no playerApi to call; therefore the script crashes. As for Error pause, I noticed it was a thing about 3-4 months ago (probably with the companion app), and it's saved soooo much time trouble shooting. It's a god send when you are spamming the console with debug messages, and it just pauses when the error occurs. Also means you know where exactly the object was and so fourth. Super useful, but it does have the downside when it comes to the build and test menu I'll have to keep in mind this error for the future, as this does seem like something that could throw off some beginners. Thanks for sharing ^^
@TrayceInSpace
@TrayceInSpace Жыл бұрын
@@PlayerBush001 Yeah! In this case the guess I had that led me here was that VRChat's client sim works fine when you play in unity by just hitting play, but when it runs the scene for publishing, it probably doesn't run the client sim and therefore has nothing to call back to and spits out an error for an otherwise functioning script. Perhaps something to point out to the VRC devs if it turns out to be an oversight on their end.
@PlayerBush001
@PlayerBush001 Жыл бұрын
@@TrayceInSpace yea, that is exactly what is going on. The thing is, you don't really want client sim running, as it would add an ugly sphere to your screenshot, so it would likely cause more pain then good. It for sure isn't a priory, given all the other things requested...
@RainbowiaPS3
@RainbowiaPS3 Ай бұрын
why get local players connected to two different stuff why cant it just be the follower tweaker from littlebigplanet 2
@PlayerBush001
@PlayerBush001 Ай бұрын
@@RainbowiaPS3 bacause if they added a node for every combination of things you want to do, then there would be so many nodes that it would take ages to search through. Sure that might be better in this particular case, but depending on what you are doing, you can modify any of the values to fit. You can add a bonus offset to the vector position value to offset it's location, replace the rotation with its own to create a compass of sorts, replace the rotation with one that points it towards a particular object, or just replace both values with a world object's pos & rot to teleport the object. The more powerful the system the more modular it needs to be. The cost however, is that it makes the basics a little bit more tedious (would be nice if they provided a bunch of general scripts though)
@zijingzzz717
@zijingzzz717 Жыл бұрын
Thank you for the tutorial! I have a trouble that when player keeps moving for a while (about 5 to 10 meters away from initial position) the object I set to follow will disappear. Any idea how to fix this?
@PlayerBush001
@PlayerBush001 Жыл бұрын
That is... strange to say the least. Dunno what might be causing it, but... within the 5-10 meter radius, is it following correctly? If the player walks 3m on the x axis, will it also move 3m on the x axis? If not, then you are likely just moving it based on 'localPosition' instead of 'position' (world position). That's all I can think might be going wrong tbh. I would ask on the vrchat discord under 'udon-questions', as there are plenty of people willing to help, and it is a lot easier to bug fix there than in YT comments
@zijingzzz717
@zijingzzz717 Жыл бұрын
@@PlayerBush001 It follows the position and direction perfectly before disappearing. Thanks for suggestions!
@NormalBen20
@NormalBen20 2 ай бұрын
this helps me a lot, thanks, but how do I make it so that only the instance owner can see the camera, but other random players can activate or deactivate the camera with a button?
@PlayerBush001
@PlayerBush001 2 ай бұрын
@@NormalBen20 have the camera be a child of the player follower script. Then on the script, have two variables: a gameobject called 'camera' and a bool called 'is active' Create a custom event called 'updateCamActive'. Put a 'networked, isInstanceOwner'(?) bool and the 'isActive' variable into a 'boolean, conditional or' node; then put that node into a 'gameobject, set active' node. For that gameobject, set active node, plug our event into the arrow slot, and our camera variable into the instance slot. Now we have an event to call, we want to create the events: 'event, on enable' & 'event, on ownershipChanged', and plug them into an 'udonBehaviour, send custom event (updateCamActive)' node. Then create a custom event called 'toggleIsActive'. This event will be what you call from a button in your world to toggle the camera on and off. For this, you simply need to create the nodes: 'isActive' --> 'boolean, unary negation' --> 'set isActive'; to toggle the bool. Then plug the arrow from our toggle is active event into our 'set is active' node, and then plug it into an 'udonBehaviour, send custom event (updateCamActive)' node. So hopefully that helps. If you need any help, feel free to join the discord and ask there; as there you'll be able to add pictures that help us know where you went wrong. Good luck ^^
@NormalBen20
@NormalBen20 2 ай бұрын
@@PlayerBush001 I will thank u so much
@강한남자정두형
@강한남자정두형 Жыл бұрын
pz I would like to tag individual players and apply them. May I know?
@PlayerBush001
@PlayerBush001 Жыл бұрын
Hmm... This unfortunately isnt completely straightforward, but here is how I would do it. First we need a way to store whether or not a player is tagged. Create an empty, and give it a script with a public bool called 'isTagged'. Then we need a way to tell everyone playing, who is tagged and who is not. Get the asset player object pool from cyanlaser, and this will give us an object per player. However, we don't want to rely on this to hold information, as the owner of these objects can change; hense why I stored our 'isTagged' state locally on a different object. We want to give each object a capsule trigger, and this will be the players hitbox. Also give it a kenematic rigidbody, so that physics calls can be made. Then, have a script on each object that contains a synced bool, and get it to sync up with out local 'isTagged' bool. We then want it to follow the player, much like my player follower script, but instead of changing its position via its transform, we want to instead doing it via the rigidbody (_insertNameHere). We then want to create an event 'Tagged', and this event will changed both your synced bool and 'isTagged' bool to true, when called. Then, create the event 'onTriggerEnter', check if your a Tagger, and if so, get its script with 'gameobject, (type) get component (type udon behaviour), put it through an' isValid' node to check if it has one, and then tell it to play the owner to play the event "Tagged" with an 'udon behaviour, send custom networked event (otherScript, owner, Tagged )'. Once you have that, then you just want to create another event called "reset", that makes the bools = false, so you can play the game again. Just create a button that cycles through all the objects, calling that event. This is a little complicated, but I hope this helps ^^
@adamiksgaming9935
@adamiksgaming9935 2 жыл бұрын
Could you make a video on Udon Graph Graph and audio/sound- I would love to make amplify peoples voice when they stand on stage
@PlayerBush001
@PlayerBush001 2 жыл бұрын
Unfortunately I'm a little backed up right now, but this is definitely something I want to cover! ^^ You might want to check out github.com/Guribo/BetterAudio . Although I've never used it, I've heard it has stuff for 'voice amplification in area' and such
@adamiksgaming9935
@adamiksgaming9935 2 жыл бұрын
@@PlayerBush001 Thank you so much for your time.
@yukiinkmaker
@yukiinkmaker Жыл бұрын
How i can make the owner change when the object is clicked ? so the object follow the player ho click the object
@PlayerBush001
@PlayerBush001 Жыл бұрын
Can you read cryptic? If so, it would be done: "event, interact' --> 'networking, set Owner (___, (networking, get local Player))" That being said, if you are already wanting to pickup the object, then you won't need this. Whenever someone picks up an object with a pickup component on it, they become the owner.
@yukiinkmaker
@yukiinkmaker Жыл бұрын
@@PlayerBush001 ok all work but it still assing the master of the room as owner of all object, can i change that so when the object it pickup, start following the player who pickup the object and disable thieft?
@PlayerBush001
@PlayerBush001 Жыл бұрын
@@yukiinkmaker the owner of an object is the person who is responsible for its synced variables, including position if you have a vrc objects sync component on it. So, you cant just not have an owner. Therefore, you need to store whether or not it has been picked up. Hopefully this isn't too hard to get across via text, but to do so.. Create a synced bool called 'isFollowing'. Then on 'event, pickup' (or interact if it's not a pickup), make this bool true (or flip its value with 'boolean, unary negation' to make it a toggle) Then (and this is where I may loose you) you want to account for people leaving and respawning, by making the bool false when that happens. To do this, you will want to create: "event, onPlayerRespawn' -(playerApi)-> 'playerApi, equals(, (networking, get Owner))' -(bool)-> 'branch' -(true)-> 'set isFollowing (false)" dropping the object if the owner of the object respawned. You will also want to do the same chunk of coding for the 'event, on player left', to account for those that left the game; otherwise their object will start following the instance owner. Then, on the update event itself, right after the 'event, interact' node, you want to add a branch node that checks of the bool 'isFollowing' is true. This is because if it's not true, we don't want this object following the owner. So yeah, hopefully that wasn't tooo hard to follow, but that's how I would do it. Feel free to ask on the official vrchat discord under the 'udon-questions' channel for more help if you're getting stuck; as you can easily post pictures there which makes it easy for others to debug your code. Hope that helps ^^
@dovahkiinjello
@dovahkiinjello 6 ай бұрын
how can i set this to clone itself and give object to all players?
@PlayerBush001
@PlayerBush001 6 ай бұрын
You could, but nothing on it could be synced. I would recommend using cyan's player object pool prefab to give an object to all players, and then make this a part of that
@aogmaxiaogmaxi1090
@aogmaxiaogmaxi1090 5 күн бұрын
Hwo Can i Make A object For All My PLayers in the so everyone has the same object
@PlayerBush001
@PlayerBush001 5 күн бұрын
@@aogmaxiaogmaxi1090 if you want to give an object to every player, then you will want to use cyan's player pool asset. My latest video covers how to use that asset ^^
@adamiksgaming9935
@adamiksgaming9935 2 жыл бұрын
Amazing thank you so much!! as always well done!
@PlayerBush001
@PlayerBush001 2 жыл бұрын
Thanks! ^^
@alwaysyouramanda
@alwaysyouramanda Жыл бұрын
I’ve been searching all over to figure out why my particles look fine in unity, but on the avatar they’re way offset
@PlayerBush001
@PlayerBush001 Жыл бұрын
hmm... depends on how it's offset. If you are using a particle system on an avatar, it could be a range of things. Usually it's a problem with what object it is parented to. Anymore than that, and I would recommend asking on VRChat's official discord. If however you are using this script shown here, and you have a smaller particle system that needs to be closer to the head, then you will need to change it's target. Instead of using 'playerApi, get position', you will want to use 'playerApi, get tracking data (head)' --> 'playerApiTrackingData, get position" instead (as shown briefly at 1:54). This will get the player's head position, instead of the player's origin position, which may better suit your needs Hope that helps ^^
@nanabosho
@nanabosho 2 жыл бұрын
is there a way to do this in an avatar system via avatar dynamics?
@PlayerBush001
@PlayerBush001 2 жыл бұрын
Don't think so, as they would ruin a lot of udon maps. The best you could do is have your character go invisible, and leave a dummy where you were. Then you make your avatar appear, and the dummy disappear, and you have 'teleported'. Seen that version done a bunch
@andrews4208
@andrews4208 Жыл бұрын
I would like to know that as well. because I remember watching a Lolathon video and he attached something to another player and it followed them around.
@SugarSergio
@SugarSergio Жыл бұрын
I would defiantly, love a similar tutorial just like this but making an NPC Head track the player when they go close to the NPC, as there ain't any simple tutorials atm.
@SugarSergio
@SugarSergio Жыл бұрын
And could do this aswell with any Object too
@PlayerBush001
@PlayerBush001 Жыл бұрын
you can use a 'transform, lookAt' node to rotate an object to look towards another one. Simply do that every frame with an 'event, update' node, and you'll be sorted. The problem with this node however, is that you can't set the maximum rotation. to do so is a little harder to explain and work out, and so it's been more on the back burner for me. There is also the node 'quaternion, lookToFrom' that can be used to get the raw rotation, but quaternions are a beast to work with for beginners, so there is no easy explanation unfortunately
@KimionTM
@KimionTM 8 ай бұрын
@@PlayerBush001 That doesn't really work. At least it doesn't allow me to rotate just the head. I can only rotate the whole body
@PlayerBush001
@PlayerBush001 8 ай бұрын
@@KimionTM I am assuming you have a model with a head bone, or the head itself is a different object. This code would go on the head bone or head object, to only move it
@EmM-ko7mu
@EmM-ko7mu 2 жыл бұрын
How can make an object follow a path/orbit and not the player?
@PlayerBush001
@PlayerBush001 2 жыл бұрын
You want to use cinema machine for this. Create a cinema path for your object to travel, and then create another object with a dolly on it. Then just set its speed and the object will follow that path, at that selected speed Might make a video going over this in more detail in the future, but I hope this helps ^^
@tgrimes776
@tgrimes776 Жыл бұрын
Thank you so much for this youre amazing! Is there a way to make it where once the object is toggled to follow a player, that persons item that is following is visible to all players? For example, I made an item that follows you after you toggle it, I would like that item to be seen by users who have not used the toggle yet, and they can then in turn use the toggle and have their own object seen by all... If that makes sense?
@tgrimes776
@tgrimes776 Жыл бұрын
Or maybe a way to set it to the person who toggles is considered Owner or something like that maybe..? and have multiple people with the same object following
@PlayerBush001
@PlayerBush001 Жыл бұрын
not entirely sure as to what you mean, but you can use the node 'networking, set owner', to set who is the owner of an object. an example of using it would be: "event, interact' --> 'networking, set owner ("networking, localPlayer")" Which would make the local player (the person who clicked it) the owner of the object, whenever they click the object Hope that helps somewhat... ^^
@StevenRamonFilms
@StevenRamonFilms 9 ай бұрын
Thanks! So, even though a player would be set as the owner of the object by selecting it, this could also mean other players who select it before or after have their own little instance of ownership? I have a similar tasks like the OP. I am trying to create name / status plates that float over a player's head. For example: Do not disturb. @@PlayerBush001
@PlayerBush001
@PlayerBush001 9 ай бұрын
Hmm.. Not quite? Let's start from the top: Vrchats networking works in a master - salve system. Whoever is the owner of the object, overrides and dictates what the synced values are. If someone who is not the owner tries to change one of those values, it gets ignored and overriden. Vrchat gives an owner to all objects, and this syncs for all players. If you're not the owner, you can become the owner with 'networking, get local Player' --> 'networking, set owner'. When others see there is a new owner, they will update all their synced values to match that of the new owner. Now, this code is slightly different, in that where are using the fact that vrchat gives an owner to all object, to know what player to follow. However we could create a synced bool, to store whether it is visable, and then update the object's 'set active', when the bool changes. Many of my other example videos cover synced values, so go check some of them out. Like my initial reply to the OP, I would make it happen when clicked. However, now with that out of the way, for your task in particular, you may want to instead use the prefab 'cyan object pool', that gives an object to each player. Then, all you would need is a synced int to say what status each player is, and get the code/animator to hide/show/change the player's status symbol. Would be how I would look at doing it Hope that helps ^^
@necatron73
@necatron73 2 жыл бұрын
You so need to update this to include an animated model as a companion script
@PlayerBush001
@PlayerBush001 2 жыл бұрын
Hmm... this script wouldn't actually be good for a companion script. I used the word 'follower' in the context of 'sticking' to the player, instead of 'walking' or 'moving towards' the player, as you are unable to actually 'stick' anything to the player; so using that word would be miss leading. If you want an object to follow the player as a companion (or a monster chase after you for that mater), you would instead want to use an ai script, which would be a completely different method. I do intend to cover this at some point, but I've yet to need it for any of my projects, so I haven't looked into it much yet. Like I mentioned in another comment on this video, I would recommend the TLX talk on ai's if you want to look into this more
@necatron73
@necatron73 2 жыл бұрын
@@PlayerBush001 any chance we can get a ragdoll tutorial? Ive been trying to make ragdolls you can pick up but they either freak out or start spinning uncontrollable.
@PlayerBush001
@PlayerBush001 2 жыл бұрын
@@necatron73 probably not, as it doesn't really have any uses outside of your use-case. This would probably be better asked in either 'udon-questions' or 'world-Development' in the official vrchat discord, where someone can better debug any problems you're having
@necatron73
@necatron73 2 жыл бұрын
@@PlayerBush001 i managed to solve it last night using empty game objects linked to the the collider of a body o Part using the exact grip method in the vrc pick up. Works great
@EwanCodeTalker
@EwanCodeTalker 2 жыл бұрын
@RainbowiaPS3
@RainbowiaPS3 Ай бұрын
1:22 oh the torture and the nonsense
@adamiksgaming9935
@adamiksgaming9935 2 жыл бұрын
Hey its me again your most annoying fan XD how would I make an object look at a player ? And how can we make an object also chase a player a bit different from follow
@PlayerBush001
@PlayerBush001 2 жыл бұрын
Haha! not at all! To make an object look towards another object/ player, you can use the node 'quaternion, lookAt'. Give it the object's position, target's position; and then define the up direction with a vector3.up node, and then you will get the rotation you need for the object. so, just plug the resulting quaternion into a 'transform, set rotation' node As for the object chasing the player, you are very quickly running into ai stuff, and would be better off using an ai script. If you want to avoid that however, perhaps keeping a log of the players previous positions with a vector3 array, you could make the object follow the path of the player; which could be cool. If however that is not what your after, I would seriously look into using a 3d ai script. Centauri did a really cool talk on AI's at TLX, and I would highly recommend giving it a watch: kzbin.info/www/bejne/roe7iYZtfb1qhck They also released a prefab called 'SimpleAi', that apparently contains a bunch of example scripts to get you started: github.com/Centauri2442/SimpleAI (Though, just a disclaimer, I've only watched the video, and haven't done anything that uses ai yet, so this is as much as I know) Hope this helps ^^
@silasmair4090
@silasmair4090 2 жыл бұрын
it doesnt work in my map
@PlayerBush001
@PlayerBush001 2 жыл бұрын
Okay? How is it not working?
@silasmair4090
@silasmair4090 2 жыл бұрын
@@PlayerBush001 the object does not stick to the player
@PlayerBush001
@PlayerBush001 2 жыл бұрын
@@silasmair4090 honestly, I'm a little lost as to how to help, as it is a rather small script. So... this is most probably a super dumb questions but: did you add the script to your obj? Otherwise, perhaps try and just plug that 'networking, get local player' directly into the 'playerApi, get position' and 'playerApi, get rotation' nodes, and see if bypassing the local player variable gives you more success. Other than that, perhaps ask on the #udon-questions channel on the official VRChat discord, as there you can post images that really help debug problems like this, when someone is very lost
@batatrax01
@batatrax01 Жыл бұрын
Trop rapide pour moi je n'arrive pas à suivre les explications, merci pour ceux dont la langue anglaise n'est pas maternelle !
@PlayerBush001
@PlayerBush001 Жыл бұрын
There has been some native speakers that struggle with my tutorial speed, but I get bored if I speak slower ^^' Glad you were still able to follow along ^^
@vinculprit5175
@vinculprit5175 2 жыл бұрын
MMMMM particles
@PlayerBush001
@PlayerBush001 2 жыл бұрын
mMMmmm.... delicious
Create an Automatic Door - Udon / VRChat SDK3.0
17:00
PlayerBush001
Рет қаралды 7 М.
Exploring Forgotten Minecraft Servers 2
58:08
Redlyne
Рет қаралды 342 М.
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 31 МЛН
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 85 МЛН
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 112 МЛН
小路飞嫁祸姐姐搞破坏 #路飞#海贼王
00:45
路飞与唐舞桐
Рет қаралды 29 МЛН
Create an Admin / VIP Only Room - Udon / VRChat SDK3.0
6:35
PlayerBush001
Рет қаралды 12 М.
6 Years of Learning Game Development
17:20
Cobra Code
Рет қаралды 162 М.
How to Teleport a Player - Udon / VRChat SDK3.0
4:02
PlayerBush001
Рет қаралды 34 М.
How to Optimize your VRChat World INSTANTLY
6:34
Dorktoast
Рет қаралды 13 М.
How To Make Snow Particles - VRChat Udon 2023
7:43
myneighborswifi
Рет қаралды 208
What size should your assets be? | HD 2D GAME ART
12:10
Nonsensical 2D
Рет қаралды 134 М.
I Optimised My Game Engine Up To 12000 FPS
11:58
Vercidium
Рет қаралды 699 М.
How to Toggle ANYTHING (almost) in Udon! - Udon101 - VRChat SDK3.0
19:40
Animated Doors (Global & Local) Udon Tutorial (ENG)
12:57
KireNeko
Рет қаралды 10 М.
I made Games with Python for 10 Years...
28:52
DaFluffyPotato
Рет қаралды 349 М.
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 31 МЛН