#💻┃code-beginner
1 messages · Page 844 of 1
It's physically impossible for your game to have change, on its own, over night.
well yeah but I did have unity running while I was playing some games last night
so Id assume I pressed something that changes something
When it wasn't in focus? Impossible
without realizing
Anyway, you should just figure out the problem, rather than why it happened.
i cant think of any hotkeys no
How are you handling the jumping now?
this does sound like you don't have version control?
Check the values for it, if they're something you've tweaked before.
If the code isn't framerate independent then having other programs running in the background might have made the editor run at a slower framerate
and make it behave differently
Just double checking but the gravity on the Y axis should be -9.81 right?
yeah
Hi everyone! I'm new to Unity and game development. I want to create my first 2D game for Android (it will be a RPG. What tutorials, documentation, or learning paths do you recommend for a complete beginner? Thanks!
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
Okay I can confirm that its not something in my code
Because I have a player 2 that hasnt been updated with all the new good code Imade for player 1
ITs def something within unity specifically like in the settings or inspector
can you elaborate on how this somehow confirms it isn't the code?
My player 1 uses a statemachine and its own controller scheme while player is super outdated code thats the most basic getkey code with very basic functions. Im very aware that these def work and I dont touch player 2 at all
So if player 2 is descending just as slowly as player 1. This most definitely means that its most likely a universal unity thing that I mightve done on accident
unless you've made a similar mistake with your logic. but we won't know that if you keep making assumptions and don't share the code
I guarantee you its not but dw about it
there's an easy way to prove it isn't the code (which it almost assuredly is), and that's by showing the code
Can someone tell me why it is spawning 2Objects and not 1?
Perhaps you have two copies of FlyingObstacles in your scene!
Otherwise, I see no reason for this to happen
GetKeyDown is only true for one frame, and Update runs once per frame
to quickly check, search the Hierarchy for t:flyingobstacles
this will highlight every game object with that component on it
there def is at least two
I got it tysm guys
i wonder if that counts two instances in a scene as one reference
(since that's one asset (the scene) that references the type)
Hello ! So i have a small question regarding StateMachine.
Some logics, kind off..
So my enemy have a lot of states... Two of them being :
- Moving
- Tracking
When moving : The AI's go left and right, turn when touching a wall / getting of ledge, etc
When Tracking : The AI's walk toward the nearest player.
And im wondering how i should organise my Script... To walk, avoid hole, touching wall, i want to copy/paste the code from moving to tracking, but that would be ugly. I don't want to put too many code on my StateManagerHandler, so im wondering in your opinion what would be the most efficient way of doing that...
Thanks ! :)
i have some assets that only appear in vr mode
because they're tied to the controllers
basically its a series of lights
that are rendered ontop another asset
that is on the controller object
how do i locate the lights and adjust their position in space?
without needing to run the app in vr every single time
the copy pasting code issue could be solved by having tracking inherit the moving class
that way you can freely use moving class' methods in the tracking class
(or have them both inherit a third class)
why are moving and tracking doing the actual movement ? instead of just defining where destinations should be
moving state is a bit vague in itself you probably just want to define what its doing
ie. Roaming/Patrolling vs Seeking/Tracking etc
I get your ideas.. Thank you for giving them to me ! Ill try to see what i can do ! :)
can someone assist me on something
!ask
:thinking: Asking Questions
:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #🔎┃find-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.
-# For more posting guidelines, go to #🌱┃start-here
I am using URP
Beat me to it lol
when I set the "background type" under environment tab in camera to solid color
when I set the "background type" under environment tab in camera to solid color and set the color grey I get weird rings
that's a solid grey screenshot
I don't want that I want flat grey
all grey
You have a vignette post processing effect enabled?
Zoom in
ah i see them now lmao. that's really subtle. or my screen is shit
the opposite
Had the same problem lol
I don't have any post processing effect enabled. It only happens on grey colors and not on any other colors
Theres a setting in called "HDR Color Buffer Precision"
try setting that to a higher value like 64 bits
i think the default is 32 so it could be causing the color banding
under which tab is it?
Seems like a bit depth issue yeah, might not be visible on other colors without checking with a color picker tool
(or increasing contrast on a screenshot using your go-to image editor)
Yeah there's like 2 bit differences between each color
(contrast adjusted)
that only increases the number of rings
well yeah
thats a good thing believe it or not
it just means its trying to blend more of the colors together
wait i just realized
since i need flat color I can just use ui with a flat color as background
but that would block objects being on the screen
nah 3D but I need a flat background to highlight a sphere
this sounds like an XY problem if ive ever seen one
how about you tell us exactly what you are trying to accomplish and how, and there might be a better solution out there
I just need a flat grey background and a sphere
Like how you render images from blender
it's definetly something to do with hdr
since messing with the setting does something
nvm
vignette was on
ur were right gang
Oh well, that solves it, glad it's not some obscure bug or limitation of the engine
Using shadergraph, how can i use Image color only though code?
"Disable tint" completely shuts it off, meaning i can't get it through _MainColor
But not disabling lets it tint again after the shader's effects.
I'm making a progress bar that greyscales the texture where its consumed, but still want it to be tintable for the full part.
Then you need to branch the colour to either be normal or greyscale (or lerp between normal/greyscale)
ask more in #1391720450752516147
(I hope this counts as beginner, since I am) I'm trying to get a movement system, and my current method involves actions increasing specific directional speed variables and Translating my player by each variable in their respective directions. however, this has the side effect of the object's rotation controlling trajectory in air, because the code just tells it to move forward relative to the player, so when the player rotates, the trajectory changes. is there any way to not have that happen?
youre going to need to maintain a seperate velocity vector in world space and rotate independently from that
instead of constantly using the objects current forward/right vectors
can you share the code you have
📃 Large Code Blocks
Use links to services like:
https://pastes.dev/
https://paste.yunohost.org/
https://share.sidia.net/
https://paste.ofcode.org/
https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
Nah, it's on a school computer and I just got home. thanks for the advice though!
If you are using Transform.Translate, it uses local space by default but you can pass in Space.World as an extra argument to make it translate in world space
I thought about that, but that means I would have to find a way to save the exact trajectory values, no matter which way I'm rotated.
Storing values in variables is common. Come back when you have the code to show
This script is supposed to affect only objects with a specific layer or tag. However, for some reason, it is also freezing UI elements such as buttons.
Why is this happening?

!code
But also this doesn't look like it does literally anything with layers or tags
There's no command called `code
but`.
!code
📃 Large Code Blocks
Use links to services like:
https://pastes.dev/
https://paste.yunohost.org/
https://share.sidia.net/
https://paste.ofcode.org/
https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
Ah, wait, there's more than I saw, because it truncated (reasons why to use a paste site)
Try adding longs when shouldPause is set to true, log which object and the layer/tag, and see what's causing the objects you want to exclude to pause
thanks! it worked out
is it bad practice to modify other variables in setters, like this?
private int _health;
public int health {
get;
set {
_health = Mathf.Clamp(value, 0, maxHealth);
healthBar.material.SetFloat("_Progress", health);
}
}```
It's not ideal, but if you document it, it's fine. I'd prefer an explicit method though.
One functional issue that I can think of is if you want to modify health at some point when healthBar or it's material don't exist, you'll get a null reference error.
yeah its not too big of a difference but i tend to do
private int _currentHealth //named current because i tend to have a _maxHealth
public int CurrentHealth { get => _currentHealth; set => ModifyHealth(value); }
private void ModifyHealth(int value)
{
_currentHealth = blabla;
}
i prefer to have my healthbars watch an entity
rather than the entity directly telling the healthbar to update
(this could be done with events, or it could just be done once per frame)
after all, some enemies might not have a healthbar; others might have a fancy healthbar that behaves differently than usual
or maybe an enemy has 100 healthbars as a joke
I don't disagree with what your saying but I do think that starts to approach the "it depends on the game" point
yeah – and if you do realize this is a problem, you can easily refactor
dlich just brought up a useful point: "hard-coding" something adds constraints to your design
of course, designing your game so that there are zero assumptions about anything is a recipe for disaster
where everything is so abstracted that you can't figure out what the game actually does 😁
Frl
Still highly depends on the game but this is one of the rarer examples where optimization stuff can potentially matter too since it's hitting ui stuff that updates often and might scale
How would I move an object in relation to the rotation of another object? like say I had an object that is at rotation 90 degrees, and another at 0 degrees. how would I move object1 forward based on the rotation of object2 (so forward for object2, but left for object1)?
Hi guys lm new lma try and make models but ye
use the other's rotation in calculating the direction, you could also use the Transform/InverseTransform methods
can InverseTransform, instead of switching from world space to local space, can it switch from the local space of one object to that of another?
read the doc to find if it's got a method to
MUCH appreciated man.
(this isn't sarcastic or anything, genuinly thank you)
does anyone know any good beginner ui tutorials i want to make a stamina thing
Hello, guys! I see Dot() has two method overloads the first one takes Vector3 lhs and Vector3 rhs so I think left hand side and right hand side, but also there is another one which takes in lhs and in rhs. So, in which case do we use the first method overload and in which the second one, basically I know about the first one it is way to find the field of view of an npc for example if its 0 its perpendicular if its greater than 1 its in front of the player if less that -1 player at the back.
i don't think you really need to choose?
they do the same thing
The
inmodifier is required in the method declaration but unnecessary at the call site.
so you could get that second signature even without doing anything i think, if the first signature didn't exist
The
inmodifier enables the compiler to create a temporary variable for the argument and pass a readonly reference to that argument.
i think it's just a compiler/optimization thing
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/method-parameters#in-parameter-modifier
you don't need to worry about it
You can gain performance optimization by defining methods with
inparameters. [...] Declare in parameters to specify that you can safely pass arguments by reference because the called method doesn't modify the state of that argument. [...] You explicitly add the in modifier at the call site to ensure the argument is passed by reference, not by value.
oh, ok. So, it is used to pass arguments by reference but keep them readonly. So, I assume if you dont have to change the lhs and rhs then you use in modifier, and I cant think in which case you would have to change them to tell you the truth.
In which case you have to change the lhs and rhs at runtime and this is another interesting question?
you don't have to mutate the parameters (you can copy them), but it's possible, so the compiler has to make that behave correctly
it does that by copying the value types
if you know you aren't going to mutate them, in marks them as such so it doesn't have to make the copy just in case
i unbale to fit ui on every phone screen i made in 1920*1080 after apk build it not fitting in any device screen
Is there a way to get the selected index of an array in the inspector, or whether the array is selected? I want to display different info depending on which index is selected.
maybe with custom inspectors/drawers? i wouldn't bet on it though
Gotcha... I figured this was pretty far fetched lol. There's probably a way, but it'll be pretty hacky.
Hey, guys! Why characterController.velocity is read only?
rb.linearVelocity is not if we compare them
CC and RB aren't the same, perhaps...
tl;dr: CC doesn't move with velocity. this one is computed from the Move that happened in the previous frame
So I have to use Move first if I want to use velocity right afterwards?
and it has to be assigned to a variable?
because its readonly
no? why would it need to be
what, do you want to modify the velocity?
oh
CC.velocity does not expose internal state like RB.velocity does, it reports what it did the last frame, caused by Move
oh ok so thats why it is readonly
that's what the docs say, yeah...
if it doesn't move with velocity then how it moves?
Character controller uses kinematic based movement right not physics based
right?
Move sweeps (to handle collision) and teleports, something like that
Heym guys! Normalize() and normalize are the same thing right? if I do moveDirection.Normalize() its the same as doing moveDirection.normalized right?
its just used in different context right?
one mutates, the other does not
(normalize is a verb, normalized is an adjective)
they both refer to the same concept of normalization, and both use the same math, but they don't do exactly the same thing
Dont remember if ReorderableList has that exposed but thats what I'd look at first. Also #↕️┃editor-extensions probably knows
(But yes, it is custom editor/drawer stuff)
You're supposed to keep track of/provide the velocity yourself, like pretty much every CC example shows
does rigidbody2d variables not take .isKinematic anymore? It gives an error for me
And what is the error?
oh .isKinematic is just deprecated, it says the alternative func to use
Indeed
Unity won't remove features suddenly, without a clear explanation on how to update
question, I have this script to run the enemy turn coroutine as many times as there are enemies on board, which currently works except that they all do it at the exact same time, even though the coroutine has several WaitForSeconds commands, including one at the end. How do I fix?
is this script on each individual enemy?
you're starting all the coroutines during the same frame. add a yield return waitforseconds after your startcoroutine(enemyturn(i)) line
okay its working thank you
its a singular battlesystem script
if the first screenshot is from a coroutine you could yield return the inner coroutine to wait for it to finish as well
Could anyone recommend some good beginner course/resource for C# (I am doing this in conjunction with Unity learn), would appreciate any insights
there are beginner c# courses pinned in this channel
My enemies stopped spawning when the game starts for some reason? I'm not sure what happened because I didn't change the script anywhere near the battle setup part
lemme just find a way to paste the script
but there's no error messages too
!code
📃 Large Code Blocks
Use links to services like:
https://pastes.dev/
https://paste.yunohost.org/
https://share.sidia.net/
https://paste.ofcode.org/
https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
nvm got it, it was an editor issue not the script
i saw this tab from a unity asset and i was curious what are these called? this layout in the inspecter can be added from the unitys windows menu like after you download the asset. is that what its called? Custom Unity Toolkit System is that a thing? i searching the internet rn what this is called and how to make it.
its a custom editor window
its not a part of the inspector itself at least it doesnt appear to be
so i was sort of close i see
alright ill study it all soon thank you i just need what that is called lmao
Does anyone know why this is being flooded to my console? It's just print("Money in sell area: " + moneyInArea); and this didn't happen before
It will print that every time that line runs
if you're getting multiple prints, you're running that line multiple times
It's getting called every frame, but what I mean is there would usually be a number next to it and that's how many times it was printed
It does that when Collapse is enabled in the console
Must of turned it off on accident lol
Hey guys so I have little planets in a my main menu that randomly generate with a seed.
Not anything complicated, but they each have values like "planet size" which is an enum with 3 values.
When clicking on these planets I want to to load the level WITH these stats.
Since the stats are on these monibehavior planet objects I'm not sure how I can tell the next scene what values to use.
I shouldn't be able to use scriptable objects because each planet has random stats
You could put the options onto a DontDestroyOnLoad object, and have the things in that scene read the data from that object before initializing themselves
I am new to this, what is going wrong?
did you read what it says
Make sure that there are no compile errors and that the file name and class name match.
Fixed it. This line was ruining everything
!ide
If your IDE is not autocompleting code or underlining errors, please configure it.
Select one:
•
Visual Studio (Installed via Unity Hub)
•
Visual Studio (Installed manually)
•
VS Code
•
JetBrains Rider
• :question: Other/None
not entirely sure why that namespace would cause that problem though
Ambiguous reference exception
is it not a namespace from a library that isn't included in unity?
I bet it has a class named "Transform"
huh, funny: it has a type named TransformBlock, but not just Transform...
A common source of this kind of problem is:
using System;
using UnityEngine;
...
float wat = Random.value;
System.Random and UnityEngine.Random are ambiguous here
New problem, can't get my camera to move with this script
-# this is what I get for trying to follow a 4 year old tutorial
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerCam : MonoBehaviour
{
public float sensX;
public float sensY;
public Transform orientation;
float xRotation;
float yRotation;
private void Start()
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
private void update()
{
// get mouse input
float mouseX = Input.GetAxisRaw("Mouse X") * Time.deltaTime * sensX;
float mouseY = Input.GetAxisRaw("Mouse Y") * Time.deltaTime * sensY;
yRotation += mouseX;
xRotation -= mouseY;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
// rotate cam and orientation
transform.rotation = Quaternion.Euler(xRotation, yRotation, 0);
orientation.rotation = Quaternion.Euler(0, yRotation, 0);
}
}
you need to config your IDE first before anything
(this should also point to the issue)
then its not a bad idea to take few basic c# courses
also, don't use deltaTime with mouse input. it's already per-frame
so yeah fix your ide
UNT0033
How much do you guys rely on Namespaces? What I mean is: do you still make sure every class is named uniquely or do you rely on the namespace taking care of it?
Like imagine you could need multiple "ScreenController" classes.
Would you just always name it "ScreenController" but with a different Namespace or rather "XScreenController", "YScreenController".
I'm a little scared of namespaces now because I had twice the problem that the IDE was confused when a class had the same name.
Fixed it, the issue was a typo, I was supposed to use capitalized U in "Update", but I used a lowercase one
Good idea lol
we all saw that lowerCase u
a properly configured IDE would give you code suggestions and show you errors
yes, a configured IDE would basically underline, offer suggestions, because its connected to unity and most of these have warnings
Yep, I made some adjustments, and added a few missing plugins
make sure every class has a unique qualified name (aka namespace+class name)
they need to be unique to be valid, and also if they're different, they should be named differently to reflect the differences.
the difference in naming could be provided via a namespace, or just more descriptors in the class name.
whether you use namespaces or just extra descriptors is up to preference and whether you need grouping of other classes within the same namespace as well.
X.ScreenController,Y.ScreenController and XScreenController,YScreenController aren't that different to read.
Thanks Pekora 
I'd use the former if it's uncommon to –
[power goes out]
– use multiple screen controllers at the same time
that was annoying
(of course, you can also do both: X.XScreenController)
i do that for a procedural generation system
it has stuff like WorldGen.Sources.Floats.LiteralFloatSource
so i want to spawn a decal on partical hit the ground but how do i make the position as the hit position
https://docs.unity3d.com/ScriptReference/Object.Instantiate.html
Find one of the forms of the function that take a position as a parameter, and make sure to give it every parameter it needs
ik how to do that but i meant how do i make get the position of collision hit
your Instantiate method is corrupted
ahh sorry i cant access the collision getcontact bec the func doesnt have collision it says gameobj
Then the best you can do is the object's position
do you not have a ParticleCollisionEvent list defined in this code?https://docs.unity3d.com/6000.0/Documentation/ScriptReference/MonoBehaviour.OnParticleCollision.html
heck it shows how to get the collision position in the doc of OnParticleCollision
So could I just make the script that holds that data
"DontDestroyOnLoad this"
It would persist but sounds strange to just have it lingering in the scene, and I would need to find it from whatever scripts needs that information.
Would there be a way to just make a custom serialized class for this?
That is what the Singleton Pattern exists to solve:
https://gamedevbeginner.com/singletons-in-unity-the-right-way/
You'd make a manager that always exists, modify the data in it through static reference, and make it persist between all scenes so the ones that need it can read from it
Hi, i dont know why but i cant go near any of my prefab now, when i go near any object they fadeout like i have a huge hitbox and make me unable to "aproche" them
Im sure it a small editor settings but i cant find it :0
Hit F with a small object selected
The problem is that unity has your scene-view camera configured to show a very large object
It adjusts the near and far clipping planes (which limit how close/far an object can be and still render)
that worked thx!
okay i see thx ^^
so I've been pondering something
I want to set a button that can activate/deactivate a set of prefabs
the player will land on it and that array of prefabs will deactivate, they act as a barrier
consider sending your entire thought as a single message
sometimes the answer pops out just while typing it all out too
well true, let me rephrase it then:
I want to set a button that can activate/deactivate a set of prefabs, the player will land on it and that array of prefabs will deactivate, they act as a barrier that will block the way. The thing is, in the array, it only deactivates the last barrier of the array.
I have an interface that controls the button logic to Activate(), Deactivate() and Toggle(). So why is it the last Prefab of the array the only one deactivating?
//interface code
public interface IFloorButton
{
void Activate();
void Deactivate();
void Toggle();
}
//Barrier State code
public class BarrierSetState : MonoBehaviour, IFloorButton {
private Animator m_Animator;
[SerializeField] public BoxCollider2D m_Collider;
[SerializeField] private bool isActive;
private void Awake()
{
m_Animator = GetComponent<Animator>();
m_Collider = GetComponentInChildren<BoxCollider2D>();
}
public void Activate() {
m_Animator.SetBool("isOpen", true);
m_Collider.enabled = false;
}
public void Deactivate() {
m_Animator.SetBool("isOpen", false);
m_Collider.enabled = true;
}
public void Toggle()
{
isActive = !isActive;
if (isActive) {
Activate();
}
else {
Deactivate();
}
}
}
//Button code
public class FloorButton : MonoBehaviour
{
private Animator m_Animator;
[SerializeField] private GameObject[] m_AttachedObjects;
private IFloorButton m_Button;
private void Awake()
{
foreach (var ObjectInArray in m_AttachedObjects)
{
m_Button = ObjectInArray.GetComponent<IFloorButton>();
}
m_Animator = GetComponent<Animator>();
}
private void OnTriggerEnter2D(Collider2D collider)
{
if (collider.gameObject.tag == "Player" /*|| collider.gameObject.tag == "Dynamic Object"*/)
{
Debug.LogWarning("Collision! Activating...");
m_Button.Activate();
m_Animator.SetBool("isPressed", true);
}
}
}
foreach (var ObjectInArray in m_AttachedObjects)
{
m_Button = ObjectInArray.GetComponent<IFloorButton>();
}
what do you think this code here does?
well... is supposed to set the interface to every gameobject in the array
clearly
it doesn't do that
how many objects do you think that m_Button variable can hold?
-# hint: it is declared as private IFloorButton m_Button;
well can interfaces be arrays???
an interface is a type
the interface cannot, no. but the variable of that interface type could be instead, yes
IFoo is a kind of thing. IFoo[] would be an array of those things.
honestly though, that interface could really just be a component where it maybe has some unity events instead of method declarations, and other objects subscribe to those events. then you could drag the component references in the inspector instead of gameobject references that you then get the component from
so it would be private IFloorButton[] m_Button or private IFloorButton m_Button[]
well the latter isn't valid syntax. perhaps review the beginner c# courses pinned in this channel if you struggle with understanding the basic syntax of the language
ok thanks
bro are you on the spectrum or something? This isn't how normal people speak to each other.
You could have just left it at "well the latter isn't valid syntax. perhaps review the beginner c# courses pinned in this channel" anything past that was just being an asshole
someone's feisty eh
hey dummy your on a game development server
half the people here are on the spectrum
not really just think its a littel wild the same 6 people it in here and shit on new people
"100% of people are on the spectrum, it's a spectrum"
real shit
i think people can be a little harsh in wording sometimes but that one just wasn't at all
it's not shitting on new people it's telling them to learn correct syntax before it's too late, if you went into the industry and started doing whatever with your code's syntax you're going to get bullied and judged
nah what he said was needlessly harsh
dw, I don't mind, but thanks to look around
I'm a bit rusty on c#
haven't been programming on it for a good while
Genuinely homie I think your reading into it, It's not harsh at all
imo it couldve been worded more gently but the content is appropriate
basic syntax isn't like a slight, it is what that means
literally was just "if you're struggling go review". anyone reading any further into it is just looking for a fight
i mean, telling someone "you don't understand this yet" kinda necessarily has a degree of harshness to it
honestly the last thing I need is people being soft about it, better to tell me "hey you are wrong here" than just being possitive in a way
this whole convo shouldve ended 12+ messages ago
again he could have just left it "well the latter isn't valid syntax. perhaps review the beginner c# courses pinned in this channel" anything he said beyond that was just him being an asshole
if not, the toxic positivity mindset takes over and it gets everything worse
and I agree with nav
mentioning basic syntax as a thing to focus on is beneficial.
its just you homie
nah yall are just chronically online or somet;hing
its valid syntax, just not for C# . The suggestion as valid
i mean sure, again its a game dev server 😭
someone would crashout on you if you said that to randoms in public
you being atticus doesn't change how OP decided to take it..
something tells me boxfiend gets punched in the mouth a lot
programming advice is a different context to talking to random people in public
are you okay
in a discord server about making video games it kinda makes sense that we're online, you know cause it's not like video games can be made in the grass
i agree it was harsh. telling someone "you are wrong" is necessarily harsh.
it couldve been worded more gently. quite subjective as to how important that is to prioritize.
i disagree the part about basic syntax shouldve been left off. that's useful information to the learner about what to review.
I am just gonna drop it but yall need to stop being assholes to the newbies smh
its daily in here i open this chat and see the same 6 people talking down to someone who has prolly been fucking around with the engine for 2 hours
maybe don't use being on the spectrum as an insult if you want people to take that advice seriously
it wasn't an insult. The dude is either autistic or he was intentionally being an asshole. Again well adjusted mentally well individuals do not speak to people like taht
brother
so you're saying being autistic is unintentionally being an asshole, or...?
and consider that just because something is said bluntly that doesn't mean it is an attack. people helping in here volunteer to do so, they aren't required to waste time blowing smoke up everyone's ass and coddling them
You typed more words just to be an asshole bro. Dont ping me.
those "more words" were useful info bro
i hope you feel better man
haha yeah
I've been using singletons for a while now but i cant use those for each indiviual planet object that can be selected, only the manager that handles them.
I have 2-8 planet that can spawn at once, all with unique values.
When i select one i need to pass those values to the next scene but just dont know the best way to do that, im familar with scriptable objects but i create the values for those in the inspector, that wont work here where i need the values randomized. Is there anyway i can create a custom "Planet attributes" that holds all the values and can be stored into the next scene and read for the values.
Basically is there something like a scriptable objects that i can create in code at will and pass it around like a variable
Make a planet attributes class that holds your data, and make a list of them on your Singleton. Add a planet? Add to the list.
currently in learn unity I think im stuck here
it gives me this error saying there is no definition for gameover
on my other code, I've already added getcomponent to connect the codes
Please don't screenshot the status line... 😅
Open the console tab/window and either screenshot the error there or copy paste it.
And then also share code correctly. (upload the whole script/s to paste sites).
!code
📃 Large Code Blocks
Use links to services like:
https://pastes.dev/
https://paste.yunohost.org/
https://share.sidia.net/
https://paste.ofcode.org/
https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
Also, your ide looks weird. It's like it's both configured and not configured at the same time. 🤔
Likely didn't save the changes.
I tried making a new function to add a debug log
it printed
then deleted it again then
added what I meant to added
saved it like 4 times
thats weird
anw thanks for answering my question, glad it worked out somehow
https://pastes.dev/rAptKEqNQD (Target) https://pastes.dev/SueBKcytad (Game Manager)
Why does everytime I click to destroy the object somehow my unity freezes, and used up to 50gb of ram
I trie removing the particles and it worked
after I tried doing it again it freezed up again (without the particle)
nvm, camera issue, I tried switching to the game view without the dev view it worked out fine somehow
froze up again when I added the prticle

nvm I added while instead of if
I think im gonna sleep today geez
question, does anyone know why my shadow type on my light doesn't change it at all between shadow types? like i toggle between the soft and hard, but the light doesnt visually change.
Any help?
Can anyone help me make a UI come up on my hand for a game
!collab
:loudspeaker: Collaborating and Job Posting
We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
• ** Collaboration & Jobs**
Sonion I just need help
yea
click the link the bot sent
additionally if you need ui help (not people to make it) maybe suit #📲┃ui-ux
That's not relevant for collaborations
They just need to use the proper channel
You won't get an answer unless you have a genuine question about current UI. We don't do handholding, nor do we have a single clue what your game is even about. And as mentioned above UI goes into #📲┃ui-ux
Alr ty
whats happening why is there a weird jitter blur thing going on whenever i move and move camera simotaniously
Likely an issue in your movement or camera logic. To put it simply, there's a desync between rendering frame rate and your movement/rotation.
If you share your camera code would love to help
Heya y'all, this is probably a very basic question but how do i make it so the raycast is attached to the object instead of following it? i have mainly found people doing it this way but it kinda messes up my jump a lot where it stays stuck in the body and doesnt go back down which means no jumping..
Debug.DrawRay(transform.position, groundcheck * 1f, Color.red);
if (Physics.Raycast(transform.position, groundcheck, 1.1f, LayerMask.GetMask("Ground")))
{
IsGrounded = true;
}
else
{
IsGrounded = false;
}```
Thought it'd be worth asking here cus like i said, i mainly saw people using a transform.position.
wdym by attaching it instead of following? Attaching implies following
it's pretty unclear what the issue you're experiencing is, could tou elaborate
ah yeah sorry, basically what i mean is as if ur parenting it onto the object, same for if i would put the camera on the capsule as a first person camera, what its doing rn is following the transform by code, but its slow and follows behind with a small bit, what i want it to do is move as fast as the body itself, i might be able to record it if im still not making much sense
what is following? the ray cast?
ya
where is this raycast called?
what are you using for your character controller?
a rigidbody or a character controller
rigidbody
then it should be fine
fixed update runs every physics tick which is the same as the rigidbody
i dont see the point of transform direction
you can just do -transform.up
oh yeah bet
also you can simplify that logic to a property
public bool IsGrounded => Physics.Raycast(transform.position, -transform.up, 1.1f, LayerMask.GetMask("Ground"));
additionally I reccomend using a SphereCast instead of a ray cast, since the ray can give you false negatives when the character is hovering over an edge
(false negatives)
Hey does this server allow asking for help when it comes to modding an existing game?
if (Physics.SphereCast(transform.position, 0.6f, -transform.up, out RaycastHit hit, 1.1f, LayerMask.GetMask("Ground")))
{
IsGrounded = true;
}
else
{
IsGrounded = false;
}```
Came to this currently, idk if i did it correctly, i did add an OnDrawGizmos but the shape it draws isn't fully 100% correct on where its at, it still stops me from jumping quite a few times.
Nope
Ok thanks for letting me know, anyone knows a server for that?
i wanted to ask about how unity's tileset system works
so i have been working on a top down game
and i know about unity 2D tile set
i wanted to ask wether it would be better to create a fallback custom system for map saving
or using unity's inbuild system would be better?
could you show the gizmo call and elaborate on how exactly it isn't correct? perhaps show screenshots
{
Gizmos.color = Color.red;
Gizmos.DrawSphere(transform.position - transform.up * 0.6f, 0.6f);
}```
the issue is mainly that if i jump once or twice i cant jump for a solid bit, when i move normally the spherecast or raycast resets to its original position and allows me to jump again, and sometimes even then it doesnt...
oh..
spherecast is not just a sphere, it is a sphere moving along a direction for some distance
ohhh
when i move normally the spherecast or raycast resets to its original position and
your cast is attached to the transform here. do you hvae multiple objects lagging behind each other or something?
I think a check sphere is more what you want
not that im aware of, everything else moves with it straight away, i only got the camera parented and nothing else is attached in any way if its either by code or parented
time to learn that i suppose! :D
if i wasnt able to phrase that correctly
in unity when placing the tiles for a top down game
there is the usual way of making a tileset using the game assets and painting the map using that
but what i wanted it type of a fallback system, for when it isnt able to find a type of asset it uses a default asset assigned to it in the given category
could you show how exactly it's lagging behind in a screen recording or something
i could show with raycast, gizmo doesnt show it, holdup brb
here, its going quite alr for whatever reason now but i was spamming space bar so sometimes the raycast didnt come down for a solid sec, its been worse before recording tho
Debug.DrawRay(transform.position, groundcheck * 1f, Color.red);
if (Physics.Raycast(transform.position, groundcheck, 1.1f, LayerMask.GetMask("Ground")))
{
IsGrounded = true;
}
else
{
IsGrounded = false;
}```
and what method was this in?
fixedupdate
could just be the lag from that, perhaps
! basically returned it back to the beginning to show the lagging behind, it does it both for spherecast and raycast
There's no command called
basically.
shh, didnt mean it as a command mate :)
if you put the debug call in Update, does it still lag behind
lemme check
yep still lags behind
is it maybe easier if i just add a sphere as a child, turn off mesh renderer, add on collision enter & exit and just communicate that bool to the other script to allow me to jump n such?
that'd be one way to do a groundcheck yeah
it could be a trigger and then you wouldn't have to put it on a separate object really
that aside though.. this really seems like you have objects following each other, is this script on your player? and could you show the hierarchy of the player
its with netcode btw, but i build the character controller before i added it so it shouldnt be that, the jump was already buggin beforehand, but thats why its a prefab basically :)
facing is just a small cube to show me where im facing for sanitys sake
ok im testing the trigger in the hopes that that will do and save me from more raycasting & such 😭
hi
Im trying to make grid based building system and I need to change pivot point for my buildings
is there any easy way to do it ?
(sorry for my bad english)
Put in a game object container, or use any 3d software to change it, like ProBuilder or Blender.
Thank you
easiest way: give them a parent gameobject and use that as a pivot
Is AI good in C# ?
||You shouldn't have written this... run||
Like if i want to correct something
really only going to harm you in the long run for short term benefit
I dont understand 🙁
Like for exemple claude or geminie
yes
the issue with AI is that its short term usefulness is not worth the long term effects it can have on a persons skill
its simply not worth using
especially not for beginners
for coding, it's a tool that requires a good understanding and solid experience of the environment you're working in to be effective. as a beginner, it's not going to help you learn, and you won't have the skill or knowledge to use it effectively.
Correcting something with ai is the worst thing it can do
Hey, guys! I cant understand why the Unity doesn't throw an error when you are trying to pass vector2 to vector3
I mean syntactically its wrong and it will behave weirdly
I had a problem with animation only to realize that I have used Vector2 instead of Vector3 and I have stored on my moveInput Vector2 not Vector3
I mean I lost my entire day and Unity would have to throw a warning or an error at least
Casting Vector2s to Vector3s is a completely normal thing to do. MoveInput being on a Vector2 sounds completely standard, how are you inputting a Z-axis?
it's not syntactically wrong. if it were wrong it'd be semantically wrong or incorrect in types
I like that unity has support to cast between these types so easily
when i schedule a job does the job struct get copy on every worker thread for each execution or all of them able to access that one instance ?
Must be copied, because writing to fields in the struct in one job execution doesn't affect others. Any writing must be done in native collections.
dang guess i have to make it small, did you read this anywhere tho
Are you worried about the size of the struct in memory/memory bandwidth?
just that i could do something a bit more work to avoid the memory and copy cost together, i have always thought it is shared fr
I'm just gonna say it's probably negligible compared to the overhead of starting the job/spinning up the threads
How to ragebait part 1 lol
Yes it is okay if you are aware of many things regarding its usage. If you just rely on AI to do everything - it will fail, if you enchance your skill with AI or make it do repetitive work like generating a long simple code that needs to be written anyway - its a great tool.
Being called "Norman" in front of a French is the best way to ragebait actually
||Because one of the biggest pred on the french Youtube also was called Norman :(||
that "if" is pulling a lot of weight. a beginner would not be aware and may not even know about what to be aware of
i changed it a little but now its even jittering weirder
i heard of cinemachine is that any good
Don't scale mouse input by Time.deltaTime. Learn why...
also yes, use cinemachine
i took off time.deltatime and itss till blurry i put on interpolate and the dynamic update thing and everything
am i just missing cinemachine now
"dynamic update thing"?
for input system settings
moving horizontally is smooth now but camera rotations when moving is when it loooks weird
hola gente buenas tardes soy de argentina y estoy empezando como programador, aprendo rápido busco algún mentor que pueda ayudarme en mis primeros pasos. quiero hacer un juego en 3ra persona ¿alguien que le gustaría ayudar?
this is an english only server sorry
Todo aquel que lea este mensaje, estoy empezando a crear un juego survival 3ra persona, pero necesito ayuda soy nuevo ¿alguien me daria con algunos consejos para empezar o que me ayude en el camino? gracias manden un mesaje y los leo
this is an english only server my friend
i know little englis
if you need to ask something use google translate, we cant and wont be translating what you are saying just to understand you, if we dont speak the same language
Does disabling domain reload not work with non serialized actions?
"non serialized actions"?
i'm not sure what that means
err
(I know actions are not serialized, but I put it there to kinda force the point across just in case)
if an object survives from one play session to the next, then those fields will retain their values
(I don't recognize the ClearOnReload attribute)
what does "not work" mean?
Well, I'm pretty sure somehow they're retaining the values from the previous session
Maybe because they're originally stored on scriptable objects?
yeah thats how scriptableobjects work
This code only works for static data
still waking up, sorry aha
so it's not going to do anything to OnStart or OnComplete, since these aren't static fields
Yeah I know. Those were just hail mary's
What's the "correct" way to clear scriptable object non serialized data on domain reload?
Someone might chime in with a stronger solution but i think if you have Awake and OnEnable both run a shared "init" function it should cover all the edge cases you need?
im trying to do this cinemachine thing i dont even know if im doing it right but its still there
ScriptableObjects will stay alive from play session to play session, so this won't help
notably, changing scenes will unload assets that are no longer referenced
but if you just enter and exit play mode in a scene, any assets that the scene requires will stay loaded
I'm pretty sure one of those runs? ill double check
OnEnable should run
They will run when the object gets loaded, but the object doesn't unload even when entering and exiting play mode
never a good idea to keep runtime state in a scriptable object
There is some SOAP system that tries to fix this but believe me all it does is fuck up your data at stupid times 😐
it's a lot like mutating any other asset, like a material
I was trying to store events in it
one place I do store runtime data in my ScriptableObjects is for my settings system
each asset corresponds to a setting
on startup, i store a default value and then, usually, overwrite it after loading the settings file
therefore, it doesn't matter if the object stays alive; it gets reset by my settings system on next startup
Though like Material modification you can make runtime instances of scriptableobjects which is a way to do this kind of thing
whatever subs should unsub on destroy/deconstruct (may cause infinite load)
Right; i should say like mutating any other shared object
I presume you're working with assets here.
e.g. you've created an asset out of the SO named "GameStartEvents"
and things in your scene reference this asset
Something like that. Its a bit more intertwined than just game start, as its for a Quest System
Its easier for a designer to set it up with SOs
A foolproof system that fixes this but keeps the ease of use would be an event bus that uses scriptable assets only for event ids/keys
Why does this cause problems?
Do you wind up trying to execute delegates from the last play session?
Yeah. I cleaned them up for now, by resetting everything manually before subscribing
I'm wondering why you're ever trying to call OnStart or OnComplete without ensuring that the object is configured correctly
ah, so it's less that you're trying to use it early
but the stale data from the last session still causes issues
I'm 100% sure its the stale data. I got the invocation list when I subscribe to it, and it was 2 for whatever reason. If I play after changing code, it works perfectly. If I play without changing code, it breaks
But nayway
Fixed it, I guess. Learnt something new
This is a good workaround. A bit painful to setup now, as its another system, but I'll keep it in mind
by "break" did it just throw a unity destroyed/missing exception?
Nah, I got some logs that were a bit shady. Basically, I got multiple logs for the same objective ID on consecutive play sessions
Event bus/signal systems can be hard to debug if overused so keep that in mind
They still don't error out presumably, because the other stuff reliant on this is kinda halfway there, and somewhat expectant to get called multiple times
Then yea post play clean up was required to unsub/clear events
If this is an editor-only issue, then my first thought is to just fetch all of the assets with AssetDatabase on startup and clean them up
And the assets its referencing is still other SO's so 😂
As long as you only ever set up the delegates once, you will never have stale data in the built game
(since the game will...you know, close)
Well, that would be great. Assumes I actually make a build of this game again someday
please help me I don't understand why the color is displaying lighter than it should be
this isn't a coding question
unless you're coloring those with script and you can show the script
I'd check the frame debugger first to make sure these sprites are really rendered with a bad color or perhaps something else is rendered on top.
If you can confirm it uses bad color there, I'd assume it has to do with the initialization timing.
Oh, I see you've been answered. Please avoid crossposting in the future.
okay, thanks for help
sorry for deleting immediately after posting, I posted the wrong screenshots.
For some reason, OnEnable on a few scripts is being called before awake on a specific script. The GameObject with the script calling awake is active upon play. everywhere I am looking says awake should be calling before OnEnable, so I'm wondering if there are other common reasons why this may be the case?
I've tested with debug statements and the debug statements in OnEnable are appearing before the debug statements in awake, and it also gives a NullReferenceException error for something set in that awake that is being called in the OnEnable script.
Hey, im fairly new to Unity, ive been watching a few tutorials and wanted to try making a dashing feature ontop of this 2D tutorial ive been watching.
It does "Work" the animations fire off, the player state is reset, gravity resets, im just confused as to why my player sometimes in the midst of their dash seems to stop or decide not to dash period (The animation still plays, but the distance they cover varies)
Im sorry if im leaving out important screenshots, I dont really ask in chats like this for help often if at all.
upon some further research, I think script execution order is something I'm going to look into and try to adjust, and also add a few checks/possibly coroutines to handle if it's taking a little longer than normal
!code
📃 Large Code Blocks
Use links to services like:
https://pastes.dev/
https://paste.yunohost.org/
https://share.sidia.net/
https://paste.ofcode.org/
https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
Awake should be before OnEnable since it's associated with something that loads first, what's telling you otherwise?
No idea what im suppose to do with this.
📃 Large Code Blocks
**Use links to services **
it's instructions to post code properly (not as screenshots and not as files)
it will make it much easier for us to help you
I put debug statements in the OnEnable function and the Awake function, both were enabled when pressing play, and the debug statement from OnEnable printed first. It also had code that relied on variables set in the awake function that were giving nullexception errors. I honestly am still not sure why this was the case, but I have fixed it and will cross that bridge later.
could you show those? and make sure to put in a context to make sure you're looking at corresponding logs, and that collapse in console is disabled
sure, give me a moment to recreate it
it is something I will need to have an actual fix for in the near future so I appreciate the help. i can comment out the offending code for now though.
where are animation events for EnableMovementAndJump, EnableDash, DisableIsDashing, set (eg which animation clip)?
they seem to have quite overlapping control, so they might just kinda be stepping on each other
They are set on the animation timelines, disabled at the start of the animation, enabled at the end
right, but which animations
playerMove has the EnableMovementAndJum
playerDash has the EnableDash, DisabledDash
I likely misunderstood what your asking
so it seems like perhaps DisableMovementAndJump is resetting the dash
hm, I'm having trouble recreating it. there are still heaps of other errors going on when I uncomment the particular offending code but it's something I feel like I won't have too much trouble fixing. For now I'm content with tabling it, but if I see this behavior again while trying to fix the other errors I'll come back. I think some of my fiddling must've fixed it.
so basically this - i think you should at least have each method have a separate role, also isDashing and canDash seem to overlap quite a bit as well (unless there's some cooldown?)
if playerMove is the looping animation for moving it probably shouldn't have these animation events though
Fuck sorry my bad... its not playerMove
playerAttack has those
my heads, sideways
gotcha
that makes more sense
in that case you could probably do away with all the canMove/etc and then set just isAttacking/isDashing and go based on those
probably, thankyou regardless.
I'm having trouble getting player movement/player controller scripts to really click for me. It seems like there's so many ways to write them using the new and old input system. Is there a sort of right way to always do it? Like specific rules to follow?
i can send you the old script if youd like and you can copy and paste it?
nope
why isnt this timer working i feel like it should be working
assumptions don't get you far well, you need to debug
Yes please, think I'm overthinking it all super hard
well it actually does work only when playmode starts
it doesnt happen again
what will that learn...
copy and pasting something is the same as blindly copying..
alr no copy and paste thenn
I can type it out and write comments to see if I understand what's going on maybe?
without executing it
yep smart
you're computing jumptimer and jumptime at the same time, jumptimer >= jumptime is just Time.time + 0.1f * Time.deltaTime > 1f which is almost always true
so the jumptimer = 0f doesnt just set it back to 0?
jumptimer is a local variable, so it's setting that one to 0. the next time you call jumping(), it gets a new jumptimer variable, which starts back at Time.time + 0.1f * Time.deltaTime
question how would I rotate a vector by a y from a Euler angle
use Quaternion.Euler to get a quaternion and apply it to the vector
Im totally a amazing programmer
Hello ! Im trying to give my camera to "Target", but it doesn't work wich is normal.
What can i do so that i can give a prefab the camera ? Thank you ! I tried "target = GetComponent<CameraShaking>();" which doesnt work-
is there a camerashaking component on that object that code is running on
If the CameraShaking component is on the main camera it's a special case and you can do target = Camera.main.GetComponent<CameraShaking>();
otherwise put the reference on the component that instantiates this prefab and pass it on
Which CameraShaking object do you want it to reference?
I'm getting this warning, why does it want this property as serializable? I don't really want it to unless necessary. It's not a data holder in a sense, that's separately. It has some runtime data.
Is it because it's public and shown in editor properties?
Oh wow sorry, thanks IAmBatny, Nitku & digiholic for trying to help, but a friend already did and i forgot to delete my message, sorry for that and thanks again ! :D
Is the type Serializable?
If you want this to be editable in the inspector, your Sudoku class needs to be serializable. If you don't need it to be editable in the inspector or saved to disk, you can probably ignore the warning
Sudoku class is not currently, error goes away if i make it
I don't need it editable
If it doesn't need to be serialized you can mark the variable as NonSerialized
Well, that's what the error is telling you. You're attempting to make it serializable with the public modifier but that would be impossible as the class isn't serialized. Thus a warning is simply given.
ok this makes warning away:
[NonSerialized]
public Sudoku sudoku;
Yep, that'd do it. Basically, you got one thing saying "Serialize this" and another one saying "Don't serialize this" and the compiler was just trying to guess which end of the problem was the mistake. Generally, people want variables exposed to the inspector, so it is probably designed to give that warning first
Just switched to Unity 6.6 alpha and it's giving more code guides than before, good thing i think
But also some things are becoming deprecated and i'll need to workaround
BinaryFormatter...
tbf BinaryFormatter has been obsolete for at least 6 years
at least it's not as catastrophically bad as, say, python's pickle
which will literally just run arbitrary code
That's what it does though
That's literally the problem, it serializes methods so you can inject whatever code you want
I was just using binary format because i like highscore table not easily editable. I suppose i should use some compression or format method instead then
oh yeah, if you want to discourage trivial editing, just serialize to json and encrypt it or something
it's obviously bypassable, but it'll make it slightly more annoying
You can still write binary files. Binary formatter is not the only way.
yes, BinaryFormatter just happens to be one way to do so
and it's supposedly super fast compared to string manipulation of JSON
it's still a bit more involved than literally just saying "run this code!", but yeah, it's pretty bad
https://googleprojectzero.blogspot.com/2017/04/
In an ideal world we’d find that one serializable class which just executes arbitrary code for us. Sadly (as far as I know of) no such class exists. So instead we’ll need to find a series of “Gadget” classes which when chained together perform the desired effect.
gadget-chaining is a fun topic
oh, lol, but then they explain that ObjectSurrogate lets you do this as long as you can find something that runs an arbitrary delegate
I doubt binary formatter is "super fast", writing to a binary file sure is usually faster than JSON but for you writing a score or whatever game state it won't make any difference. Even so, didn't binary formatter write a TEXT file with 0s and 1s in it? I might remember totally wrong but from my recollection, binary formatter didn't produce a binary file but a text file which is really silly to begin with
No it was really binary, scrambled bytes of 0..255 char code
aight, I stand corrected then. If this article is to be believed, it wasn't any fast though (much slower than JSON): https://medium.com/@maximn/serialization-performance-comparison-xml-binary-json-p-ad737545d227. I know it's old as ever, I intentionally searched for old stuff because all I can find now is info of the safety issues and deprecation
All the other performance comparisons I can find seem to indicate the same, at best comparable performance to JSON and XML serializers and definitely slower than other binary serializers like Protobuf. Fastest of all would probably be your own binary writer but that you probably shouldn't worry abou the performance unless you are saving a ton of data.
My best guess would be that it might rely heavily on reflection but I never looked into how it works since it has been known for a long time that it is insecure
Well, i know many games go the lazy way with data, at least including Civ V and so on with astonishingly slow turn change processing. You can only suspect they spend majority of time comparing strings
Very possible, but again, you would need to save a ton of data for it to matter. Especially if you only need to save at the start and end of the sessions, it wouldn't really matter whether it takes 1ms or 10ms would it?
no that's nothing, it's when it's 10000ms i twitch badly
Never played the game but AI overview seems to suggest the lag in question would be caused by AI navigation and such rather than any saving or loading. Believe me, you can serialize and deserialize a huge amount of JSON data before it takes 10 seconds. Unless you have gigabytes of data to store, you can use JSON without having to worry about anything with such generous budget of 10 sec 😅
well, that's not what really troubles me, it's that my json file now contains nothing but this:
{}
I debugged there are 12 tables that should be in it
Where's the trouble though?
string s = JsonUtility.ToJson(highScores, false);
Debug.Log(highScores.Length);
File.WriteAllText(highScorePath, s);
Would you mind sharing the whole script? It would be really useful to see what type highScores is etc.
public static HighScore[] highScores;
...
[Serializable]
public class HighScore {
public string[] name = new string[MainScript.NumHighscores];
public float[] number = new float[MainScript.NumHighscores];
public HighScore() {
for (int i = 0; i<number.Length; i++) {
this.name[i] = "-";
this.number[i] = -1f;
}
}
}
... there's some sub classes too
i get no hints or warnings about the codes
it saved perfectly when i still used the binary saving
only difference is json now
I haven't used JsonUtility for a long long time but I would bet it has something to do with highScores being static, unity doesn't serialize static members and JsonUtility follows the unity serialization rules
will change
BinaryFormatter or whatever else in System is not Unity so it doesnt follow Unity serialization rules
JSON.NET would do the same as the System one and serialize it..
but also do they really need to be static ?
i would do
[Serializable]
public class SaveData{
public HighScore[] highScores;
}```
Unrelated to this problem but I find this code little odd. I assume you are saving high scores for multiple levels or something like that. The class HighScore by its name sounds like it saves one entry but seems to be saving a whole leaderboard (which in my opinion would be a better name for the class)
It's working like that, a container class that includes the table in it, + it's no longer static
//public static GameConfig config = new GameConfig();
public static GameConfig config = new();
Is this really the recommended way now?
its not the recommended way maybe i'd say *preferred , its just an additional option when the type is already obvious, there is no reason to write it twice
both are perfectly valid, the former will give you backwards compatibility with older C# versions / Unity versions if you care about that
Hi, im trying to make a drop system for my inventory inside a 3D game. I have a prefab made for generic item type with some script to handle picking up and some thing stuff.
How do i go about generating the prefab inside my scenes when i want to "drop" an item to the ground. i found out about the Instantiate() function but i don't really see how i can initialize some value to my newly created game object.
If anyone can link me a good article or just a page in the docs to learn how to do that that could be awsome thx ^^
(i have bhen at it since 2hours on and off but i cant wrap my head around it)
Instantiate returns the newly created object. you should typically not use GameObject with it, instead use the type of the component you care about for the prefab and then you'll get that component from the Instantiate call
thx
Modder here. Is there a way to get all of the resources at runtime? I'm trying to get data from objects that are only loaded from prefabs at runtime.
we cannot help with modding unfortunately
That's fine. but it is a valid runtime Unity question.
I was using that. I expected <Object> to return the MonoBehaviours and the GameObjects using that. I'm probably just doing something wrong. Doing more testing.
Thank you for the response.
Make sure you did UnityEngine.Object and not System.Object
Luckily VS caught that for me.
Yeah, I was definitely doing something wrong. I was able to match up a MonoBehavior to a UnityEngine.Object when using FindObjectsOfTypeAll.
thanks again for the help.
whats <Object>
thx!
Breh I’m having trouble with player movement can someone help
Cinemachine and new input system
It’s like the player moves on global space not local
So I’m wondering like, does scripting just get to a point where you know how to do almost everything you want to do off the top of your head or do even the experts constantly reference other material to know what they want to do the code they write?
Sorry, wasn’t sure if this is a question for beginner or general.
Yes, you will always need to reference something or do many trial and error iterations. Or both.
But it also depends on the task. Some things will become easier .
I ask because I’m still in the very early stages of thing to watch tutorials to learn and I’m just like… okay but how am I supposed to really take this and go off on my own eventually. It’s just so very confusing, especially when I try and look up what each thing they’re explaining in Unity Doc but then Unity Doc just comes off like gibberish.
Recently learned that Unity Learn has a beginner scripting course so hopefully that’ll help.
If everything comes off as gibberish, you're probably missing some prerequisite knowledge/understanding/"basics". Try to break it down to the smallest components possible and then learn about them. Or go over structured learning materials, like unity learn courses/ pathways.
there's always something I'm referencing closely
ideally, i figure it out and start implementing it on my own later on
Okay, thanks. If you don’t mind me asking, how did you start learning in the very beginning?
Read through the manual at my free time.
Then trying to implement my own "dream project".
Referencing like… a tutorial? Unity Doc? Or what?
Sorry to sound dumb but what manual exactly? Like Unity Doc? C#?
Hi how do I make a ray cast that is oriented with the player model? Every time I set the forward direction of the ray cast it is always facing forward and not rotating with the player object?
[Header("Ledge Check")]
public Transform ledgeCheckerStart;
public float checkDistance;
public LayerMask whatIsLedge;
bool isLedge;
private void OnDrawGizmos()
{
Gizmos.DrawRay(ledgeCheckerStart.position, ledgeCheckerStart.forward * checkDistance);
}
private void FixedUpdate()
{
isLedge = Physics.Raycast(ledgeCheckerStart.position, ledgeCheckerStart.forward, checkDistance, whatIsLedge);
}
sounds like this "ledgeCheckerStart" object is not rotating with the player!
Transform.forward is the world-space forward direction for a Transform, so that is the appropriate thing to use
Unity manual and official C# docs.
Okay thanks. You’ve been of great help.
Okay, thanks nonetheless.
I have a strong programming background, so I think I just poked at docs pages and clicked on things. I've always been able to find my around new software pretty quickly.
Reading the manual is great; it will quickly introduce you to important concepts
e.g. "what is a GameObject"?
you don't need to read it cover to cover, of course
Right.
It’s just… not that I expect to learn everything overnight, I just feel likely I’m hardly getting any grasp of this scripting thing like at all but imma keep at it.
isLedge = Physics.Raycast(ledgeCheckerStart.position, this.transform.forward, checkDistance, whatIsLedge);
Im still not getting it to rotate
did you also update the Debug.DrawRay line?
yeah this is what I currently have:
private void OnDrawGizmos()
{
Gizmos.DrawRay(ledgeCheckerStart.position, this.transform.forward * checkDistance);
}
okay, then whatever this is isn't an object that is rotating
right, and the Player object is not rotating!
its rotation angles are all zero, and since it has no parent, it has no world rotation at all
(if it had a parent, its parent could be rotated)
Switch your scene view to Local, not Global, and then switch to translation by hitting W
This will show arrows for the selected object
red/green/blue are right/up/forward
Okay I see now!
yo is there anyone who could help me on vc if they just have some time
gang if you didnt want to just say nothing
tf man keep yourself out of peoples dms
idk who that is cuh
just saying it's in the code of conduct
mb
so you wont help me?
you havent even said what your problem was
my problem is kinda everything i just downloaded unity and i wanna make a game but i dont know what to do first
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
i tried and when i make a 3d object it isnt 3d
when i create a 3d object that come up
well without context it could possibly be the camera in orthographic/2D mode
part of reason its good to learn the actual editor first before even starting any game
without knowing the tools you're going to be using you're going to struggle, start with the essentials pathway etc.
idk what that is
its in the pathways found in the link I sent..
you there 🫵
respectfully
but u seem skilled can u help me real quick?
please
don't randomly ping people into your questions, epsecially in a thread
#📖┃code-of-conduct
if someone sees the thread and have an answer they will do so..
and the grounded is most likely poorly written or using OnCollisionEnter or variants that trigger from any sides
fair point it is indeed poorly done
must I say I'm still learning
I tried a few variants but nothing very concluent and nobody's been answering for a few hours
the simplest things to do is to learn things like raycast or other casts
feel kinda helpless at that point coz every forum I could found were years ago and filled of people being like "could find the answer on google in 30 seconds, skill issue"
I mean technically you can, especially with this ai slop practically feeding you answers
well that seems complicated solutions, was wondering if there were other solutions
I tried adding a circleCollider2D on my player so it would have foot and not climb walls, but it was not so convenient and it also messed with my collisions
using colliders was the reason its too simple to work well
well I'd rather not use AI to be honest, being given spaghetti code to use without thinking isnt the way I will learn imo
hence the "complicated" solutions, you have to start getting more complex if you plan on advancing
everything looks complex at first glance, its not that bad
fair point
will dig into raycast then
I'll put updates in the thread, but tomorrow coz its late
thanks for the help
yo idk if this is how this works or not but if you go to game in the top is there a way to play the game or idk
in the middle
this gotta be some type of troll post
but when i click that i still cant move
do you have code to move, and is it attached to an object?
You need to start from the basics and know how to navigate the editor including potential errors you're ignoring in console
prob not i just downloaded ts
do i need to attach the camrea to a moving abject or somthing
did you even check out the learn site you were linked?
hell nah
just downloaded it
the come back when you have
Can someone send me a message on discord and please get me show me how to spcirt on Roblox.
yeah no, there are like 4 things wrong with this request / message
Hello, guys! I dont know if this question is related with Unity but there is a concept in Programming called Single-Threading and Multi-Threading that we were discussing in class yesterday and a teacher told me that Unity handles everything on a single thread instead of multiple threads. What does this mean and what is the difference between them?
What does this mean
that unity is primarily single-threaded, at least for the part that you care about. multi-threading is supported with jobs/burst, that kind of stuff, iirc.
what is the difference between them
with separate threads you can have things in parallel, rather than just concurrent (at the level you're working at. in the cpu they may still be concurrent). you can look up "parallel vs concurrent" to see some diagrams explaining the difference
stuff like Update timers or coroutines are concurrent, for example.
Didn't you just say that you attended a class yesterday discussing them and their difference?
Yes I mean we didn't talk in depth about it
it will be next week lecture
we just did a small introduction
imagine doing stuff irl with one arm/hand, thats what Unity mostly does
if you have two arms/hands you could do two things at once
Haha that makes a lot of sense. Very good example. Ty!
The big kinda thing with Unity is most modern cpus have a fuckton of cores and thread (hands) but Unity isn’t built to use all of them
but ofc how fast you can do stuff with a single hand changes how much that may or may not matter
just finished C# Fundamentals from Bob taylor and Learn Unity. Should I keep debugging challenges or go immediately to creating systems?
honestly very unsure haha, I was very confident I could code now, but I still get stuck a lot and stare at a wall


Decomposition
whats that mean
Basically it requires skill and practice
you wont be good only just because you have attended a course
Learn by doing. You'll come accross plenty of challenges naturally and still be working on something you like, don't bother just doing exercises for the sake of learning.
👍 so brute force coding, got it
Courses are very useful for foundation knowledge but after you get some experience you wont be needing them
Not brute force, learn by doing. Don't write the code if you don't understand it.
Personally, I dont need courses to learn something I just follow project-based learning approach
Just learn stuff you will need for your project you are developing
do not try to learn everything at once
i've yet to look at unity's learn site for more than 15 minutes, and youtube videos kinda just suck
very interesting advices, I will take note
Sebastian Lague's youtube videos are fantastic, but they're more for the advanced side.
No I dont mean you dont have to watch tutorials
haha
to re say what they've said, while you may have spent the last few hours learning a bunch of stuff at once it'll take you another few days to break down what you've learnt into manageable and rememberable information that you can reuse
no i know i was adding my own experience cause you had, where you said "personally" i had meant the same just left it out
thanks for the advice guys. ill go sleep now
i need this advice 😭
I mean all beginners do watch tutorials but they are trapped in tutorials hell thats the main problem here when you are a beginner you dont know and you think that just by watching tutorials you will become a professional programmer. Our art is practical and without hands on experience you wont learn.
Also, most of the tutorials I've seen on Youtube, like Brackeys, teach bad coding practices.
Do they teach Game Programming Patterns?
I have seen many vids about DP
DP?
oh yeah few years back now i really wanted to try and get into game dev and i went through ai to do so "made" a few projects that turned out awful and felt like crap. ended up with me not touching unity (or any other engine) for about 3 years .When i took a proper course in school on programming and decided to get back into game dev and i can certainly say since going to school for programming i haven't needed a tutorial like i did before hand.
Design Patterns
Oh yeah, actually AI, like ChatGPT is a fantastic tool for debugging or understanding code better. You can copy and paste and ask what's going wrong, or an explaination for how things are working on code you may not understand fully as a beginner, and can get deeper insight.
there was a channel the sort blew up about a year or 2 ago now that also had some drama cause they used their videos to sell courses think the name was blackthornprod or smth. they did a lot of x game devs make a game.
Brackeys is mainly tutorials on features, so it's more Unity focused, rather than C# (in general), so they kind of just teach code that works, but isn't good standards.
Basically AI isn't a fantastic tool for beginners.
It is.
As a beginner you dont know how to code and it can be misleading
You have to know how to code to be able to interact with AI properly otherwise you just waste your time.
Anything can be misleading, but as an aide to coding, you'll understand more having it than not.
it certainly isnt with a beginner you've no idea what it's writing or what it's even suggesting, you end up doing things that could be bad practice poor implementation or just outright incorrect without ever getting the chance to understand why
I'm talking about not for generating code, as I've said in my comment, but from getting more insight into bugs, and how your code is working.
no when people use ai they are looking for quick fixes not using it to understand something fully. so using it to any form leads to a result that is outright worse than not at all
I recall there being a dedicated channel for this type of discussion..
I'd argue that some practice can be useful but with AI as a complementary tool
I remember using it in python saying "what is this function" so it would explain something specific for me
Really useful to learn and comprehend, tho it shall not be used to generate code
ai's biggest down fall is debugging, if it's something simple like an error code a quick google search can give half the answers and the other half should be a red ~~~~ line from your ide and anything bigger like bad results (image example) ai cant work it's way through and ends up writing shit for you
AI is just searching a database of all the code it stole from GitHub, to simplify. So to just disregard it as a tool is unwise. It is powerful if used correctly, and not overrellied on, as well as understanding, it is trained on data from humans, and just like humans, it will tell you incorrect things sometimes. More often than not for simple code for beginners (e.g. solved problems, not so novel) it will be able to explain deeply or answer deeply questions you have about code you wrote. I don't suggest using AI in your IDE but copy/pasting into ChatGPT can help you question your code.
it's definitely a tool you need experience for to use correctly. a beginner would not have said experience
indeed
also, yknow... it's been trained on the stackoverflow questions too
and as useful as it can be, overall the less you use is the better, both from a learning point of vue and a ethics point of vue
got tired of stackoverflow after realize half of the answers were either condescendant or something like "erm I found the answer on google in 30 sec 🤓 " tbh
The ethical and legal implications of LLM's is another bag of worms.
sure, but it is to be taken in account imo
thats why I try my best not to use AI
but yeah its a whole other debate
I really don't think a beginner programmer has any relation to how to use an LLM. At the end of the day you can just ask it to explain something in analogies etc. It is a language model, so anyone that understands human language should be able to get useful information from it, regardless of skills in any particular area.
I would tend to agree with you here, although we pick our battles, so often what's useful wins. I've made a big effort not to have big tech in my life, but at the end of the day, I'm making a game, and I want to reach a wide audience, so Google Play is part of that.
yeah I get what you mean, there's things we can not or very hardly avoid and it is how it is
but as for AI it still is avoidable so yeah its at least that
ime it definitely does. LLMs can frequently be subtly wrong, a beginner would not be able to tell
LLMs are a tool for volume
That's true. But if we're talking about whether LLM's are useful or not, I don't think that's really debatable. ChatGPT I do use, but shouldn't if I'm fully aligning with my morals, but their are other alternatives, like Proton's Lumo, that fully encrypts and doesn't collect data. These LLM's are going in a better direction I think.
they are not useful for learning, and that's what's important for a beginner
Ok, sure we'll agree to disagree.
ofc they are definitively useful but at what cost
like generative AI in general have a human and environmental cost so terrible
and that without even mentionning that economic bubble and the RAM shortage
I think it goes much further than data collection and I find it quite terrifying
Completely agree with you in terms of how companies are using the technology. The technology itself though, is very powerful.
it is, but it's incredibly easy to misuse without experience
This is a skill in itself though. Not understanding how to use an LLM isn't the same as not understanding how to code, they are very different skillsets.
both are required
also I think that its hard to blame people for using it, its a very convenient tool and it has a lot of great usage so its understandable
They aren't. By that logic, LLM's wouldn't be able to answer questions. Learning is the asking of questions and getting answers.
LLMs were not built for truth, my logic leads to that conclusion, yes
maybe too powerful
like seeing expert in AI security quit their job and tell people we're doomed, while OpenAI CEO is like "AI is gonna destroy us but we'll have one hell of a ride in the mean time!"
damn
@hard fossil how much experience do you have in the industry?
both programming and game dev?
We probably don’t need to continue this
can someone help with my script, the jump and double jump aren't working
📃 Large Code Blocks
Use links to services like:
https://pastes.dev/
https://paste.yunohost.org/
https://share.sidia.net/
https://paste.ofcode.org/
https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
where do i post it?
one of the links shown above
ok
I was told to null check unity objects like SO's I don't need to use != null and can instead just bool check(?) it like this, but my IDE/the nullable package does not really like this
is there a way other than adding != null or doing moonInfo.RouteNode!.itemCost to suppress the warning more naturally?
converting to bool for objects is defined the same as what != null does
i think i recall the nullable package not playing super well with unity types because of unity's fake null, but i'll have to recheck that
what's the warning you're getting?
just the one you'd expect i think
i would not expect anything in particular because i have not used nullable lol
oh fair lol
it's pretty neat, but can be annoying with unity objects since I like to not include the != null part (partly because rider also yells at me for that iirc)
that warning on rider is kinda over-eager tbh
it's not technically wrong but it usually doesn't matter, some things you just have to do
i would guess that the bool check doesn't "inform" the nullable static analysis that it's been checked
yeah :/ was wondering if there was a way for it to but might not be
Hey, does anyone know why my camera sometimes behaves weirdly as in teleporting to "random angles" in my first person 3d game?
Playercam.cs
using UnityEngine;
public class PlayerCam : MonoBehaviour
{
public float sensX;
public float sensY;
public Transform orientation;
float xRotation;
float yRotation;
private void Start()
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
private void LateUpdate()
{
// get mouse input
float mouseX = Input.GetAxisRaw("Mouse X") * Time.deltaTime * sensX;
float mouseY = Input.GetAxisRaw("Mouse Y") * Time.deltaTime * sensY;
yRotation += mouseX;
xRotation -= mouseY;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
transform.localRotation = Quaternion.Euler(xRotation, yRotation, 0);
if (orientation != null)
{
orientation.rotation = Quaternion.Euler(0, yRotation, 0);
}
}
}
don't multiply mouse input by deltaTime (you will have to reduce the sensitivity to compensate)
im so stupid tysm
Hiya guys, I've been trying to code a wheelofnames style roulette wheel on unity. Right now, the wheel just chooses a random z for the rotation, and lerps to it. Obviously not the right choice, it rotates forwards and backwards, and at different speeds. But I also tried giving it a RigidBody and setting its angularVelocity, which seems fine, but I don't know how random it really is. Besides, I'd like to be able to set the result via code in some way. How should I go about implementing the wheel?
Here's the current script i've got
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RotatingWheel : MonoBehaviour
{
public int outcomes;
public float rotational_force;
float target_z;
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
target_z = Random.Range(0, 360);
int result = calculate_result(target_z, outcomes);
Debug.Log($"Target: {target_z}, result {result}");
}
Quaternion target_rotation = Quaternion.Euler(transform.rotation.x, transform.rotation.y, target_z);
transform.rotation = Quaternion.Lerp(transform.rotation, target_rotation, rotational_force * Time.deltaTime);
}
int calculate_result(float rotation, int outcomes)
{
rotation = rotation % 360;
int result = outcomes + 1;
while (rotation > 0)
{
rotation -= 360f / outcomes;
result--;
}
return result;
}
}
Don't read the rotation from the transform, store it at the start and use that instead.
Vector3 currentRotation;
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
currentRotation = transform.eulerAngles;
target_z = Random.Range(0, 360) + currentRotation.z;
int result = calculate_result(target_z, outcomes);
Debug.Log($"Target: {target_z}, result {result}");
}
currentRotation.z = Mathf.Lerp(currentRotation.z, target_z, rotational_force * Time.deltaTime);
transform.eulerAngles = currentRotation;
}
you could set a target as something in the range of like, 720 to 3600, and then you can smooth a value up to that value, then only set it the rotation to the transform
The "wrong lerp" isn't great but that should fix the immediate problem
you should not read back transform.rotation components
especially not like that, since transform.rotation is a quaternion lol
Your comment is a bit misleading. Whether LLM's tell truth or lies really has nothing to do with anything other than what dataset it's been fed. At the end of the day, it's transforming the data set and spitting it out.
I have more experience in indie development than as an employee. Why? What about yourself?
i know how LLMs work, thanks.
You are not, it is very common mistakes which a lot of tutorial makers have made as well making it very common among beginners. DeltaTime is often required but mouse input just happen to be an exception as it is already the delta of the mouse movement (how much it moved since the last frame)
LLM's are amazing, you just need to push them for answer a little bit and not trust the first thing it spills out. Doubt its discovery etc, it will more often than not end up giving something really useful
I have a 20b gpt model installed on desktop PC offline, and yesterday gave it some long sequence of base-64 encoded string. It just happily analyzed its json format out. Did not take more than a minute
This can be true, but to only those who understand code and what they're asking
For beginner's, they take everything as truth, and don't know how to properly "push" for the answer, hence the problem . . .
Btw, does anyone know why the version control doesnt seem to detect scenery component changes, as i just changed a value and it still tells me im up to date
make sure you've saved
yea it seems to now have sent the scenery but only the changed part. for some reason on his end the components are not set correctly though, is there anyway i can send the entire scenery and have him force pull it
So beginners in any field of knowledge take everything as truth? Therefore they shouldn't ask questions because they might believe the wrong answers? This is a very strange take. It also would apply then if they ask someone a question, and someone tells them something incorrect. So in effect, asking questions would be pointless.
LLMs are perceived as a source of truth to beginners yes
are you referring to scenes? merging individual changes is kinda how vcs works
Ok, so a source of information that is often correct shouldn't be used because your view is that a lot of people perceive it to be true, so therefore when it's wrong they won't accept it as wrong?
yeah but for some reason the scenery doesnt seem to carry over correctly, i just modified a number in the components of my player and uploaded the scenery, after he pulled it though nothing changed for him
LLM usage is private. when a beginner gets a wrong answer, they may not have enough experience to see any part that may be inaccurate.
in sources like wikis, any user who knows something is wrong can fix it. in youtube tutorials, mistakes can be pointed out in the comments. in docs, PRs are made to fix inaccurate content. in community forums or servers, other helpers can challenge the incorrect answer. this is what makes them more reliable.
inaccurate base assumptions cause a lot of pain as you get into more complex stuff, and honestly it is an incredible pain for us as helpers
very few people, and even fewer beginners will share their entire thought process that would reveal the incorrect assumption. it wastes months of time just to learn something basic.
I can't really argue with something like, oh but someone out there might misuse it, so therefore it bad. So I'll leave it at that. They have their strengths and weaknesses just like any other way of getting information.
95% of the usage from beginners ive seen here, in other servers, in real life, have been misuses.
It seems like you don't really have any argument against LLM's, only what you think people's perceptions of them is.
just hedging my bets there, i don't recall any proper usage of them to actually learn
my arguments have been against.. beginners using LLMs, not against LLMs as a concept.
To be more specific, your arguments are only against LLM's being misused. My argument is that LLM's are a good teaching aid. Every teaching aid in the world can be a bad teaching aid, if it's misused or taken as gospel, that is obvious.
nvm restart worked btw
I'm not sure you understand what a strawman argument is. I didn't make one. I didn't assume your position and argue against it.
LLM's have been a teaching aid for me, so to say they cannot aid in teaching something is just plain wrong.
why does this happen, can someone please explain?
you've made several assumptions about my position lmao. i'm not interested in discussing this
Okie dokie
Anyone has a hint?
Create a cooldown variable, and add time to it, when the time is past a threshold, allow the player to spawn it, and reset the cooldown variable again.
So yeah thats what my Idea was but Idk how to programm it
What do you have so far?
I didn't say any field of knowledge. I assumed we were talking about beginner programmers (hence the channel). It's "better" to use when they have learned knowledge of the subject bcuz they'll know, or at least have an idea when it gives wrong/incorrect results
We've seen, too often, incorrect AI code, or even code they can't use bcuz they don't understand it
This makes it harder for us to help . . .
Try and break it down into separate tasks/steps. They have laid out most of it (the order) for you . . .
I never advocated to use AI to generate code. I'm talking about getting a deeper understanding and explanation of how your code is working, how it can be improved, and what potential bugs it could produce, AI is excellent for this. For example, following many of Brackey's tutorials, one of the biggest Unity tutorial channels, solely, would lead to bad programming practices. If you follow the tutorials though, I'm sure you would learn some helpful things. Now if you took your running code, and wanted to learn more, you could copy and paste parts into say ChatGPT, and it would tell you how you could improve it by doing certain things, why doing things the way you were doing could lead to errors, and why another way is an improvement. If someone doesn't check multiple sources when learning new information, I think that's a whole other issue. I don't think that other issue nullifies the point that LLM's are useful as a learrning aide.
For someone that has 0 coding experience, would the junior programming pathway on the unity learn site give me/learn me the basics of unity c# coding? If it does wha would you recommend me do afterwards. And if it doesn’t where should I start
wouldn't hurt.. though more traditional C# basic beginner courses will be better prior to any Unity API / Concepts
some pinned in this channel, I personally would recommend this one
C# fundamentals (video series)
Yeah, personally, I tried going though unity tutorials with no previous coding experience. Not fun. I felt lost most of the times
I later did the CS50x course online, which i recommend quite a lot. Won't do much advertisement, but it's free, assumes no previous experience, and features quite some good problem sets
Welcome to this introduction to game development. We'll be starting from the beginning, so no prior knowledge of programming or the Unity game engine is required.
Unity can be downloaded here: http://unity3d.com/get-unity
Watch episode 01: https://youtu.be/9iCnjdXEfMA
If you'd like to support these videos, you can make a recurring monthly don...
yeah that one is good knowledge to have, especially Algorithms and big O are important topics in any dev, but gamedev especially when performance can be critical
Make a really simple 'game' and when you're stuck try to google it and then if youre still not sure ask help here
(Shoutout unity and microsoft documentation)
Personally, I did the Beginner Scripting, then the Intermediate Scripting tutorials. I would definitely read a blog/tutorials on C# (I did this before anything else) or watch a video on C# fundamentals as well . . .
Thanks will check this out
Okie thanks man
Ok thanks. I have checked out youtube but it seems like a decent chunk of the tutorials are very outdated and it causes problems when I try to follow them
aside from velocity being renamed everything in old tutorials should work
Feel free to ask about specific problems your running into
Oki thanks man
input lol
additionally from what batby mentioned, unity changed the default "input handling" in 6.1 onwards, so you'll have to configure that back for older tutorials
