Unity First-Person Controller Part 1 - FPS Beginner Tutorial C# | Bolt(Visual Scripting)
Вставка
- Опубліковано 6 лип 2024
- Explain and show how to add player controls to your Unity game.
New Input System: • How to Use New Unity I...
Part 2: • First-Person Controlle...
Support us: / smartpenguins
Discord: / discord
#Unity #CSharp #Bolt #gamedev #tutorials #nocode
Music: www.orchestralis.net Fantasy Chamber Adventure - Навчання та стиль
damn you're amazing, so glad i found you, there are literally no helpful unity tutorials out there except from you, keep up the amazing work
Very cool, thank you for making this video. I love seeing both Bolt and C# implementations. Stay safe!
This is exactly the video I have been looking for, I have been learning C# but I’m crazy slow at it. Some days I’ll make a ton of progress and then I’ll spend 3 days trying to add a scoring system. I decided to try visual scripting and it was way more confusing to me. I have been trying to find a video that would help me see the the similarities side by side. Thank you so much amazing video man, keep up the work!
Thank you for making this video, I've watched it sooooo many times and now I'm done with Visual Scripting and moving on to C#. Your videos where you show how to make something in Visual Scripting and then in C# are really helping me learn C# from already knowing VS, every time I watch a series on how to code in C#, I end up getting so board because they usually start from the very beginning and they start explaining how to use the components and materials and all of the basic Unity stuff that I already know, your videos are the only ones that are helping me, thank you.
2 Minutes in and I've already made more progress than 2 Days worth of other tutorials! TYSM!!!
This is an amazing tutorial! thank you so much, your just what ive been looking for
I think the parallel Visual and c# is useful actually. Keep it up!
They are super useful for people going from Visual Scripting to C# because every other C# tutorial series starts off by showing the basics of Unity that we all already know. I was unable to find any other tutorials for people who already know Visual Scripting and are going to C#
Nice one :) Best tutorials on Bolt. Thanks SP
Very rarely tutorials , thank u
Hi, thank you! I ak stuck “hold grab ledge”. Do you know a bolt tutorial about it? Thank you
So I've followed your tutorial to the letter and at about 9:11 the code breaks for me. Works identical to yours until that point. Could setting your GetVariable to null have something to do with it?
Thank you! Thank You! Thank you! the best person to explain this by far
Useful tutorial, thank you very much sir.
Oh man where have you been ? A tutorial after this much time, but video is good 😁
thaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaank youuuuuuuuu i was waiting for this exact vid u just earned a sub
same
Brilliant. Cheers mate!
I love your content! How would you make a projectile aim where your camera is?
for velocity use the Camera's transform forward
all good but on visual script when i add, add onto multiply there is no a+b on either of the adds and ican only move up and down the left and right it just cancelled out
I have a question I have that if I hit a wall and I'm moving then my caracter automatis starts spinning can you help me?
when i used exact code it is opasite of what it says it go's up when going down with mouse and go's down when going up with mouse. it is inverted
I got sooo much errors but it still worked at the end :)
I tried it went pretty well but at the end the movement left to right was working but top to bottom is not working
Not sure if this will cause issues down the road but the "Get" and "Set" variable for the angle in the guide was set to "graph" but for some reason it wouldn't let me look up or down eventually after trying a bunch of other stuff I set them to "object" which gave it a "self" option and it works fine now with the clamps and all, I don't know if I missed something and I'm new to this so if anyone knows of problems this may cause please let me know, Thanks for the tutorial.
i did set it to object but im still facing this problem i tried doing it with many other nodes and in my own way but not working
i dont have in select transform the main camera
My horizontal works fine but every time I try to test verticals I get variable now found: angle
Why don’t you use super units to organize and save space?
I wonder if there is a way, where I can limit the Player Character from (viewing) spinning 360 degrees around on the vertical? The 'look UP/Down' limits how far the Player Character can "crane its neck". I would like to limit the 'side to side' horizonal limit too! Say to 180 degrees back and forth, but not spinning his head right around.
He shows how to limit that in this video
Thank you very much for your tutorial, however I am noticing that when looking up and down they fit for a more "Inverted" type of control. Is there a way to change this?
I would assume change 1 the 1 to a -1
@@munch15a that makes sense
Love it!
Please make a raycast on a dot of the middle camera so it can interact with things like pick up a carrot.
The set up that i had for the object clicking still works, right now the raycast is in the middle(the cursor.locked locks the mouse at the center of the camera). I just had to add the dot in the middle to show that visually. I did that in part 2, it should be up Monday.
@@SmartPenguinsGreat!
@@SmartPenguins how do you get vector3
sad, bolt does not show up for me, i downloaded it but when i try to use it it does not work
Okey, if after doing all the steps your character keeps flying or the camera just moves from right to left , I have 2 tips. First, make sure that you are programming the player (the empty object where you attached the capsule and the camera). Second, I noticed that when I put the "set/get GRAPIHC variable" of the variable angle, it didn't work, so I had to change it to "OBJECT variable" instead of "graphic variable". Hope it helps
Thanks bro
why would we ad variable 'angle' to axis?
i have the exact same units and variables for the mouse y axis to look up and down but it doesent work, and how is the player not falling through the ground withou
t a collider?
nvm figuered it out
Thanks for sharing this!
My camera is really bugged:some times i move the mouse a lot and in the game it moves by nothing, it moves non precize and some. Times it has 0.1 sec delay and the other it has 2/3 seconds delay. How can i fix it?
Send me a screenshot of your graph to my Discord server
When i right click in the graph, it shows "player" and "variables", nothing else. Whats wrong??
But how to hardware independent if we are not using time. Delta time, should it would used in quaterion. Lerp instead?
Like I explained at here 4:39, you are not suppose to use Delta time with Get Axis Mouse X/Y because it returns the change in position between frames, meaning the same movement speed of the mouse will show 10 at 60FPS and 20 at 30FPS out of Get Axis Mouse X/Y. You can think of it as delta time is multiplied already. Get Axis Horizontal/Vertical doesn't work that way. Now you can use Lerp if you want to smooth/delay mouse movement.
I Might be bit early to say this but your a legend
What a legend tbh
Tried to add player child camera to rotate (06:51) but when I do there are no assets to choose from in the search box and there is no no scene tab . What am I doing wrong?
You must have an embed graph :)
When I go to self and I want to put CAMERA, I can't find any game object. What I do, I can't look up and down. Please respond to me.
Check this video out to understand what is going on. ua-cam.com/video/GPFjdAkjf9c/v-deo.html
if u cant find it than make a separate flow for camera .
I am big fan u
I am from India ❤️
You very good at learning + hope with out muisc as the music at. the last of video❤
Hello! i have a question. Can i somehow select only one rigidbody to work with OnCollision(event). I mean like if i have a 2 rigidbody on my character i want only one to work with trigger collision. Is this possible?
I think you would want to have more then one colliders not rigidbodies. There are several ways you can do it, you can attach another collider on the child and listen for triggers there.
@@SmartPenguins So that means i don’t need to have for example 2 Rigidbodys but 1? Yes, and is there any possibility to select gameobject to interact with OnTrigger event?
It wouldnt let me move the camera left and right all it did was up and down
Great video thanks🏆🏆🏆🏆
You have all these different pop-ups/suggestions when you write code (for example, transform) but i don't. What am i doing wrong?
you probably need to do this ua-cam.com/video/aH3yTOEq-gg/v-deo.html
@@SmartPenguins That worked, thank you so much
Im having a problem where my player is rotating around a certain point and moving across the ground when looking left/right, any fixes? I copied the code exactly
Edit: Fixed it make sure your capsule and camera are at zero X and Z values
hey im not able to group the elements in the flowchart, says "multi element editing is not supported", what should I do?
Not really sure what is going on, to group you hold Ctrl and Click drag the mouse
@@SmartPenguins Oh I was dragging it without holding ctrl, thanks it worked.
I can't find the same Quaternion module you had. My version of visual (2021) has different types. Is there a new equivalent.
just look for Quaternion Euler
@@SmartPenguins I think I found it thank you! I had the wrong "vector 3" With the new system it's now "create vector 3"
@@AndrewMaksymBrainNectar It depends if you use programming naming or human naming. The default is human naming, which is what I usually use, but in this video, I used programing naming so that is why some of the unit names are different.
I was able to turn right and left but when I did the up and down now I can't rotate but I can look up and down?
same
@@vrdevman2785 working my way though the comments half a dozen have that issue including me
amazing man
7th "beginner" tutorial i've followed...
one question, in human naming what is new vector 3 called?
create instead of new
how did you access the main camera (i know you said you can because of an imbedded graph but what is that exactly and how)
edit: never mind im dumb and didnt listen to you
bruh tell me how, dont just say nevermind xd
EDIT: When you add a Flow Machine to the Player Object, make sure that the Flow Machine is "Embed" and not "Macro".
This is AWESOME, but i have a question. How do you make yourself not fall over?
freeze Z rotation in rigidbody
@@SmartPenguins Thanks a lot!
6:49 it just says nothing I can’t find it help edit: i don’t have a list
Very good bro
Question. Is there a way to limit the main camera from spinning/ turning around in 360? I am thinking of a feature, like the character player neck, head and spine. It can't twist right around. Going for realism. The neck can only look up so high, and low; right? Same with the Left to Right. Can I limit the amount of side to side.
He shows how to do that in the middle of this video
My up down movement is reversed when i go up it goes down vice versa pls help
same
for some reason the side look doesnt seem to work when the up and down look is working it's flowing but not turning left to right
could you solve it man
@@ekinarca8689 idk i followed the video and did the exact same stuff i even tried to do it in another way but it just disabled the vertical view
@@ZeroDiamond did u solve it
@@KapganBeg i honestly cannot remember its been a while sorry
@@ZeroDiamond anyway, no need. thanks though
They already have one of those in assets so I'm going to drag it over.
thanks bro, you have really help me
but I can't find (scene) part to choose the camera for the vertical rotation, just (assets) part
please Any Body help
Like me
Check this video out to understand what is going on. ua-cam.com/video/GPFjdAkjf9c/v-deo.html
@@SmartPenguins thank you bro, I've fix it
but I have another problem in the mathF.Clamp angle because the angle is switching Automatically between my values that I set every frame
,this problem was happened when I was using the Scripts
and I don't know how can I fix it
so please help me in my issue because I'm tired of trying to fix it
Not sure what you mean by "angle is switching Automatically between my values"
thank you I've fix it
It was happening because I was inverting between the min value and the maximum value
but when I move the mouse up the player is looking down and when I look down he is looking up " inverted"
Edit, I've fix it and thank you for your interest
The mouse lock isn’t working for me, can anyone help me?
15 minute tutorial only took me 1 hour and 30 minutes to finish (not your fault tutorial was great but i decided to make the sensitivity a float variable and didnt know how to make it negative)
I'm getting a variable error saying variable not found: 'angle' The error is at the Get 'angle' variable graph. Everything seems hooked up right. It matches your example.
Make sure you add it, just like I did here ua-cam.com/video/KsMUhUlNuho/v-deo.html
Never mind, I got it. I forgot to make it a Float, and name the Variable 'angle'.
In my flow graph when I go to add unit, I can’t find “New Vector 3”, please help me
It can called Create Vector 3
@@SmartPenguins thx man
@@SmartPenguins thank u
Hey there’s no such thing as a vector 3 new as far as I can find in bolt what’s the new name of it?
It's just vecter 3
when I press self to change it to camera it doesn't show up and when I press reveal hidden package it still doesn't show up
me too
same how to fix that ?
@@DXDgamingsubnow There is another comment that has a fix
fixed
How come it dosnt show my camera as an option when I am in transform?
Go to the inspector and then go down to flow graph and click on the convert button, then try, if it still doesn’t work then click on the drop down menu next to the convert button and set it to embed and if it still doesn’t work, set it to embed and then click on convert
hey,could you please help me,when i search new vector 3 nothing appears
Look for vector 3, I'm using programming naming here so the unit names will be a little different then for human naming that you probably use.
I need help because on the part where you rotate your characters camera up and down it said all of my assets were “none” please help.
Lake me
Go to the inspector and then go down to your flow graph and all you have to do is click on the convert button once, then try it, if that doesn’t work then click on the drop down thing next to the convert button and set it to embed and then click on convert
@@DARK_AMBIGUOUS Thanks!
Can someone help me. When i try to look around my game view just tilts a bunch and doesnt work.
make sure you tilt and rotate the right objects, just like in the video you tilt the camera but you rotate the player
thanks
Everything in bolt has changed so much this no longer works. Would be nice to see an updated tutorial for UVS.
its actually very very similar flow machine is script machine now, thats really the only thing that has changed.
My camera and capsule won’t turn with the play game object
Make sure you have the camera and capsule as a children of player game object and the script is in the player
when I rotate the mouse my character starts flying with it lol what am i missing?
Make sure your parent camera to character not other way around and that the position x and z at 0
When I made the code for vertical movement with clamp, horizontal camera stops working
same issue find a fix ?
@@munch15a nope🙂
So I never worked out what did wrong but it's something late in setting up the vertical movement I just re did the steps pausing every time he added a new thing to check I was doing the same
@@munch15a i imitated him and hoped that ahead if i learn something I would be able to find out what happened wrong
When I go to change the transformation from Self to MainCamera it didn't show Scene option, only assets and I couldn't find the Main Camera. Can someone please help.
this will help you understand that ua-cam.com/video/GPFjdAkjf9c/v-deo.html
@@SmartPenguins Thank you.
It says "InvalidOperationException: Variable not found: 'angle'." help?
make sure you add it, just like I did here ua-cam.com/video/KsMUhUlNuho/v-deo.html
How can i find "new vector 3 " I didn't find it
just look for "vector 3"
omg thx so much
I made this all the way and i have check The Bolt code many times, But some reason code is broken. My camera wont Turn left and right anymore. It worked fine after i closed Unity and My computer and open those again on The next Day. Help
That is weird, do is work now? If it doesn't send a screenshot on discord
I made it Work again. Dont know what happen. I had to Make a object variable to The camera and manualy connect it to The transform unit. Sorry my bad english.
My graph variables doesn't showed up how to add
You type the name first, then click on the +, and if you are looking for the graph inspector or the variables tab, click on window at the top bar and click on variables or graph inspector and you can drag them by clicking on the name of them in the top left of their windows and drag them inside the flow graph window to connect them like they are in this video
help it says the name quantenion does not exist in this conext
it needs to be quaternion
I put Mouse X but it does not work
Send a screenshot to discord
I cant't find the (new vector 3)
Did you find it?
Visual scripting is my dream I had a lot of errors in my scripts
6:51 I can't choose main camera
ua-cam.com/video/GPFjdAkjf9c/v-deo.html&lc=UgxvjV4qn1pju43mJKh4AaABAg&ab_channel=SmartPenguins-GameDev
I followed along perfectly but I can't move the camera side to side
I had same problem. I put Transform Rotation(set) instead of Transform local Rotation(set) that was why Camera didn't move side to side
@@user-hs4bk7ph3u ok thanks I'll try that and see if it works
@@user-hs4bk7ph3u hmmmm... Didn't seem to work for me. Got any other ideas?
@@user-hs4bk7ph3u actually scratch that I think I found my problem
@@flyswatterstudios1431 how did you fix the problem? I am having the same problem.
I can't find float at the variables
What you mean? you can't see it in the type drop down
@@SmartPenguins yes, I don't know why
hay dude for some reson when i tryed what it sead at 6:58 its rotateing my mouse on the X when i move it on the Y irl dose enyone know a fix
tjust finished trying the thing at 9:37 and now its only rotateing on Y
First
My mouse rotations of y axis are flipped. Help
Nvm, i figured it out
I have the same problem. I might try messing around with the Camera rotation tool. Maybe I flipped it upside down, when trying to place it onto my Player Capsule 'head'.
Nope! That was not the problem. It seems to be something weird coming from Bolt itself. Something there is messing it up.
I was stuck with this for a time. It is proper. It is just your 'view direction' out of whack. Just play around with your looking direction. Spin that camera around both the X and Y axis; and it will all the sudden be upside UP again. Haha.
I'm now getting a variable error saying variable not found:'angle'
make sure you add the angle Graph variable 7:25
@@SmartPenguins I did but still getting the error
@@flyswatterstudios1431 post a screenshot of your flow graph on my discord server
@@SmartPenguins I'll take a picture but I won't be able to later
@@SmartPenguins I decided to restart the project entirely and it works now but how do you invert the looking up and down
uhhh when i go invisble with my cursor i cant move my view
what you mean you can't move your view?
@@SmartPenguins like my cursor gets invis but when i move my cursor the charachter isn ot going to a diffrent side with my mouse its just stuck
@@wither-gaming6584 you use bolt or c#? You can post the code/graph on discord and I'll take a look
@@SmartPenguins i use bolt
6:39 It won't let me select the camera
watch this video ua-cam.com/video/GPFjdAkjf9c/v-deo.html
@@SmartPenguins thank you
My camera doesn't move side to side but i perfectly followt the tutorial
Did you put the camera inside the player game object?
Yes. I forgot to say it workt form sometime
I can move the camera up and down but not side to side
@@SmartPenguins I am also having this problem. I followed the instructions properly, I feel. But, I can't move my camera from side to side in Game view.
@@SmartPenguins I am also having this problem. I followed the instructions properly, I feel. But, I can't move my camera from side to side in Game view.
How do you make a group?
Hold ctrl and drag with mouse
@@SmartPenguins thanks!
14:45