For anyone wondering how to make the basketball miss, I thought of a very easy solution. On your TargetPoint object (Where the ball is directed to) Add this script: using UnityEngine; using System.Collections; public class BackAndForth : MonoBehaviour { public float delta = 1.5f; // Amount to move left and right from the start point public float speed = 2.0f; private Vector3 startPos; void Start () { startPos = transform.position; } void Update () { Vector3 v = startPos; v.x += delta * Mathf.Sin (Time.time * speed); transform.position = v; } } What it does is that it makes the TargetPoint move left and right so that the ball is directed to it no matter where it is, giving you a chance at missing, hope this helped!
hey idk if u still read everything. but now what to do if the ball gets stuck on the ring. is there any way to fix that? becuase ive had some times that he just sits there on the ring not being able to pick it up again
Your channel is a perfect example of "fake it till you make it" principle in gamedev, and I LOVE it! Your approach to simplifying stuff that's normally very complex is mind-opening: it made me look at coding from a very different perspective. Thank you! I really hope you'll keep sharing your powerful magic with us. :)
This is by far one of the best tutorials out there, it's quick, and it actually works in the end. Thank you so much I don't think you realize how many people have been waiting for this exact tutorial!
@@sabhazainab3551 Yes it worked. Also if you want to make it to where you dont make every shot make the target (above the hoop) move in a line across the backboard. I was able to change the character too but still working on the animations.
This is amazing. The only thing missing is the ball not always going in the hoop. Would be good to have a bar when you shoot, if you stop it in the green you make a successful throw and if you hit the red you make an unsuccessful throw. Amazing work though!
I thought of a very easy solution to make it miss sometimes. On your TargetPoint object (Where the ball is directed to) Add this script: using UnityEngine; using System.Collections; public class BackAndForth : MonoBehaviour { public float delta = 1.5f; // Amount to move left and right from the start point public float speed = 2.0f; private Vector3 startPos; void Start () { startPos = transform.position; } void Update () { Vector3 v = startPos; v.x += delta * Mathf.Sin (Time.time * speed); transform.position = v; } } What it does is that it makes the TargetPoint move left and right so that the ball is directed to it no matter where it is, giving you a chance at missing, hope this helped!
Plz weekly 🙏 upload 2 videos ...make 60 more videos on one minute gaming making video ..plzxxx You video deserves to be seen and apriciated ..sharing your video in discord snd telegram..thank u ..
Hi, this is awesome, please continue this game as a series with players being able to miss shots, multiplayer using photon. Your channel will blowup if you continue working on this. RU-vid is missing good tutorials for multiplayer games and games that have all the desired features like missing shots, scores etc.
Hello. If you want to make the ball miss sometimes, make the target move in a line across the backboard. Also make the ball bouncy just to make it a bit more realistic and it can bounce off the rim if you make the target a little higher than the hoop.
I’m having problems with the last step when I’m going to pick up the ball. It says that the modifier private isn’t valid in the item. Code “ private void OnTriggerEnter(Collider other) { “ and then I can’t pick up the ball. Any help will be nice
Can u make a tutorial on how to add an enemy and a score counter.. and if the enemy gets the score to 3 or 5 1st then he wins and it displays a “You Lose” sign and if the player gets 3 or 5 points (score) 1st then it displays “You Win” and yes we can play with our friends it will display an option to play with a friend or a bot And can u make more low poly games like these with the idea given above?
When adding the transform.LookAt(Target.parent.position); step, my character's entire body rotates upward to face the hoop and making him sink into the ground. (instead of just rotating on the y-axis and staying feet flat on the ground). Do you know what might have gone wrong?
Currently these videos here on youtube are all there is. You can also find the bonus project files on Patreon and explore and learn from the code directly.
so for some reason if i make the arms a parent which should be the easiest thing the empty gameobject which the arms are on switches to the same level and doesnt change the way the arms rotate? which is very new to me cuz normally this would work fine... any suggestions?
besides the editor tool on the left there is a toggle tool thingy (pivot/center as opts) turn it to pivot the empty game object...I was having the same issues too
@@TurtleCode- was giving me a lot of issues, but I kept trying and it worked I guess I set it for both child and parent? or just child and just parent try something I did something and it worked
Hey, I kinda need help with this since I don't know how to explain it in Reddit, I know how to add another player and change the if statement to make the controls the arrow keys, etc. But I don't know how to do something where you could steal the ball from them, and I don't know how to add a point system fr when the ball goes in a specific area (The hoop). Please reply ASAP, any help would be appreciated.
HELP PLEASE!!! When I add the LookAt method it makes the player skip on either the x or z axis as opposed to moving smoothly. Is this something in my Input or with how I set up the objects?
When you double click on a prefab to go inside in the predab mode (check documentation), graphics should be at the 0,0,0, or rather origin should be at the feet in case of the player.
@@oneminutegames7308 One more.. How to make character bump into another object and not go through it ? Btw this channel is going to be big ! I subscribed instantly.
I'm at the hold and dribble section my ball won't follow me, if I press space and let go, it goes back to the original position, the ball does not dribble and follow me when I move
What was the issue? I wanted to say to make sure PosDribble object is parented under the character in the hierarchy, if anybody else has the same problem.
Nevermind I fixed it! If anyone else is having this problem where you pick up the ball from too far away here you go: create a tag called "ball" and tag the ball object in the inspector as "ball". Then change the last method to this: private void OnTriggerEnter(Collider other) { if (!IsBallInHands && !IsBallFlying && other.gameObject.tag == "Ball") { IsBallInHands = true; Ball.GetComponent().isKinematic = true; }
You can duplicate the character prefab and add another set of controls in Input Manager, then write an if statement to tell which keys go to which character .
@@sabhazainab3551 I already did it... check at the top left in your screen, there is an icon that says Object... click on it and change it to pivot, dont know if I explained myself correctly but thats how I did it
@@levseidman7058 Random.insideUnitySphere returns a vector3 (position) I'll write an example on how you can use this to randomise the end position. example variables: Vector3 hoopPos
@@scrub2657 Can you explain for even bigger noobs, please? :D Where those variables goes, are they public and where line rndHoopPos = hoopPos + Random.insideUnitSphere * radius; shoud be put ?
@@Bandraxx in the controller script. Create a private Vector3 rndHoopPos; (anywhere that is not inside a function) You can also create a public float radius to change the radius directly in the inspector We will use this to get the random position later. Inside the if statement where we throw the ball, set rndHoopPos like I showed in the earlier comment. Then when we do Vector3.Lerp (ball going towards target), replace Target.Position with rndHoopPos. I show again: private Vector3 rndHookPos; public float radius; (Inside if statement where we look for throw input) rndHoopPos = Target.position + Random.insideUnitSphere * radius; Where we lerp: Replace Target.position with rndHoopPos.
My game didn't work. Firstly, if i walk while dribbling the ball will move away from me and secondly when i pick the ball up after shooting it disappears to a random spot. Please help. This looks awesome and I desperately want this to work.
Hard to say what could cause this. Make sure that ball is not parented under the charater. And double check the code where ball position is calculated.
@@oneminutegames7308 Yeah Thank You so much I checked the code where the ball position is calculated and its working. Is there anyway you can add like enemy ai that you can play. Thanks you have earned yourself another subscriber.