PeterPopma / unityfc

Script for Unity soccer game
9 stars 10 forks source link

Ball Script #2

Open HuGoCo17 opened 1 year ago

HuGoCo17 commented 1 year ago

Hello, I am having issues with the ball script. i can't get it to work, can someone help? Can I just copy and paste it, or have access to the complete unity game file, so I can see what I did wrong? Thanks

PeterPopma commented 1 year ago

You can show the code and explain what goes wrong. Or you can check my follow-up project, it may contain some fixes: https://github.com/PeterPopma/KickIt

HuGoCo17 commented 1 year ago

You can show the code and explain what goes wrong. Or you can check my follow-up project, it may contain some fixes: https://github.com/PeterPopma/KickIt

I am stuck on the ball script in your video @ around 23:45

Screenshot 2023-05-09 at 16 21 18 Screenshot 2023-05-09 at 16 21 36

I don't see anything wrong, and my coding teacher doesn't either.

PeterPopma commented 1 year ago

Line 23 doesn't match with any versions that are committed here.

But if you take a look at the initial version (from the first soccer game video) https://github.com/PeterPopma/unityfc/commit/31a48b49030d704f333bf288c0872422dcc38603#diff-bcdb61aac27adac4090f884a53e4e6d8ba11640ce092b9318fa33d580c6dce6e

There are 3 things that could cause such an error: 1) you haven't linked the human player to transformPlayer of the ball 2) the player gameobject hasn't got a child object "BallPosition" (in other words: playerBallPosition is not set) 3) you have no rigidbody component attached to the ball object

HuGoCo17 commented 1 year ago

how would you set playerBallPosition? and link the human player to to transformPlayer of the ball?

HuGoCo17 commented 1 year ago

And I copied the code from https://github.com/PeterPopma/unityfc/commit/31a48b49030d704f333bf288c0872422dcc38603 (the ball script) and a new thing popped up.

Screenshot 2023-05-10 at 09 48 09

I'm just having issues with getting the ball to stick to the Player

HuGoCo17 commented 1 year ago

Could I just have the complete game file to see what I did wrong?

UpdateYT commented 5 months ago

I am Stuck Here on the first Video null pic 6

UpdateYT commented 5 months ago

My Errors null pic1 Null pic2 null pic4 scripts

UpdateYT commented 5 months ago

This is the reset of my Game Scene and Scripts null pic3 null pic5 null pic 4(1)

UpdateYT commented 5 months ago

Today 5/30/2024

You can ignore all the picture above. Since I have now fixed those issues and My game works. I am able to kick the ball to the goal. I am at 50:00 in first soccer video tutorial. I will be uploading my steps just in case anyone is stuck like I was. Hopefully this helps. The scripts below this comment is everything I have done. Fixed1

Fixed2 Fixed3 Fixed4 fixed5 fixed6 fixed7 fixed8 fixed9 fixed10 fixed11 fixed12 fixed13 fixed14

PeterPopma commented 5 months ago

Thanks for your contribution! I am not sure what the errors were that you encountered, but this game was written some time ago, so in new Unity versions you may need to change some things. Also, any improvements I made myself can be found in project "KickIt".

UpdateYT commented 5 months ago

Thanks

On Sat, Jun 1, 2024, 2:53 AM Peter Popma @.***> wrote:

Thanks for your contribution! I am not sure what the errors were that you encountered, but this game was written some time ago, so in new Unity versions you may need to change some things. Also, any improvements I made myself can be found in project "KickIt".

— Reply to this email directly, view it on GitHub https://github.com/PeterPopma/unityfc/issues/2#issuecomment-2143385706, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIWWWJZITGMWB6VJJZWDWHDZFGKZTAVCNFSM6AAAAAAXZRPDYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBTGM4DKNZQGY . You are receiving this because you commented.Message ID: @.***>