❔ I know a lot about C#... minus the syntax.

So this is a weird beginner question.
41 Replies
JakenVeina
JakenVeina2y ago
what's a weird beginner question?
💖💕Flow💕💖
"I know a lot about C#... minus the syntax."
TheRanger
TheRanger2y ago
ok.. and?
💖💕Flow💕💖
I use Unity Visual Scripting, so I know a lot about C#, but I don't know how to format code in C#.
TheRanger
TheRanger2y ago
what code? can u show?
💖💕Flow💕💖
You won't be able to make use of this, but okay?
TheRanger
TheRanger2y ago
you want to convert that into C#?
💖💕Flow💕💖
Here's some poorly made C# I created earlier
//i have no idea how to make variables so this is just me making it up
property1("TargetObj") = GameObject

private void "CanSeeObject?"{
Dir = transform.getEulerAngles this;
transform.LookAt TargetObj
physics.Raycast (transform.GetPosition this, transform.getEulerAngles this, 12.5f, layerMask);
// I have no idea how to assign layers to a layermask
transform.setEulerAngles this Dir
}
//i have no idea how to make variables so this is just me making it up
property1("TargetObj") = GameObject

private void "CanSeeObject?"{
Dir = transform.getEulerAngles this;
transform.LookAt TargetObj
physics.Raycast (transform.GetPosition this, transform.getEulerAngles this, 12.5f, layerMask);
// I have no idea how to assign layers to a layermask
transform.setEulerAngles this Dir
}
No, I just want to learn C#
TheRanger
TheRanger2y ago
you can learn C# from links below $helloworld
💖💕Flow💕💖
I know how it works, but I don't know how to properly format C# code
Hackmagician
Hackmagician2y ago
you can learn that from the links above too 🙂
Kao
Kao2y ago
Really follow the link above it is perfect to help you achieve what you want. Like really.
💖💕Flow💕💖
So I tried to write it with the knowledge I have so far, and almost instantly failed! :D
💖💕Flow💕💖
Time to follow tutorials.
Hackmagician
Hackmagician2y ago
l i n k s 🤔
💖💕Flow💕💖
I know
Hackmagician
Hackmagician2y ago
and pretty sure u need to specify the key code for that one and then use it in an if
Kao
Kao2y ago
Don't try to mimic the behaviour of your unity visual scripts before having the basics on C#
TheRanger
TheRanger2y ago
from what language is this syntax from?
Kao
Kao2y ago
That's like trying to learn driving by starting on a highroad or a mountain road
Hackmagician
Hackmagician2y ago
jesus take the wheel pepechrist
💖💕Flow💕💖
The funny part is that the only thing I wanted to do was set velocity when up arrow was pressed 🤣 Pseudo C# (Or if you want to know the context of the things used, Unity.)
💖💕Flow💕💖
AHAHAHHAHA I'M A C# MASTER /j
Hackmagician
Hackmagician2y ago
👏
💖💕Flow💕💖
I keep forgetting the ";" XD
💖💕Flow💕💖
i asked how to make a variable show up on a script, and after a bunch of people screeching at me to watch a tutorial, someone finally told me how. yaaaay.
💖💕Flow💕💖
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Jump : MonoBehaviour
{
public string didyouknowthat = "Did you know that the world is a dodecahedron?";
public string Replace = "dodecahedron";
public string with = "cube";
// Start is called before the first frame update
void Start()
{
string displayDYKT = didyouknowthat.Replace(Replace, with);
Debug.Log($"Hey guys! I just got a message {displayDYKT.Length} characters long! It says: {displayDYKT}");
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Jump : MonoBehaviour
{
public string didyouknowthat = "Did you know that the world is a dodecahedron?";
public string Replace = "dodecahedron";
public string with = "cube";
// Start is called before the first frame update
void Start()
{
string displayDYKT = didyouknowthat.Replace(Replace, with);
Debug.Log($"Hey guys! I just got a message {displayDYKT.Length} characters long! It says: {displayDYKT}");
}
}
Hackmagician
Hackmagician2y ago
👏
Mayor McCheese
You're my hero right now
Hackmagician
Hackmagician2y ago
it's not gonna be a float so no need for 50f, just 50 works .Length is an int property 🤔
💖💕Flow💕💖
Oh yeah, I forgot I made it a float for some reason lol The Unity server is so unfriendly, I was literally crying half an hour ago all because I shared a couple lines of code and it devolved into a huge argument. Literally nobody was being constructive there I think I've learned enough C# to attempt something new.
Mayor McCheese
I mean... if you said I know a lot about c# minus the syntax, can you blame them?
TheRanger
TheRanger2y ago
i know alot about rust minus rust 😛
Mayor McCheese
I don't know your mom.
TheRanger
TheRanger2y ago
? what
Mayor McCheese
Nm a silly joke
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server