Move To Any Specific Part Of The Video(Click Below): 1. 00:00 - Intro 2. 00:40 - Creating 3D Movement Player Controller 3. 04:50 - Play Testing & Fixing Problems 4. 05:20 - Creating Bigger Play Area 5. 05:47 - Creating Simple Camera Follow Script 6. 07:28 - Fixing Camera View Problem 7. 08:36 - Creating Collectable Coins 8. 11:20 - Detecting Collision & Collecting Coins 9. 12:40 - Adding Rotation to Coins 10 14:35 - Playing Audio in Unity 11 16:33 - Manually Playing Audio Clips | -------------------------------------------------------------------- | Get My Complete C# Course Here: bit.ly/31UgmOB ( 25+ Hours of Video Content )
Bro i have purchased your cource it was around 490 inr thanks bro it is really awesome but i have an suggestion for you can you make a video on how to make a leaderboard for android game Thanks for such a lovely cource😘😍 and subscribed to your channel
Hey I purchased your course and can confirm that you are a very good teacher, you explain everything very clearly. And if anyone is looking for a course for game development and is a complete beginner go for this course! It is the course for you!!
I just want to give a huge thank you to you. The way you walk through the code and explain everything just enough is so helpful. This series has helped me come so far in such a short amount of time. Thank you.
youtube has recommended this to me twice today i stopped watching these tutorials out of laziness or something i think this is a sign i should watch more of these again
I don't know how much I have to thank you I was looking for these tutorials your way of explaining is great alll others videos are not clear just wasting time
Thanks a lot brother!, I am just learning this for fun nothing more but I kept giving up after not knowing what was going on. Your videos has helped me a lot to not give up and try to understand things instead.
raja Parents: you need to sleep by 11:15pm raja: making a 15min c# tutorial very fast. it takes me 1hr to learn a 15min tutorial. nice tutorial for babies.thank you
Man these videos are great!! I just learnt a lot in a very short video. I think there are few things remained unexplained like why you chose to write your code in FixedUpdate method instead of merging all of it in the Update method. And for the rotate axis I believe it would be better if you talk in general on how we would write the line of code for different axis before choosing the Vector3.up for the Y axis and why not using the Quaternion since you mentioned it before. I understand that you're doing your best to make the video short, but honestly with this quality content I'm ready to watch a serie of 40min videos each since I'm learning a lot from it!! Thank you so much
Raja, ur channel is one of the best for unity tutorials. You explain very clearly in ur videos. Keep doing what u do, ur channel will grow big, it's only a matter of time. Cheers!!!
Anyone able to solve an issue I am having with the destroy object script? I have everything set up word for word like the video, but the coin will not destroy. I have even attached a debug.log command to see if its at least recognizing that there was a collision but that doesn't work either. What could be the issue? I have the coin tagged as "Coin", the player cube has a collider, the parent coin has a sphere collider. As of right now the player cube just runs into the coin and gets stopped, which means unity recognizes they both have colliders. But the script wont fire. No luck. Please help :(
I ran into this issue as well, I figured out its because I didn't reset the positions of both the parent and child coin. This is important because when you make the sphere collider on the parent coin, the collider doesn't appear in the same place as the child coin.
3:50 I'm watching & learning your video, but object still don't want to move, I think it should input to script key for up down & left right move i think.
I can't understand why at 4:50 the camera is looking at/following the cube as it tumbles and rotates. It didn't look like you had set the camera follow at that point. Am I wrong?
Hey, your tutorials are very great and to the point, I really appreciate your work and hope you will continue to teach us. I was wondering if you could teach us how to make unlockable levels, scene transitions on buttons/ transition by moving through the screen. Thanks!
@ 16:00, whenever my cube hits the coin, there is an error in console saying - "ArgumentNullException: Value cannot be null. Parameter name: source UnityEngine.AudioSource.Play () (at :0) Player.OnCollisionEnter (UnityEngine.Collision collision) (at Assets/Scripts/Part3/Player.cs:46) " Help !!
Charger Games oh yes you are right in the console is printed: The name xinput does not exist in the current context.(same by zinput)so what should i do 🥺
Awesome tutorials! I would have like to have seen the coin audio attached to the coin prefab then called on Destroy. That way it could be reused by other games without having to attach it to the player every time.
Charger Games oh yes you are right in the console is printed: The name xinput does not exist in the current context.(same by zinput)so what should i do 🥺
Thank you so much for your tutorials! I have an error though for the player file. NullReferenceException: Object reference not set to an instance of an object Player.FixedUpdate () (at Assets/Scripts/Player.cs:39) Any idea how to resolve it? I used your exact code. using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using UnityEngine; public class Player : MonoBehaviour { Rigidbody rb; float xInput; float zInput; public float moveSpeed; private void awake() { rb = GetComponent(); } // Start is called before the first frame update void Start() {
} // Update is called once per frame void Update() { xInput = Input.GetAxis("Horizontal"); zInput = Input.GetAxis("Vertical"); } private void FixedUpdate() { float xVelocity = xInput * moveSpeed; float zVelocity = zInput * moveSpeed; rb.velocity = new Vector3(xVelocity, rb.velocity.y, zVelocity); } }
Hey i am having that error while trying to collect the coins and play the audio source:"ArgumentNullException: Value cannot be null. Parameter name: source UnityEngine.AudioSource.Play () (at :0) Player.OnCollisionEnter (UnityEngine.Collision collision) (at Assets/Scripts/Player.cs:46)"
i got a problem: i followed all the steps but the coin wont spin edit: i had to use back instead of up and rotatespeed does nothing it just automaticaly spins
Hello Sir, I want to create a fighting game, everything is fine but I am stucked in place where i want to create a combo move by pressing 1 button, like if i press one button player performs a move then i press button again in limited time it performs a different move and then 3rd time again, if we dont press in the time back to the idle, can you make a tutorial....? it will help me a lot
Hey I'm having a problem with tuples needing to have two elements I don't really know what a tuple is and visual studio isn't giving me problems I'm new to unity and I was hoping I could find someone who could help me
Hello, I'm new to using unity and also new to using c#. There's something that's bugging me whilst I'm trying to make my first game, basically I heard that you can not use somebody's c# coding because its classed as plagiarism, now I do not get it because there's thousands of gaming apps out there. surely there isn't thousands of different codes to make a player move. so I guess what I am saying is what do you do then? thank you
how to make the camera follows the player around so that it won't look so far when it just follows where the player. but it actually follows as it travel?
Shouldn't the coin sound code be added to the actual coin instead? Otherwise you'll end up with loads of code on your player for playing sounds of different things it interacts with.
This video was super helpful but the only thing was that I want the camera to FOLLOW the player, not LOOK AT it. Can anyone tell me a script that shows me how to follow and not look?
If anyone's having trouble with the camera following your cube incorrectly, you can simply make the Main Camera a child of the Cube (literally just drag main camera into cube, it should create a drop down that has main camera in it). From there make the x & y position of the camera the exact same as the cube, then make the z slightly different so that the camera is behind the cube (Cube position: -0.65, 2.37, -3.48 | Camera position: -.65, 2.37, -5. You can def play around with it and see what you like) and when you move the cube the camera will follow! Seems to be a super easy and honestly better camera follow... no script neccessary. And in regards to the movement of the cube, I had to change xInput to: Input.GetAxis("Vertical"); and zInput to: Input.GetAxis("Horizontal"). Also had to change rb.velocity to: new Vector3(-xVelocity, rb.velocity.y, zVelocity)... This made my cube go WASD properly with a nice camera follow. Hope this helped at least 1 person (and wasn't too confusing, feel like I worded it pretty reasonably)!
Move To Any Specific Part Of The Video(Click Below):
1. 00:00 - Intro
2. 00:40 - Creating 3D Movement Player Controller
3. 04:50 - Play Testing & Fixing Problems
4. 05:20 - Creating Bigger Play Area
5. 05:47 - Creating Simple Camera Follow Script
6. 07:28 - Fixing Camera View Problem
7. 08:36 - Creating Collectable Coins
8. 11:20 - Detecting Collision & Collecting Coins
9. 12:40 - Adding Rotation to Coins
10 14:35 - Playing Audio in Unity
11 16:33 - Manually Playing Audio Clips
| -------------------------------------------------------------------- |
Get My Complete C# Course Here: bit.ly/31UgmOB
( 25+ Hours of Video Content )
Bro i have purchased your cource it was around 490 inr thanks bro it is really awesome but i have an suggestion for you can you make a video on how to make a leaderboard for android game
Thanks for such a lovely cource😘😍 and subscribed to your channel
@@sunitagupta7240 Thanks a lot.. I creaed a course on that topic few years ago, I'll try to make an updated version :)
@@ChargerGames my character keeps falling through the floor how can I fix this?
Do you know why it's rotating around me, and not the y?
@@thelongestleg maybe cuz u didnt add a terrain or didnt add rigidbody settings ig. I new aswell
Just in these 3 parts, I have learned more than I have in a year of classes. Thank you for existing man!
da best unity tutor in the whole world your even better than brackeys in coding wow
Thanks a lot man :)
I feel both are legit
These tutorials are easy to follow, and he ACTUALLY EXPLAINS what's happening and you can actually remember them 🤣
Yeah I agree. He is the perfect tutor....
This series is awesome! Like... dude... this is sometimes a 'lil better than brackeys.
Thanks a lot man :)
You are right bro
The way you explain things is amazing! Everything is clear and easy to understand! Can't wait for more videos :)
Thank you so much!
Hey I purchased your course and can confirm that you are a very good teacher, you explain everything very clearly.
And if anyone is looking for a course for game development and is a complete beginner go for this course!
It is the course for you!!
I wish I knew this guy personally
Thanks a lot :)
I just want to give a huge thank you to you. The way you walk through the code and explain everything just enough is so helpful. This series has helped me come so far in such a short amount of time. Thank you.
youtube has recommended this to me twice today
i stopped watching these tutorials out of laziness or something
i think this is a sign i should watch more of these again
Keep Learning, All The Best :)
It's really still unbelievable every time I get things to work flawlessly just from following your instructions
Thanks man, Glad you found it helpful :)
I don't know how much I have to thank you I was looking for these tutorials your way of explaining is great alll others videos are not clear just wasting time
Glad I could help!
More videos coming soon :)
Seriously the best unity teacher on TH-cam
Thanks a lot Craig, Happy Learning :)
Thanks a lot brother!, I am just learning this for fun nothing more but I kept giving up after not knowing what was going on. Your videos has helped me a lot to not give up and try to understand things instead.
raja Parents: you need to sleep by 11:15pm
raja: making a 15min c# tutorial very fast.
it takes me 1hr to learn a 15min tutorial. nice tutorial for babies.thank you
Haha.. Good one Sriram.. :D
Stay Subscribed, Keep Learning
I've learned more in the 45 minutes you've spent on this topic than I have in a year
You should to post a video like this every week.I will follow them with pleasure.I hope you take my opinion into account.
Thanks for the suggestion, I'll try to do it regularly :)
waah...bahut acha tutorial.Bahut kuch seekhne ko mila👍👍
Man these videos are great!! I just learnt a lot in a very short video. I think there are few things remained unexplained like why you chose to write your code in FixedUpdate method instead of merging all of it in the Update method. And for the rotate axis I believe it would be better if you talk in general on how we would write the line of code for different axis before choosing the Vector3.up for the Y axis and why not using the Quaternion since you mentioned it before. I understand that you're doing your best to make the video short, but honestly with this quality content I'm ready to watch a serie of 40min videos each since I'm learning a lot from it!! Thank you so much
OMG THE PLAYER MOVEMENT SAVED MY LIFE I just about to give on making a player movement until I saw this video Thank you SO SO SO SO SO SO Much !!!!
Raja, ur channel is one of the best for unity tutorials. You explain very clearly in ur videos. Keep doing what u do, ur channel will grow big, it's only a matter of time. Cheers!!!
Wow man u did awsam job its ez to understand ... Love from Pakistan
Thank You Brother :)
all of Raja's tutorials are the best for unity
Thanks a lot :)
(that is true);
I was waiting for you video u are my favorite
Thanks Arnav :)
Eagerly waiting to join the class 👌👌
Thanks bro.. :)
Luv your vids man it always helps me
Glad to hear that :)
Anyone able to solve an issue I am having with the destroy object script? I have everything set up word for word like the video, but the coin will not destroy. I have even attached a debug.log command to see if its at least recognizing that there was a collision but that doesn't work either. What could be the issue? I have the coin tagged as "Coin", the player cube has a collider, the parent coin has a sphere collider. As of right now the player cube just runs into the coin and gets stopped, which means unity recognizes they both have colliders. But the script wont fire. No luck. Please help :(
I ran into this issue as well, I figured out its because I didn't reset the positions of both the parent and child coin. This is important because when you make the sphere collider on the parent coin, the collider doesn't appear in the same place as the child coin.
It's so clear! You're the best man ty!
Glad you think so!
3:50 I'm watching & learning your video, but object still don't want to move, I think it should input to script key for up down & left right move i think.
Hi Raja, enrolled your course in Udemy.
Very useful 👍👍
Awesome, thank you! :)
This tutorial is easy to understand and good for refresh your skills (sorry my english is not good)
Really Nice Tutorial... Going to see that 1 hr version... just started with unity
I can't understand why at 4:50 the camera is looking at/following the cube as it tumbles and rotates. It didn't look like you had set the camera follow at that point. Am I wrong?
Damn your tutorial video is one the best! I learn so much here
Glad you like it :)
This was absolutely awesome. Thank you so much!!
Hey, your tutorials are very great and to the point, I really appreciate your work and hope you will continue to teach us. I was wondering if you could teach us how to make unlockable levels, scene transitions on buttons/ transition by moving through the screen. Thanks!
Thanks Moazzam for the suggestions, I'll try to create videos on those topics.
:)
Bro I am your biggest fan
Will u bring any intermediate level course this year in Udemy
Thanks for the suggestion, I'll try to create one :)
If you have any more suggestions , like courses on which topic do you want, you can let me know..
@@ChargerGames maybe an intermediate course on making something like a 2D rouguelike game?
underated channel
Thanks for your support :)
@ 16:00, whenever my cube hits the coin, there is an error in console saying - "ArgumentNullException: Value cannot be null.
Parameter name: source
UnityEngine.AudioSource.Play () (at :0)
Player.OnCollisionEnter (UnityEngine.Collision collision) (at Assets/Scripts/Part3/Player.cs:46) "
Help !!
Great tutorials but in the next one can u show us how to jump
Ok, I'll try to add this topic :)
... And this is why I'm subscribed ...
BTW I love your videos!!! Please keep making more!!
Awesome video! thank you very much!
Thank You :)
Pls contunio like that you are making best c# tutorial videos
Ya sure :)
What music you use in the latest video
4:00 after making the float public (and before) there’s still no move speed up showed in unity pls help me:(
Probably there's some error in the code, check the console
Charger Games oh yes you are right in the console is printed: The name xinput does not exist in the current context.(same by zinput)so what should i do 🥺
@Charger Games
@@MilesRaynor Did you spell it correctly? Sometimes that can be a pain in the butt :P
Plss pls do a video about playerprefab, like you did with the coin thing, and how to access it on other scenes
Ok, Thanks for the suggestion :)
thank god that indian guys on internet are here to teach me actual codding
Awesome tutorials! I would have like to have seen the coin audio attached to the coin prefab then called on Destroy. That way it could be reused by other games without having to attach it to the player every time.
How can i make the cube look at the direction that he goes for
And think you your tutorials is awesome
Thanks man, I'll try to make a video on that topic :)
Hello why its not possible to multiply the
rb.velocity = new Vector3 (xvelocity, rb.velocity.y, zvelocity);
to Time.deltaTime?
Very informative video sir thankyou 🙏
Help!! What should be the format of the audio file??
Charger games my collision with the cube and coin is not working please help
What visual studios version is this?
would this work for 3d roguelike game
Awseome, excellent I saw this and it helped me a lot🥇🥇🥇🎖🎖🎖🏆🏆🏆👍👍👍😁😁😁😁😁😁😁😁😁😁😁
Charger Games oh yes you are right in the console is printed: The name xinput does not exist in the current context.(same by zinput)so what should i do 🥺
Make sure you spelled Horizontal and Vertical correct like this: "Horizontal" "Vertical"
MYSTIC MAN idk if this would help cause i deleted all and make danis tutorial and now it works anyway thx
Why make Awake and FixedUpdate private void?
any function (either predefined or user created ) will be private void by default, not writing the private keyword does not matter
Awesome tutorial. However, my coin orbits instead of rotating.
private void FixedUpdate()
{
transform.Rotate(Vector3.up, rotspeed);
}
same here.. do u find the solution ?
Thank you so much for your tutorials! I have an error though for the player file. NullReferenceException: Object reference not set to an instance of an object Player.FixedUpdate () (at Assets/Scripts/Player.cs:39) Any idea how to resolve it? I used your exact code.
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using UnityEngine;
public class Player : MonoBehaviour
{
Rigidbody rb;
float xInput;
float zInput;
public float moveSpeed;
private void awake()
{
rb = GetComponent();
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
xInput = Input.GetAxis("Horizontal");
zInput = Input.GetAxis("Vertical");
}
private void FixedUpdate()
{
float xVelocity = xInput * moveSpeed;
float zVelocity = zInput * moveSpeed;
rb.velocity = new Vector3(xVelocity, rb.velocity.y, zVelocity);
}
}
Quick question, what's the difference between Update and fixedUpdate?
wow, these video's help a lot!
Glad you like them!
13:23 Typo on rotateSpeed. ;)
Is the reason for using tags instead of names purely a matter of "good habits" or is there another reason?
THANK YOU SO MUCH!!!
Glad it helped!
does this only work for a cube can you use characters for this script and secondly will it still work if you use anything other than a cube
Hey i am having that error while trying to collect the coins and play the audio source:"ArgumentNullException: Value cannot be null.
Parameter name: source
UnityEngine.AudioSource.Play () (at :0)
Player.OnCollisionEnter (UnityEngine.Collision collision) (at Assets/Scripts/Player.cs:46)"
If you make the next part can it be for nity 2d like moving in unity 2d and stuff like that
Ya, Thanks for the suggestion :)
Very nice tutorial
Great video! Can you maybe do a intermediate tutorial?
Possibly!
Btw, you can check my complete course from description :)
The video is 18 minutes.... they lied to us😂
Haha.. There's some Intro & Outro..
:o
Still better than videos that are a few hours long...
i got a problem: i followed all the steps but the coin wont spin
edit: i had to use back instead of up
and rotatespeed does nothing it just automaticaly spins
which extension do you use for c#?
Please check my video Visual Studio Auto Completion Fix
Why doesnt mine move? help please!
sorry if i ask, but it wouldn't be easier to use * cinemachine * instead of using the script?
You can do it bot ways, here we have used just one line of code, feel free to use whatever you think is more optimal :)
Dear Raja make vedios for racing games 3d and 2d in unity and thanks for your tutorials😊
Can I use your code for my horror game?
commenting so youtube promotes the video
Thanks man :)
thanks a lot!
You're welcome!
Thanks.
Hope you liked the video :)
@@ChargerGames I did and the last 2 tutorials.
Hello Sir, I want to create a fighting game, everything is fine but I am stucked in place where i want to create a combo move by pressing 1 button, like if i press one button player performs a move then i press button again in limited time it performs a different move and then 3rd time again, if we dont press in the time back to the idle, can you make a tutorial....? it will help me a lot
Can you make a tutorial on fps (first person shooting)
BTW love your vids
I'll try to make one :)
Hey I'm having a problem with tuples needing to have two elements I don't really know what a tuple is and visual studio isn't giving me problems I'm new to unity and I was hoping I could find someone who could help me
i did everthing corecrt but my cube did not move i cant find any thing wrong
Make sure to add a speed value from the Editor. :)
Hello, I'm new to using unity and also new to using c#. There's something that's bugging me whilst I'm trying to make my first game, basically I heard that you can not use somebody's c# coding because its classed as plagiarism, now I do not get it because there's thousands of gaming apps out there. surely there isn't thousands of different codes to make a player move. so I guess what I am saying is what do you do then? thank you
0:21 just look at the trophies behind 😂😂
how to make the camera follows the player around so that it won't look so far when it just follows where the player. but it actually follows as it travel?
I'll try to create a camera follow video in future :)
@@ChargerGames thank you so much. keep it up
Only thing that is a bit confusing is all the brackets and curly brackets
I need help! My coins don’t rotate
Paste the code, someone might help :)
@@ChargerGames Nvm i fixed it. I forgot to add a create empty object to the coins. Thanks!
Plz make another eps ♥
Thank You, There are already 5 episodes in this series :)
veryunderrated video
Shouldn't the coin sound code be added to the actual coin instead? Otherwise you'll end up with loads of code on your player for playing sounds of different things it interacts with.
Yes you can do that.. I created it the simplest way in this video :)
This video was super helpful but the only thing was that I want the camera to FOLLOW the player, not LOOK AT it. Can anyone tell me a script that shows me how to follow and not look?
If anyone's having trouble with the camera following your cube incorrectly, you can simply make the Main Camera a child of the Cube (literally just drag main camera into cube, it should create a drop down that has main camera in it). From there make the x & y position of the camera the exact same as the cube, then make the z slightly different so that the camera is behind the cube
(Cube position: -0.65, 2.37, -3.48 | Camera position: -.65, 2.37, -5. You can def play around with it and see what you like) and when you move the cube the camera will follow! Seems to be a super easy and honestly better camera follow... no script neccessary.
And in regards to the movement of the cube, I had to change xInput to: Input.GetAxis("Vertical"); and zInput to: Input.GetAxis("Horizontal"). Also had to change
rb.velocity to: new Vector3(-xVelocity, rb.velocity.y, zVelocity)... This made my cube go WASD properly with a nice camera follow. Hope this helped at least 1 person (and wasn't too confusing, feel like I worded it pretty reasonably)!
Guys i need help when i start i cant move he said axis not setup
what
@@Celcious i press but ita not move and the script out of errors
How do i give you some money to thank you?
You can purchase my courses.. :)
Thanks bhai
could you make a third and or first-person tutorial
Thanks for the suggestion, I'll try to make videos on these topics :)