Hello everyone. A total beginner here trying my way into the programme I’m trying to learn some stuff that’ll come handy for my sport game if I ever may. I was wondering anyone can help me with a script to stick the ball to the player while dribbling and kicking it away when pressed a button. Thanks in advance and good luck everyone out there
Sorry, but this is not the place, where people make you whole scripts:(, try making one yourself, then if ypu have a specific problem, come back and ask again, but a helping idee, try parenting the ball in front of the player, then it will move with the player, you can do this by placing the ball on the right place, then gameObject.transform.parent == PutYourPlayerHere.
Oh, I thought I can ask for scripts here. Thanks for your concern and advice.
the scripting forum is more for “I’ve made this script and it’s not doing what I want” or “I get these errors” kind of thing. People helping you work through scripting issues.
If you want the entire working script to be done by someone else you are looking for the Collaboration forum. Generally we see quite a few “can someone give me a script that does x” in a day and they don’t tend to get a very good reception here, expectations of people working for free etc.
So really it depends on what you are after.
If you are looking for to make a soccer game yourself, I’d suggest you start by looking at the scripting Learn section.
Have a look at the Triggers and Colliders sections of the physics pages, that’ll be your way of telling if the players have bumped into each other/the ball. Addforce for kicking the ball etc.
Have a look at the example projects and the input section for controls.
http://unity3d.com/learn/tutorials/modules/beginner/scripting/get-button-and-get-key?playlist=17117
http://unity3d.com/learn/tutorials/modules/beginner/scripting/get-axis?playlist=17117
Try to build a basic prototype with some cubes/capsules “passing” a sphere around etc.
If you try and get stuck pop back here with examples of the code you’ve tried to make and people here will help you through.
Oh, I appreciate your concern. Thanks.I’ve watched and am watching every video and tutorial I can but I guess I need some more time. Good luck .