Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question I'm Making A Racing Game But I Don't Know How To Code C#.

Discussion in 'Scripting' started by JDinoman, Feb 9, 2021.

  1. JDinoman

    JDinoman

    Joined:
    Jan 26, 2021
    Posts:
    26
    As crazy as it sounds, no; I cannot code C#. I am making a racing game, so any help on things like how to make the lights work, the tires move and steer, the speedometer work, and all that, it would be very helpful. See, I am a designer, not a dev. But while making a 3D model of a car in my software, I realized how cool it would be to use it in a video game. So I got Unity, I imported the car asset and one of my older City models, but I'm clueless on how to make it work. If anyone can help me, I will gladly put your username in the credits, or I might as well slap your username on the start screen. Any help would be much appreciated.
     
  2. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    Your options are:

    * Learn C#
    * Try some of the visual scripting options that Unity has (e.g. Bolt)
    * Hire someone to code it for you (No one here will work for free to get their name in the credits of a game that almost-certainly won't see the light of day)
     
  3. JDinoman

    JDinoman

    Joined:
    Jan 26, 2021
    Posts:
    26
    oh wait... yeah... if forgot about that third one...

    Also, you know that stuff at the start of every Unity script that's like, Using: Unityengine ?
    If I learned how to code C#, then how would I know what Unity-specific variables like Unityengine or vector3 are?
    Is there some unity C# manual? or something?
     
  4. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    Keep in mind that when learning to code, many of the most common questions have already been answered somewhere on the internet. A simple Google search will solve most of the problems you are likely to run into. For example, if I search Unity C# Manual, the first result is Unity's scripting manual:

    https://docs.unity3d.com/Manual/ScriptingSection.html

    Developers tend to get grumpy if they google your question and find the answer as the top result ;)

    Plenty of tutorials for learning C# and Unity can also be found. I have heard that Brackey's tutorials are a good starting point.
     
    JDinoman likes this.
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    This ^ ^ ^ for sure.

    Just do lots of tutorials. You won't grasp them all at the start, do them, try to understand, back up, google the words and terms used, etc. There's really no way to short-circuit it. You will just find yourself steadily getting better after every day you sit down to it.
     
    Schneider21 likes this.
  6. JDinoman

    JDinoman

    Joined:
    Jan 26, 2021
    Posts:
    26
    thank you.

    I've designed my assets, (well, most of them. actually, more like 2 percent of what I'm planning)
    and I've composed my own music for the game. I know how to use unity (kind of)
    so I'll just have to learn scripting. It's just, I don't want to spend 80 hours total watching tutorials, but I pretty much have no other option, except for paying somebody else to do it for me, and I don't want to do that. At one point I simply tried making a script from nothing, which didn't work out very well...

    I'll go watch those tutorials.

    Thank you for your help.
     
  7. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    Don't do this. Mindlessly going through 80 hours of tutorials won't help ANYONE. Instead, pick one interesting small tutorial. Do that one tutorial.

    When you're done, see if you can turn that tutorial into something that is different: modify it, stick one of your pieces of art in it, double the enemy count, make a new enemy variant, make it so the entire game plays in another direction (like scrolls left? make it scroll right! Or uses a top down camera? Change the camera to look the other way), etc.

    If you can't do that, go back and try to understand what parts you're not understanding.

    Otherwise you'll do 80hrs of tutorials and still not understand anything, and what's the point of that?
     
    Schneider21 likes this.
  8. JDinoman

    JDinoman

    Joined:
    Jan 26, 2021
    Posts:
    26
    yeah. also, I've been looking through the Unity ScriptingAPI thingy where it tells you what stuff like vector3int is, but I can't seem to find anything that will represent the x/z velocity of the game object. I need this because I'm trying to set the pitch of an audioclip in my game object on void update to the x*y/2 velocity of the gameobject divided by 10. I just need your help on this part. I'm trying to use audioSource.pitch = public int CarVelocity, but I need help figuring out how to define CarVelocity on VoidStart.
     
  9. JDinoman

    JDinoman

    Joined:
    Jan 26, 2021
    Posts:
    26
    does this movement script look right to you?
    (It's not mine but a friend who thinks they know how to script C# gave it to me)

    using UnityEngine;

    Public class FS : Monobehaviour
    {
    Void Update () {
    if (Input.GetKey (KeyCode.W)){
    transformx.newPosition += 1.0f;
    }
    Public Vector3;
    }
    }


    by the way, that's copy-paste. and it just doesn't look right to me. like, I'm pretty sure you've gotta put something after Public Vector3, and transformx doesn't even exist. Also, the bracket in front of the double closing parentheses just doesn't look right either... And I'm pretty sure you can't put + and = together

    and again, this is not my script so don't blame me for it's total garbage-ness.
     
  10. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    Start off with some basic tutorials like I suggested. It will help you understand the basics, like moving things around.

    I don't get what you mean when you say it doesn't "look right", or your "not sure". Does it compile and work, or not?
     
    Last edited: Feb 17, 2021
  11. JDinoman

    JDinoman

    Joined:
    Jan 26, 2021
    Posts:
    26
    no there's a ton of compiler errors
     
  12. JDinoman

    JDinoman

    Joined:
    Jan 26, 2021
    Posts:
    26
    and no the guy doesn't cover tutorials on changing pitch to a tenth of the x velocity plus the y velocity, divided by 2
     
  13. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    You will not find a tutorial showing you how to do every exact and precise thing you want to do. You have to use knowledge and insight gained from them in order to do that.

    Tutorials will show you how to move a transform around by it's position, and how to use a ridgidbody. With that, you should be able to work out what you want to do.

    You can't skip the learning to code bit of game development, if you intend to do it all yourself.
     
    Schneider21 and Kurt-Dekker like this.
  14. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    Dude. Just stop. The above is not valid in ANY language ANYWHERE. It's like if you called your grandma and read some code to her and she wrote it down on a napkin then called her bingo friend and she typed it in and sent a photograph of it to you.

    Go work through THREE small tutorials on what you're trying to do. You will soon see the common threads of how all this works.
     
    Schneider21 likes this.
  15. JDinoman

    JDinoman

    Joined:
    Jan 26, 2021
    Posts:
    26
    ok
     
  16. JDinoman

    JDinoman

    Joined:
    Jan 26, 2021
    Posts:
    26
    ok, so... simple question, this should be as easy as sharpening a pencil to answer:
    How do you hide a game object?
    I just wanted to know, so I can make my ABS indicator and my TCS indicator automatically hide on start.
    It should be like the easiest question to answer.

    like... easier than telling me to spend 45 minutes finding a tutorial that tells me how to.
     
  17. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    You are effectively asking other people to take time out of their day because you don't want to put in the effort to figure something out yourself. You can't do this for every single problem you run into.

    Go and spend 45 minutes finding a tutorial. Not only will you learn how to hide something, but you will learn the necessary skill of how to find answers to trivial problems effectively. 45 minutes will become 20 minutes, then 5 minutes, and then before you know it, finding answers to these questions will become effortless.

     
    Schneider21 likes this.
  18. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    @CarcrashPro3D What you're doing is obvious. Instead of trying to goad people into answering your questions and suggesting they're wasting their effort telling you to learn through tutorials, consider what you're effectively saying.

    You came here asking for help because you said you wanted to make a game. People who know what they're talking about took time out of their day to give you advice and point you in the right direction, which would get you what you asked for.

    What they suggested sounded like too much work for you, so you decided to ignore the advice and again prompted the community to tell you how, specifically, to do this VERY basic task, all while showing you've put almost zero real effort in. You're straight up saying you think your time is more valuable than ours, and it's been my experience around here that most people don't care much for that kind of attitude. Sure, you'll get a few people not aware of your outlook who stumble upon one of your questions and answer thinking they're helping out a stranger, or maybe just for the practice of helping others to reinforce their own learning. But most will learn to ignore you and your requests until you demonstrate you're taking the learning process seriously.

    If you keep up with this attitude, I promise you you'll never make a game. Heck, you'll never finish a tech demo of your game idea. Making a game -- any game -- especially as a solo dev is a ton of work, often frustrating and overwhelming. If you can't handle that, better to find a more enjoyable hobby now.

    If you do want to actually do this, though, show us you can by putting in the effort. Listen to what people are saying and drop your over-ambitious game idea, start with the basics, and shape up. Think about how you present yourself to the world and compare that with how you'd like to be viewed.

    Good luck. We'll be here.
     
    Last edited: Feb 18, 2021
    bobisgod234 likes this.