http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/
ohhh this is voronoi but dang.. that looks clean
#💻┃code-beginner
1 messages · Page 727 of 1
Thank you its working now!
bouncing of the rev limiter 💨
Yoo, can someone help me with my game? Thread name: "I really need help with a game im making" I have the whole message of what I need help with waiting for you to read there Pls at anytime help me
once again 👇
: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**
Wait me?
and just for extra measure i've put that in the thread so hopefully you'll stop spamming this nonsense
you want someone to do the work for you, yes? that's literally collaboration
this is channel to help with specific questions..
if you have a "i have this problem"
anyone know the solution..
you have a problem you need help solving or you want someone else to code for you while you do other shit?
Then I said really what I needed help with
Help solving, what did I do to you guys?
ya, u basically said.. u dont know what ur doing.. how are we supposed to "answer" that?
ok what issue are you trying to solve with your code
if u ask a question we'll be happy to help you
The AI is raycast to detect if a wall is there works but doesn't reset the game
(catch the player)
so you need help resetting the game?
so if i understand your raycast is hitting walls but going through players?
you just need the raycast detection to "reload" the first scene then
Wait let me draw smt I'll be back
that would help
showing code would also help
see #🌱┃start-here for what to include when actually asking for help and not just asking people to do the work for you
we're not assholes.. we just need good questions to know how to answer them
On the left the gaurd can see you, on the right he cant (wall is in the way) also don't mind the terrible illustration I wrote that on a photo with my finger
In this miniseries (2 episodes) we create a system to detect which targets are in our unit's field of view. This is useful for stealth games and the like.
Source code + starting file:
https://github.com/SebLague/Field-of-View
Support the creation of more tutorials:
https://www.patreon.com/SebastianLague
https://www.paypal.me/SebastianLague
Top ones are gaurds and bottom ones are players, I just need help with the script to make the raycast work,-
It's a 2D game btw
Okay
and you use transform.right or transform.up instead of transform.forward as u would in 3d
right is the X (blue) axis
up is the Y (red) axis
edit: and don't go around telling people your age. especially since ur breaking Discords TOS
Okay thanks I'll try that after school tomorrow
Making a simple field of view system from scratch
Music:
NIVIRO - Memes [NCS Release]
maybe this might be something useful to you its 2D as well
That should work!
What time will you guys be on torrrow?
Also what time is it for you guys right now?
bedtime 👋 lol
Same
good luck tomorrow 🍀 see ya around if im on
K bye
hi guys
I am using Firebase Auth for login and Firebase Realtime Database for saving data
My app has no problem working in Unity test mode
but after building it into an apk and run it on my Android phone,
Firebase Auth is still working but RTDB isn't (i.e. it is neither reading nor writing data to RTDB)
any ideas why it is happening? i have re-downloaded google-services.json into \Assets but itz still not working
make a development build and add logging. Log before and after the API call and log what parameters you are making the request with, and the response you receive or any errors you are getting back from the API.
Use the Android Logcat plugin in Unity to read the logs
thanks! now i can check what was going on
what does serlize base do
Where did you see "serlize base"?
Currently these codes updates player camera look when the player rigidbody rotates because player camera is children of player rigidbody, So how can I make these codes to don't change camera look when player rotates?:
//In FixedUpdate():
if(characterMovement != Vector2.zero)
{
Vector3 camForward = Camera.main.transform.forward;
Vector3 camRight = Camera.main.transform.right;
camForward.y = 0f;
camRight.y = 0f;
camForward.Normalize();
camRight.Normalize();
Vector3 moveDir = camForward * characterMovement.y + camRight * characterMovement.x;
character.MovePosition(character.position + moveDir * characterMovementSpeed * Time.deltaTime);
if(moveDir != Vector3.zero)
{
Quaternion targetRotation = Quaternion.LookRotation(moveDir);
character.MoveRotation(Quaternion.Slerp(character.rotation, targetRotation, 0.15f));
}
characterAnims.SetBool("isWalking", true);
}
else
{
characterAnims.SetBool("isWalking", false);
}
Don't child it and either change the position independently each update, use an PositionConstraint component, or download Cinemachine and slap a virtual camera onto it.
I have a problem with gravity
I'm not sure what is causing this issue. but I was hoping someone who knows what's going on can help.
I'm learning about gravity and trying to learn from this tutorial exact time code too: https://youtu.be/h2r3_KjChf4?si=IfH0rKkQb3HbdW3R&t=579
But my gravity is pretty messed up. I am not getting the same results at all.
Any idea?
I want my players jump and gravity to reflect that of earths but it's launching my player instead.
A breakdown and explanation of how to jump in Unity3D! Learn to jump like Mario! Implement jumping using c#, the built-in character controller and Unity's New Input System!
This beginner-friendly tutorial is a COMPLETE walkthrough of how to use Unity 3D's built-in character controller to get a character jumping while incorporating animations! I...
use mp4 so it embeds in discord, and see below for posting code correctly
!code
Posting code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, 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.
specifically the part about large code blocks
CharacterController.Move should only be called once per frame, that might be a cause of some issues
I'm getting a nullpointer exception in the onClick(); function's switch statement (ln90 in the second script, ln80 in the first)
Despite it assigning the right Sprite in the scene the 'element' variable is Debugged as 'null' still. If anyone has an Idea on what could cause this or how I could start to debug this It'd be greatly appreciated.
https://hastebin.skyra.pw/tawibadilo.kotlin
https://hastebin.skyra.pw/eposaxomet.kotlin
If the variables are null then loadPage hasn't been called or it has been called on the wrong object
that's what I thought aswell but it's assigning the Sprite correctly which is done the same time as element should be set (talking about the second script)
that's what's confusing me :/
load Page is being called as an object with this script is created.
Then onClick is called on the wrong object
oh could it be, that it tries to call the onClick function from an empty prefab instead of it's own gameobject created from the prefab?
and that's how it calls on the wrong object?
If you've assigned the prefab to the button then yes, it calls the function on the prefab
aaah ok thanks
yeah I checked and the onclick function is empty on the created object
ty
stupid quesiton but can't find what this Component is called, tried "TextMeshPro" but that's just returning a nullpointer error :x
TMP_Text
my goat 
TextMeshProUGUI is what this one is specifically but TMP_Text covers this too
why the name is so different to the display name i dont know
yeah that confused me aswell, found people online saying it's just TextMeshPro too. very confusing
TMP_Text is the base class
TextMeshProUGUI and TextMeshPro (if that's right?) extend from the base class, UGUI is for UI, the other is for the 3d component that doesn't require a canvas
wait u can use
if(!field of a component)``` to check null?
things that derive from UnityEngine.Object have this comparison yea
well, if said field is an Object yeah (perhaps you meant "field of type component"?)
if (tracerLineMaterial == null)
tracerLineMaterial = Resources.Load("Assets/Materials/TurretTracerLine", typeof(Material)) as Material;
would this be the right way to assign a material in code?
yes but you should prefer the generic version of Resources.Load
Resources.Load<Material>("Assets/Materials/TurretTracerLine");
you can also use a serialized var for the material or something else like addressables or asset bundles
that is a subject i have not covered yet, to be honest
Well you can do
[SerializeField]
Material mat;
and drag in the asset
I was going to ask though, whats the easiest way to disable the visbility of something like a LineRenderer? Id rather not destroy/recreate them over and over, but i have not investigated yet if there is a .visible property or anything
okay i understand serialization
i was referring to addressables/asset bundles, i guess
disable the gameobject or just the line renderer component
Gotcha. Addressables is made as an alternative to Resources mostly but may not be best for a beginner
ill look into them - id put it on my list yesterday, actually, as i ran into them while reading about something else, but havent yet gone to look into them
to disable an object, its .SetActive(false), right?
tried this in multiple different ways, but all of them crash unity? Any Idea why this could be? Shouldn't this be a simple thing?
disabling a child does not reduce the childcount so that's just infinite recursion as long as the object has any children
right that makes sense, ive tried with destroy gameobject
and that also crashed it :/
just use a regular for loop instead of recursion if you just want to set all of its children as inactive
Destroy doesn't immediately destroy stuff, it queues stuff for deletion next frame
(at the start of next frame or at the end of this frame, not sure)
should be the end of the current frame
but yeah just use normal looping
how would I implement it then? just clicking on the object to remove it from the deck works, but calling that on click method in the child breaks unity :x
that also crashes unity
show what you tried
ok one second
public void ResetDeck() {
foreach (var child in contentHolder.transform) {
child.gameObject.SetActive(false);
}
}
this has a tail call. it can trivially be turned into an iterative form
yeah that has the issue of Destroy not being immediate
the while loop would never end because the condition never changes within the loop
you're just overcomplicating it
if you just want to deactivate all children, this is it
why is it important for you @plush zealot to know which book it is?
it is a book so cant you than just ge tthe book.GetComponent<EBook>().availablepages++
because it needs to add it back
how else would I do it?
or can I just add render next frame or something?
i gave you an example to deactivate all children of a transform
what about DRY (dont repeat yourself)?
no clue what that means, sry
btw the magic strings here should probably be replaced by an enum
and you could use a dictionary for the indexing instead of the switch..case
noted, ty
it means when your code is repeating itself multiple times you probably could do it smarter
when you repeat yourself your just making it more complexer
what type is lightning book?
or the book types?
oh
no there's a gameobject called fire book that has a EBooks script on it
alright
so what you can do emily
when you have a gameobject array or list
you can just loop through the code like this
you should have those typed as EBooks instead of GameObject then
ideally the type would be the component you want to use rather than just GameObject so you can skip the redundant GetComponent call
if(element != null)
{
foreach(Ebook g in book
{
if(element == g.availableElementPages)
{
g.availablePage++;
}
}
}
oki ty
for clarification on the crashing thing, since it might come up with other things again
how would I add a buffer?
you were causing freezes (not crashes) because you were looping/recursing infinitely
the way to prevent that is to ensure you are not doing anything that would result in an infinite loop or infinite recursion. (with the one exception being an infinite loop with a yield such as in a coroutine or an async method)
hi all, this is actually making me go crazy so i thought i'd ask here if someone knows whats happening
i'm working on a game for a jam, and everything was going well so far (today is the submission date); but just as i was finishing my final pass, the level start screen broke for no reason
this is the only code that changes that specific text:
nightStartText.text = $"NIGHT {nightData.selectedNight + 1}";
Debug.Log($"Starting night {nightData.selectedNight + 1}");
and the nightDatas selected night shows up correctly (it's 1 behind, since it's the ID i use to sample from an array that has the level dififculty settings)
Hello, guys! I have an issue. I really cant understand why in play mode when I am pausing the game everything stops working as expected but on built mode when I pause the game some audio sources are working. Is there a logic explanation to this kind of issue?
The issue is actually with audio sources I have one two audio sources
make sure you are referencing the correct object and that nothing else is affecting it as well
double checked, and only this script, on this specific line is setting it
tho i just found that using a different text, it works fine, which is even stranger 😭
change your log to this: Debug.Log($"Starting night {nightData.selectedNight + 1}", nightStartText);
then when you click the log it will highlight the object that you are setting the text on to make sure it is the correct one in the scene
it says the content is correct, but it still displays 0
what's stranger, is i changed the base content to gibberish, so it's actually updating to say 0
and when you click on the log, it's highlighting the correct text object that is in the hierarchy and not perhaps in the project folder?
yup, it jumps to the correct one
then something else is assigning to its text property
that's what i thought at first too, but i checked all my scripts, and the only one that sets this text, is the game manager script, and it only does it once in the start method
its not going to show something you dont tell it to show
find all of the references to that object using the context menu option to make sure that is actually the case
Id put a breakpoint where you assign the new text string so you can see what its actually doing
(using a debugger)
okay.. so i might be dumb 😭
somehow i accidentally duplicated my canvas (no idea how i did that without noticing lol), and the base animation was the night start one, and the new one overrid the old canvas, and the new one wasn't set, so it just stayed at 0
i am so sorry for wasting ur guys time, but tysm for the help :)
what's the name of this component in script? Trying to use 'Button' tells me there's multiple different Buttons but also doesn't let me specify one. I want to search for a Button component and run it's onClick(); method
it tells me that that class name is not valid at that point?
what exactly does it say
"class name is not valid at this point"
then you've done something horribly wrong. without seeing your actual code we can really only guess at what you've done 🤷♂️
used the wrong brackets, sry. ty for the name help though was needed still
Hlo
Anyone here
There is something wrong man Idk why my animation stops at 1st frame only whenever I switch back to home scene from any scene and click one button to play a animation that animation 1st frame is only played idk why can anyone help
don't crosspost, delete that from here and carry on with #💻┃unity-talk
Ok
Why game object make this rapid, almost teleporting jump in 1st few moments? I've tried to use either force and impulse modes
public class TestRam : MonoBehaviour
{
// variables
...
private void Ram()
{
Debug.LogWarning("Reminder: targeted player is hardcoded");
var direction = Mathf.Sign(player.transform.position.x - _rb.position.x);
var force = new Vector2(ramPower.x * direction, ramPower.y);
_rb.AddForce(force, ForceMode2D.Impulse);
}
}
You'll know to use it when you want to set the velocity directly
I'm pretty sure it's just a spike in the editor caused by triggering the function through the context menu. Try adding a keypress like space to run it normally in the game instead
hi, apologies if i need to get more code or other screenshots please just say if you need more, but is something wrong with my line of code here (the second image)? No matter if I'm actually standing on the ground or not, the code never says i'm grounded (and I have made sure the floor is assigned the ground layer)
i only started unity a couple days ago so i'm still not sure how this all works, but i looked up raycasting and cant see exactly what ive done wrong
go through the steps on this site to troubleshoot your raycast
https://unity.huh.how/physics-queries
raycast is out var hit, DISTANCE, mask
oh so i'd need a number to say how far the raycast goes before stopping?
sorry i haven't had time to troubleshoot since i've been doing stuff but these both help so thanks
Hi, I don’t know where is best to ask but I made a mod in Unity to replace a character model in a game. I have added physics to the characters skirt but it clips through the legs.
Is someone able to help or point me to something that can help? Like adding collision?
Note: I am a beginner haha
modding discussions are not permitted here #📖┃code-of-conduct
you'll have to ask for help in the game's modding community
Ok thanks!
The y variable is public. At first it the error didn't make sense until I had a look at potential fixes. It's telling me that this data should be within the class. But I want the LINQ to sort certain variable (this will be determined based on user input), so I have tried to determine that with a string but it doesn't work and I don't want to a shit ton of if methods just to make it work
Is there any way I can make it so the LINQ woulda accept my string
otherwise I would have to hard code it or go through new brain rotting programming that I haven't learned yet
What type is items
it's a class I created
It's telling me that this data should be within the class
what do you mean by this
custom class
Does that class have a variable y
Then why are you trying to get the y value of each element in items if it doesn't have one
but if your Item class does not have a y property/field and your code that is trying to access that property is not underlined in red then you need to get your IDE configured 👇
!ide
💡 IDE Configuration
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
It's underlined, it's just a small variable so you can't see it without expanding the image
no I understand that this is the problem already
I am shit at explaining
what I am trying to do is determine which variable to be sorted with y variable
but it does not accept that
so you want y to act as an index
Why have a y variable at all
that's not really how props work in c#
just do the sorting inside the case statement
Create the sortedData variable before the switch, and in each case do a different sort
Yes I know but I feel like a dickhead when I do that
There is this thing SortedBindingList I haven't gotten into
get something that works before making it good
It's drastically better than doing reflection inside a Linq query
i mean technically they could do something incredibly cursed like add an indexer to the class that accepts a string and switches on that or whatever, but of course that indexer would need to return object since none of the data types are the same. but attempting to do this is insane and 100% an xyproblem
and that would actually sort out my problem but right now I find it too complex to go into rn
In this case, the "clever" solution actually runs significantly worse
it's less expandable, but are you actually going to need to expand this?
expand as in?
Add more fields to Item
This is the end of this part of the code
no
if I did I would have to update this
I know
Then do the sorts in the case statement
The only benefit to trying to do reflection here is that new properties wouldn't need to be added to this function, and it comes at the cost of making the function take about five times as long
am I the only one that is finding hard to learn programming? It takes me a bit to learn just average things
such as learning how to use datagridview list took me a bit
You just need to stop focusing on trying to do things "The right way". The most important thing to learn in programming is the hierarchy:
- Make it work
- Make it right
- Make it fast
Never skip steps
I have set Unity to use Visual Studio in external tools, now when I double click a script in Unity, it opens up a blank window Visual Studio
I have tried the following:
Reinstalling Unity and Visual Studio
Set both Unity Hub and Unity as Run as Adminstrator
Scripts open normally in Visual Studio if right clicked -> Open with Visual Studio in Windows File Explorer
i think you have to reset the vs layout
That's it after being reset
How to build a most simplest tpp in unity
Trans-Pacific Partnership?
what the hell is "tpp"
Thermal Power Plant
toilet paper premium
Twitch Plays Pokemon
The Poop Peddler
I'm trying to setup a scene manager by following a tutorial. Using the their code...for me the scene instantly gets added to scene. What I was hoping for it not to get added yet. For it to simply be add put into a list so I can loop through the list and add it later. Can someone explain why it is running immediately?
List<AsyncOperation> scenesActionList = new List<AsyncOperation>();
scenesActionList.Add(SceneManager.LoadSceneAsync(sceneIndex, LoadSceneMode.Additive));
you already started the operation
async things begin once you call the function
you can add the task to a list to await later but the work is still running (or may have finished)
Dont want to start it yet? Then dont call it yet...
So adding to a list is synomous to calling the function. I thought it was storing the code so I can call it at future time?
The guys video seems to work as expected
Looks like you're simply caching async operations that you're executing.
Yeah you'd want a list of delegates
No you are adding the object that lets you track the operations status to a list
ah ok...that makes sense
as said, you can instead keep a delegate ref in a list which you can then invoke later:
List<Action> actions = new();
actions.Add(() => SceneManager.LoadSceneAsync(sceneIndex, LoadSceneMode.Additive));
Action is a premade delegate type
Perfect. That makes a lot of sense. Thanks for explaining.
hello all, extremely nb doubt incoming.. I'm trying to finish the Roll-a-ball tutorial, but even doing ctrl-c ctrl-v in the suggested code I can't give commands for my ball to move (I confirmed gravity and it's working fine - I tested getting the ball with a positive vertical value and it falls down just fine). Maybe it's some of my player or my ground's component settings ?
when the ball touches the ground, it just freezes and inputs do nothing to it
nevermind, I just discovered the reason to it 😄
if (!Directory.Exists(levelDataPath)) Directory.CreateDirectory(levelDataPath);
Is it necessary to check?
i mean, why is even Photon doing it? weird
pretty sure it should check internally and wont override
no
CreateDirectory already checks
not a code question
ah wait im dumb, photon checks for it to do the import asset
ups my bad
put it #1179447338188673034
not here
people ask for help here, not share videos
also share the video there
not the channel itself
or maybe u can idk
also one more question
is it useful to cache the length of array?
int BuildingGameObjectsLength = BuildingGameObjects.Length;
foreach (GameObjectData data in allObjects)
{
if (data.prefabID < 0 || data.prefabID >= BuildingGameObjectsLength)
or does accessing the length not do much of an impact? (Even on 30k objects?)
ok i did try and search and it has no problem ig
so no need to cache
you're shaving off probably about 10 ms, if even that
nah its a look up of O(1) so prob not even a lot
and it probably even compiles it to make it even more econom so that shouldnt be my worry
hmm tried something idk how accurate
Test your C# code online with .NET Fiddle code editor.
yea a lot lol
If i wanted to set an array of game objects to true , do I have to turn them all off by using a foreach function or is there a better way
I'm unexperienced with arrays and I want to enable a bunch of game objects at once
what was the original convern about ?
im just saying..nothing to worry about then lol
no i just a long piece of code that does loading, and im trying to make it as fast as possible
you could loop them in array yes, or use some type of global event
right now it takes like 1 seconds for 5k objects
You mean activate objects in an array? If so, then yes, you need to loop them.
the worst performance on it is this piece of code
HierarchyItem = Instantiate(hierarchySystemCartCreate.HierarchyChildPrefab, hierarchySystemCartCreate.HierarchyParent).GetComponent<HierarchyItemCartCreate>();
HierarchyItem.myGameObjectImReferencingTo = instance;
HierarchyItem.eventSystem = eventSystem;
HierarchyItem.buildingSelectingDestroyingSystemCartCreate = buildingSelectingDestroyingSystemCartCreate;
HierarchyItem.SetUp();
hierarchySystemCartCreate.ActivePlacedObjects.Add(instance);
hierarchySystemCartCreate.HierarchyItems.Add(HierarchyItem);
Would looping them in an array turn them all on at once ?
Please demonstrate with an example i dont know how foreach works neither
its basically instantiation of UI
im making my own hierarchy system
That begs for C# basics...
as fast as the completion of the loop. Most of the times its instant
If it's performance, I'd recommend to start with profiler.
I like to learn and make at the same time 
Hi guys, Im very new to Unity and have a general quick question:
Are the variables shown here inside the unity engine? Because when I begin to type them, I can let it auto complete by Visual Studio?
but i disabled this piece of code and it ran all well, so i know it is it xd
Yeah its mostly 3 game objects at max so thanks!
theyre all part of C# . except GameObject
You can do that as well. You just need to have the C# docs open while you do it.
Oh so thats why, and they have a set function? Can I look them all up somewhere listed nicely?
GameObject is a UnityEngine class. If your IDE is configured (which it appears to be since GameObject is colored in), you can autocomplete it
will be instant
GameObject has its own functions / properties yes. The docs.
The set function for all variables is =
But you don't know what part of it exactly
the rest are value types, they do not have functions they are just numbers
its because it is UI tho right?
you wont know for sure if you don't profile lol
Because what's ui?
Which docs? can you link it please?
Alright thanks everyone this was basic indeed
!docs
instantiation of UI is bad, and its because its paired with scroll view + layout + content size fitter
TY ! @polar acorn @rich adder
the thing im instantiating
Instantiating can be heavy regardless of whether it's ui or not. The good thing about ui is that you can have it all in the scene from the start and avoid instantiating it. Or use some kind of pooling system of needed.
each instantiated object has to allocate a bunch of memory so that can be heavy yea
yeah its like doubling it
because im already instantiating for gameobject, but then im also instantiating for hierarchy
So it's, not just "because it's ui", but because there's a lot of logic that runs on their init.
i found the issue, its this line exactly
HierarchyItem.SetUp();
which does this
string Name = myGameObjectImReferencingTo.name;
myObjName.text = Name;
EditNameInput.text = Name;
"the hood of my car is smoking... its probably just the tires"
exactly xd
how do you know? this doesn't seem very bad
What makes this bad??
i can feel a weird screech when that line runs
It's got to be elsewhere...
im not joking i can hear a screetch
sounds like voodo
no, its real
have you confirmed with real numbers
Yes
i can redo it 100 times and it will make sound when that line is enabled
What exactly are you instantiating btw?
when its not its not doing it
Hopefully not entire canvas' and whatnot
Image Button -> Image,Text,InputField,button
thats the prefab
btw
What do you see in the profiler..?
i made the screetching quieter by doing this
EditNameInput.SetTextWithoutNotify(Name);
its because input field fires a ValueChanged event if i do .text = value
Ah.. are you perhaps changing the text of millions of items?
when i opened profiler my unity crashed
40k
no actually 5k
Do you have thousands of items?
Yes
and this all happens at once?
If the canvas has got to update for every change (it's dirty), you may see some heavy delay
Why are you changing the name of thousands of ui at once?
how can i make it not be dirty and then make it be dirty after im done loading?
to set the name? 😭what else
its a hierarchy system
i know it looks bad
its placeholder UI
Could probably reduce scene rendering expenses by setting the objects inactive (maybe the entire canvas) then activate again after you've finished modifying every element. There's a one time cost though. Not sure if it's useful though if you're already processing all this in a single frame.
Sounds like you need a dynamic scroll list with pooling
how do i do that 😭?? ive never touched pooling
Sort by time and show more of the profiler
wait
i forgot to open it
sorry
i will try search on this tommorow
i dont have enough time left today, thanks for helping, you can still reply, i will check replies tomorrow, bye
Google Unity dynamic scroll list/view. There are plenty of tutorials and I think even an implementation in one of the unity samples.
Yeah, a dynamic scroll list should fix this.
How I can find objects inactive?
You'd have to use FindObjectsOfType . . .
and make sure to set the parameter correctly . . .
Better to just not lose track of them in the first place. Keep a reference somewhere handy.
Collections are your best friend . . .
really weird issue I'm having, where I pickup an object which is not colliding with the player in any form somehow launches the player into the stratosphere
Here is the script if that helps
probably some weird forced collision you're doing with a dynamic rigidbody and a CC
if you dont need vase to collide with player on pickup just turn off collisions between the two
this script needs a lot of improvement, especially GetGameReferences()
why have [SerializeField] if you don't assign in inspector
I just like seeing them get all filled in
those functions are really slow..
also a bit strange to have all this code on pickupable item instead of doing it with a pickup script on player
I tried having it in the player but for some reason the dropping part would activate as soon as it was picked up
should not be happening. especially waiting a keypress
maybe I used GetKeyUp without realising
this is using rn the new input system sounds like you had something else before
oh woops yeah I am, nvm I just had a brain fart
transform.position = followTarget.transform.position;
transform.rotation = followTarget.transform.rotation;
usually you want to use the rigidbody component directly if it has one, transform creates weird issues with rbs
ah I see
but yea turning off collision betwen player and picked up item should help cc not bug out
gotcha
what appen
do you have a unity code question?
usually a timer
Yeah but how do you make the timer?
there are several ways..
Time.time , DeltaTime subtract/add value, Coroutines etc
Ok thank you
Hey guys, I'm new to Unity but I'm a little overwhelmed about C sharp and I don't have much of a programming background. Is there anything you would recommend to help me get started?
start small. lots of practice the thing you just learned until it sticks. be patient
Should I look up a course or something or?
yes follow structured courses like the ones pinned
microsoft site usually
https://learn.microsoft.com/en-us/shows/csharp-fundamentals-for-absolute-beginners/
God I hate these things... But thanks
you can read from blogs or websites if you don't like videos. either way, you have to learn the information somehow . . .
Is it a bad idea to just try to learn as I go?
You know like maybe fall tutorial but then try to understand the code from there?
You can, but I would understand the Unity terminology. At least go through the beginner and intermediate scripting tutorials from Unity (from the pinned messages) . . .
I don't know man. I'm just reluctant because every time I've tried to force myself to learn a new programming language in the past, I burn out and it's hard for me to stay focused
I've mainly used game maker and I know it's not as complex as Unity but I found that when I just go in fall tutorial even go back and try to debug and finally get it. That's when I'm most productive
It may not be the optimal way or the most efficient, but it sure as hell beats getting stuck in paralysis
And yet a lot of people tell me learn the basics. First. Go through courses and all that crap
I'm going to dilemma and I don't know what to do
On one hand, if I try forcing myself to learn the basics and somehow succeed despite my crippling ADHD, I might be able to have a better understanding of bugs to squash in the future and having to follow less tutorials
On the other hand, if I go in using my current plan of just just following tutorials and try on, I may get hung up but at least I'll feel less overwhelmed from the start and gain more momentum
So yeah
With this, you need to have discipline. Nothing is easy. Motivation only helps when it's something you want to do. I'd think about that first . . .
Yeah, I figured
Thing is once I get momentum I usually have to discipline to see through a bug to fix even if it means starting without feeling like I know everything about C sharp
Though I'm unsure what you mean by "fall tutorial" . . .
I don't know. Maybe that was a typo. The point is just about every course that introduces a new programming language or even if I go on coding dojo or whatever. I burn out pretty fast cuz it's hard for me to concentrate and all I can think about is if there's a better way to do it this and just bring my vision to life
I guess I should just force myself again to learn the basics and hope eventually it sticks
I have to keep putting my passion project on hold so who cares anyway
Even though it makes me happy in the moment
I was originally an artist. I used Unity because it seemed easy to get started. I learned C# and Unity at the same time, so it is doable, but I do think it's important to learn the basics . . .
Whatever
I'm probably overthinking it
It helps greatly when debugging and to understand the tutorials . . .
Well everyone I talk to seems to say otherwise
You are; just just click on the Beginner tutorial link and jump right in, haha . . .
This is a game jam?
then they have no experience doing it..
learned c# cause of unity . its not difficult to learn both
It's fine to do, but often times, most people have trouble because they skip the fundamentals of C# and jump in to random tutorials on how to build a specific mechanic/system. This leaves them with limited knowledge and no idea for how to expand or connect it to anything in their game. Not to mention, debugging or fixing an error because of a lack of syntax or the difference between a reference and a value type . . .
Exactly. I only know C# because of Unity . . .
All right I just hate having to force myself to some of some. Some old geez are drawn on about it but I guess I got to be disappointed. It's just really hard with ADHD
Like every time I've tried in the past I get a little far and I jot it down and then I think wow this is boring. I just want to go back to my game
Pomodora method helps a little bit I guess
I guess I'll try maybe like one video a day of the course I don't know
Third person perspective
Pomodora method??
You know the thing with the timer the 25 minutes followed by the 5-minute break
No one likes sitting and learning properly. It takes effort. It's the same for everyone.
You either force yourself to do it, or learn as you go, but you need to be prepared to constant googling of docs and tutorials if you do it, that will distract you from whatever you're trying to do.
There's no easy way. Learning a new skill is hard. You either go through it, or give up.
The structural learning path is hard at first but easy in the long run.
Learning as you go(including basics) is gonna be hard in the long run and is more likely to make you give up.
use cinemachine, put it in third person mode. done
https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/ThirdPersonCameras.html
I kind of forgotten c#, I'm learning while making things
Thanks
okay well a third person view game is going to be pretty difficult to start with.. there are lots moving parts to consider
unless you are making something super simple
I started on 2021, but had to leave it cause of the studies, now finished the school, and learning again
I want full control over my third person
So, I can make it simple
With code
And then add complex layers on top of it
I'm a programmer, but unity c# functions are confusing for me
you should be familiar with reading / using an API . Unity is pretty much just that, aside from the specific engine concepts like gameobject, components, order of events etc..
there isn't any special unity c# or anything
!docs
anything unity here
Engine concepts are confusing actually
That's the main issue
For example?
Well how do I make it less painful? Weed?
This is subjective. Different people prefer different approaches. For me, I was working on my own "dream project" and mostly learned as I go, but I also read through the unity and C# manuals whenever I had free time(like on the train), and investigated engine features and code syntax online whenever I encountered something new. Eventually I understood that what I was doing was very limited and switched gears to a different "challenge" project, the goal of which was to go through the development of a simple game from zero to a release all the way.
Later, I worked as a freelancer on other people's projects and even later in a proper company. All these stages were very valuable experience and learning opportunity.
Whatever I'm just angry. I know I'm going to hate this and I'm already tired of putting off my passion project but whatever I guess it's worth it
I'm probably going to burn out but whatever
Trying to think of a reward system I can give myself to encourage me
I just hate coding so much man or actually I hate learning to code
But I love my passion game more
Once it clicks, it's actually pretty rewarding.
But it'll take a year at least
Even just reading the docs and having that eureka moment.
How am I supposed to be that patient for a whole year?
It doesn't have to.
In this era of instant gratification
Well I don't know how much should I do a day pomodoro's method give me f****** specifics man
Make small goals that you can accomplish fast and you'll get rewarded enough to continue
I'm really angry. I'm sorry just hate having to accept this
Like I'm already angry. Just thinking about it. Just having to deal with this undead zombie prattling at me through a camera
When I could be bringing my characters to life albeit imperfectly
Give me a specifics
Like writing a hello world console program. Or making a goal of understanding certain api, like dictionaries or something. Or learning the concepts of OOP and applying them to everyday objects.
How's that going to help me know how to make a grappling hook right off the bat without a tutorial though?
I'm sorry I'm just really impatient
Because a grappling hook is just many of these small things.
But it's hard knowing how to put it together
Just feel like I got to get this done as soon as possible so I can hopefully find a job overseas to get out of this horrible country
Yep. Which is why tutorials are fine. As long as you don't just copy them.
I thought tutorials were for pussies
If you learn something new and able to generalize that knowledge to other areas, that's good enough.
You know tutorial hell and all that
That's exactly what happens when you just copy tutorials and don't learn from them.
Well I do tweak them
But yeah, maybe I've copied and pasted a few
Not just tweak, learn the mindset of solving problems.
But whatever I'll just have to nut up. I'm just tired. I already know this is going to be hell
I mean I add comments to help me understand it
You know like next to the lines
The fact that you add comments probably means that you don't understand it properly.
Well we all got to start somewhere
It means that you can't just look at the code and say what it does.
Well sorry for not being a genius like you
But you should be able too. If you want to improve. Just try it. Instead of taking the code for granted, read through it line by line and ask yourself what that line does.
That's going to burn me out faster though
You don't need to be a genius. It's very simple.

No. It's gonna open up a perspective that makes coding fun.
You're probably right. I'm probably overwhelming myself
Like GameObject , tags, and oncollisionenter, inputs
What exactly is unclear? GameObjects are a pretty common concept in gamedev, though you have different names for it in different engines. In Unreal it's the Actors.
Same with tags.
And on collision enter is just a method that unity calls on collision basically.
If i make games by following tutorials but learn some lines each time its that good?
It depends on if you just copy it doesn't help much. but if you take parts of the code and change something at the code then you will learn it better and faster in my experience
Im currently following a youtube series for a small open world game and so far I've learned some things
I was giving u example, I do know what they are, but similar things like that are kind of confusing for me
If these things are clear to you, then these are not examples... 😅
I asked for examples of engine concepts that are confusing to you.
Guys I have a weird one. This is my engine script. It simulates an engine for a car. Its currently being ran in a physics substep where it loops 100 times inside fixed update. Code works fine with higher values like 20-100 but if I reduce the substeps down to anything lower the engine begins to output a negative torque.
https://gist.github.com/rybakatya/10b904eb795c52b71066fc3f5ce17715
what am I overlooking?
like How to make the camera look at things or how to make a proper third person perspective with c#
all these things
thats not engine concepts that is just basic development
what part of a third person perspective ae you struggling with?
ik when I first started i really struggle with camera clipping through walls everyone said use raycasts to fix it coudln't get that to look good it was always to jerky so i used character controller on the camera 😂 then no more wall clipping
These are not concepts, but a whole feature that contains many different concepts and patterns in it. If you break it down into smaller steps, it will be easier to understand and implement.
im messing around with unitask since i've heard it better then coroutine, also trying to save load without freezing the game
am i using this wrong cause this keep saying unitask is the slowest? with the unitask.create somehow better than running the async function? cant find any example usage of this .create so idk
here my test script https://paste.mod.gg/tapzymfyhfxk and the result
A tool for sharing your source code with the world!
Where does it say, UniTask is the slowest? From what I see, the time is the lowest close to async thread
private async UniTaskVoid
running this async function is the slowest
Ah, did not check your script yet. I guess, using the async void versino of UniTask is basically a lightweight version but still not the same as if you create an actual UniTask thats not bound to the game loop. But thats just an assumption
going through the Unitask.create somehow much faster than running the default async function
can you point me to the specific part
and im guessing you are replying to this
The link did point to the specific text talking about the void version
Oh, it did not apparently 😄
guess they prevent text links. just search for "UniTaskVoid"
idk i only find it saying unitaskvoid suitable for fire and forget scenario and want to show exception
This is not "profiling uni task" its seeing how long counting to 500000000 takes
what a joke
Though it's still curious why there's such a difference.
probably a fluke
if you run it once and that's it then it will have random variation anyway
Stopwatch sw1 = Stopwatch.StartNew();
for (int i = 0; i < 500000000; i++) { }
sw1.Stop();
UnityEngine.Debug.Log($"[i] Finished in {sw1.ElapsedMilliseconds} ms");
Stopwatch sw2 = Stopwatch.StartNew();
for (int j = 0; j < 500000000; j++) { }
sw2.Stop();
UnityEngine.Debug.Log($"[j] Finished in {sw2.ElapsedMilliseconds} ms");
Stopwatch sw3 = Stopwatch.StartNew();
for (int k = 0; k < 500000000; k++) { }
sw3.Stop();
UnityEngine.Debug.Log($"[k] Finished in {sw3.ElapsedMilliseconds} ms");
Conclusion: always use k as the for variable name to make it run faster \s
Which design pattern do you recommend using when organising code? Unfortunately, I don't come from C#, but I have programmed object-oriented with PHP and usually used MVC.
Currently, with C#, I am using MVVM.
I have read the Unity e-book: Level up your code with design patterns and SOLID, but I am a bit confused. Can you clarify which pattern to use?
PS: I am a beginner with Unity.
Isn't the whole book about that subject?
Yes, I have read all the pros and cons of all the patterns. That means I will read it again more carefully.
I haven't read the book but going by the description it should talk about which pattern to use in which situation, and there's even a sample asset with examples. You're supposed to treat them as a toolkit where you pick a suitable pattern for each situation, not choose one and then use that forever and nothing else
basically u can use solid principles, but also some Game Design patterns as well
https://gameprogrammingpatterns.com/contents.html
@upbeat dirge Try not to over-engineer or over-design such that the game is never made. Remember, prototype first, if its finalised then create a surface level design architecture you will follow. Never go in the details because details are gonna change mid-dev phase
Since I have ADHD, do you think it would help if I were to like maybe do a reward system when I learn these courses?
Like maybe do an hour tops and then work on my game since that's what I actually want to do?
No clue. I'm not a psychiatrist. But in general it should probably help.
Though, I feel like there's no point in doing the courses if you're gonna face different problems immediately after that and would have to research them anyway.
It's not the first time I've tried to force myself to learn a course only to burn myself out quickly
got it, thanks
Like I said, I've gotten the most far (albeit probably not as far as you) falling tutorials coding as I go, and debugging by googling first and asking questions later
Yes, I know, every design pattern was created to solve a specific problem.
I mean, this is fine if you're actually learning from all these things and not just copying the tutorials. Though, I'd still learn the very basics properly.
Ugh fine
I genuine dont get it big counting is not stimulate long running ?and unitask simply is better than coroutine then? i run each so many times, in different sessions too and the async always slower than the coroutine
I just wanna...
I'm sure people with epilepsy would appreciate that gif...
UniTask and or coroutines doesnt effect the synchronous for loop you tested with...
So your test was bad because you arent testing them, the cost of creating the task is miniscule vs the for loop execution time.
never watch hours of courses, only a basic course short one that inroduces you to basics. Then just DIY everything. If u get stuck in problem, try to solve it, ask people etc
<@&502884371011731486> Can this gif be deleted? Its causing epilepsy fr
Thank you Mods!
Please don't post gifs here, it's against our conduct
im still clueless how to measure rn. so rn its safe to assume unitask its better then and i should go with it when i can choose between the 2
You would need to test executing a large amount of coroutines and async functions that do some small amount of work and then get the average time they took. Ideally they wont await/yield anything.
The task itself always takes the same amount of time (*) regardless of whether you use async, unitask, coroutine or whatever else. The only difference is the small overhead of starting the task but that's completely negligible in almost all cases. So performance of the overhead shouldn't be a consideration when you're deciding which one to use.
(*) unless you split the task workload or use threads but that's not what was measured here
The watch is right before loop and not outside the unitask Stopwatch sw = Stopwatch.StartNew();
for (int i = 0; i < 500000000; i++) { }
sw.Stop();
This is still include the cost of starting the unitask ?
No, it only measures the loop and nothing else
Whats the overhead you were refering to
And even if it did measure the task overhead, it would be so small compared to the loop that you couldn't see it in the result
UniTask.Create is what makes the task and that's not included in the measurement
Imagine if you wanted to measure which is faster, an airplane, a train, or a car. You then fly to Paris, start a stopwatch, run around the Eiffel tower 100 times, stop the stopwatch, and then fly back. Then you take a train to Paris, start a stopwatch, run around the tower, stop the stopwatch, and take a train back, etc. So you're only measuring how fast you can run around Eiffel tower and not the actual thing you wanted to know about
But i run each so many times, in different sessions too and the async always noticeably slower than the coroutine, when in reality they should be the same? So what were the overhead you were refering to
The overhead is not affecting your measurements. The difference is caused by other things
The overhead in here i meant
What I'm trying to say is that your measurements are inherently flawed and meaningless
The overhead is starting the unitask or coroutine or whatever
But my thing did exclude that out right?
Yes
You'll need to look at the assembly code of both, or investigate with a proper profiling tool to understand the difference. It could be as simple as the background thread having lower priority or something like that.
Would anyone be able to dm me to help me with an issue with part of a character model clipping into its self. I guess I need some sort of collider/collision
And that is the problem because you should measure the overhead if you want to know which of them is fastest
we don't do DM support here, just ask in the appropriate channel
is this about modelling, animation, etc? find the channels for that
I see
I don’t think mods for games are allowed to be talked about here
yeah, they aren't
soliciting DMs for that topic aren't either
ask in a community about modding that game then
The discord for modding the game isnt very active which is why I came here. I will look else where for help
if no-one there is available for help (for the specific game/issue) then good chance no-one here is too lol
Hmm how do you get the camera distance from a gameobject? Could be simply the center of the camera view or even a corner. I just need to compare the distance between a gameobject and somewhere inside the camera to destroy it after it's a certain distance out of view.
So you want to compare two screen space positions in pixels you mean?
or do you want the world space distance between the camera and the object
Not sure, I just need to destroy an object after it leaves the camera so far
sounds like you want screen space or viewport space
I was trying something like
if (Vector2.Distance(transform.position, not sure what I can put here) > 5) { Destroy here };
I would probably use this: https://docs.unity3d.com/ScriptReference/Camera.WorldToViewportPoint.html
then you can check if the viewport x/y coordinates are < 0 or > 1
which means it's outside the screen
Viewport space is normalized and relative to the camera. The bottom-left of the camera is (0,0); the top-right is (1,1). The z position is in world units from the camera.
the viewport space conversion is how i always did it, also used it for hte opposite to trigger things when the player is looking at them as well
Hmm I'll have to read and try to concentrate and figure this out after the dentist lol
e.g.
Vector2 viewportPos = myCamera.WorldToViewportPoint(someObject.position);
if (viewportPos.x < 0 || viewportPos.y < 0 || viewportPos.x > 1 || viewportPos.y > 1) DoSomething();```
A start anyway I wasn't exactly sure what to search for
keep in mind you would need to account for the size of object as well
indeed, this is a starting point
since this is using the objects origin point, but that is also simple just use its bounding box to pad those numbers out a little
I had a bug where the spawner stopped working and I realized oh, I dont allow more than 2 to spawn and they are going off the screen hah 😉
Got another to fix after that where they are spawning too far on the edge and I can't shoot them lol. Next I guess.
do anyone have good recommendation on how to better handle these tiles?
i have about 200 of them in 1 axis, with 6 of them in another axis
i need them to fall when the player touches them so i want them small
but having so many tiles is really eating the performance
how can i better handle them?
just them existing without anything actively updating with them, eats on my performance
is 1200 objects really eating perf that much?
would figure out what part is the problem logic on them, physics or rendering with the profiler
ive got nearly nothing else in this scene
im not good at understanding the profiler unfortunately
are a few ways to approach the problem, but how to do so really depends on what the problem is
Is that where you did?
Yeah sorry about that. Didn't know it would be that bright
just watching stuff will not help you unless you directly test and apply it to confirm you are actually learning it
my guess the problem is how many of them there are
but that doesnt seem logical either since unity is supposed to be capable of handing a lot
So you're basically saying I should try to make programs or systems for mechanics from scratch?
Even if it takes longer and is more frustrating?
well yeah its due to the amount, but like it could be any number of reasons still. Like i highly doubt the problem is rendering. So that leaves physics or scripts that are on them
its a skill, there is no real shortcut to learning a skill
but what myself and others are saying is just watching stuff or reading alone will not be enough you have to apply it and test your understanding to truely learning it
And therein lies my hurdle. I don't know the best way to learn it without burning out or crashing out or getting really frustrated or impatient that I'm not actually working on my game but jumping through a hoop first even though it will help me in the long run
It's like I got to learn to crawl before I walk
And given my penchant for anger, I'm afraid I might even get so angry. I'll break my computer
learning how to do something is working on your game though
Yeah I know but it means it'll take longer to actually see my characters in action which I often think about most
also as you learn what is required to get different things done, you apply it to your game
Right, but I just don't know how I'm going to resist taking shortcuts
well yeah its due to the amount, but
I mean I can force myself but it'll take more mental energy and probably burn me out faster
And I don't know what C sharp course to start with
It's all a bunch of bullshit anyway
What course would you recommend?
there are beginner resources pinned in this channel
i can not recommend a course since i learned to program 20 years ago
So then I guess the whole " you don't need to be an expert programmer to be a Game Dev" line I bought is a bunch of hooey
Great
it is important to remember, you have to walk before you run. it's normal to feel like you aren't doing much while learning to walk, but if you skip to running you'll end up tripping
you are defeatest
i learned as a kid when i only had dial up internet and had to get most infromation from manuals and books
You don't need to be an expert programmer to be an amateur game dev.
you don't have to be expert, but you do have to at least accept that you'll have to learn
Well then you were an odd kid
you just have to accept its a process and you will need to learn some things
I know
Ultimately, I know you're right
Curbing passion is just part of being human
Just hope I don't have to put it off for too long
its not curbing passion though
not at all
For me it is because I care more about the art stuff but I'm a one-man band
this is setting yourself up to be able to actually go through with passion
Then I guess my problem is impatience. I don't know
you break things down to small steps, and you learn what is requried to complete each of those steps
Yeah looks like I'm in the shit now
So on average how long would you say it usually takes to get proficient at C sharp before I'm ready to feel confident in unity?
I already do that just without watching boring introductory courses
But yeah I got it
depends on the person, but few weeks should be enough to do basic things
no matter what, you're going to have to figure out the "logic" aspect if you want to have stuff flow and interact
and to use unity or whatever engine, you'll have to learn the "library" aspect
since unity uses c#, you'll have to learn the "language" aspect there
split it up into parts to make it less daunting
All right. I'm thinking I should make a reward system somehow but I don't know what
draw out your logic in a notepad or something, learn c# and unity separately, for example
like its really no different then learning any other skill, its not like you can do amazing stuff so early into learning to play a instruement either
Won't that be stretching myself thin?
I know I just gotta daydream less about my game
this is a very hard question to answer, everyone's journey is different
it kinda sounds like you're expecting to have to learn the entirety of c# then the entirety of unity though, that isn't the case
it's the same work you'd be doing anyways, except now each part is more clearly separated
Let's just say I often get more passionate when I think about the art and music and actual characters in action. Even though I know coding is a stepping stone, it's like when you're a kid and your parents force you to eat broccoli before you can have ice cream
Adhd doesn't help either, although I'm sure I'm not the only one here with it
Whatever, I'll just do it
I'll probably get burnt out and pissed off and grumpy. But yeah, whatever
ughhh can anyone help me please? my deadline is literally in 2 hours and im stuck
so, after my character jumps, he freezes, no idea why
Use AI and fuck what anyone says otherwise
That's what it's there for
doesnt help lol
Depends which model you're using
using the latest one
Of ChatGPT?
woah hey, code isn't a stepping stone to those other aspects. you could totally make stuff without code, just not a game
you could also have a simple game with a small amount of code as well
he doesnt know how to solve this, so im not sure if i fucked something up in unity
obv
this is very bad advice for beginners
Use Claude, it's better for this
But it saves them extra frustration, doesn't it and gets it done? The dude isn't here to learn the basics. He's here for a deadline and I'm just trying to help him
You'd have to share your code...
He can go back and analyze the code later
gonna need some more info than that.
does it freeze midair or just stop moving horizontally or what exactly?
how are you moving your character and how are you jumping?
!code
Posting code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, 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.
@willow pine ignore Chris here
ill send a vid
Now can you explain what you mean by "freezing" here
oh so you just mean the animation
yea
im just not gonna entertain the remark of using AI here at all tbh. it's consensus that it's not a magical solution and it's not really accepted in any support community
presumably just an issue with your animator state machine. Ask ion #🏃┃animation and provide the code and screenshots of your state machine
Dude, I'm already forcing myself to go through hell just to learn to do something I could be doing now, albeit in perfectly... Not everyone has to be a brainiac like you. Some people just want to rush in and break things and that works for them
cool, no need to force that on anyone else
Some people just want the fastest solution even if it's not ideal because hey, at least you're not beating your brain's out
the consensus is clear here
On what?
im not entertaining this discussion. we have a containment thread if you want to check the echo chamber of genAI's virtues
genai is not an accepted form of help here
Dude nobody likes coding itself okay? Why force yourself to learn how to use a hammer when you can use a jackhammer?
lmao no
It's just a means to an end
coding is really fun for me, actually
not everyone is like you
Then you're a masochist
well that's true but unrelated
No, it is. You're a mental masochist too. Not just a physical one
why do people engineer robots when we can just do labor ourselves smh
this is such a dumb discussion LMAO
All right you got me. I'm projecting
I'm just trying to mentally prepare myself to go through this hell
why do people enjoy crocheting when sewing machines exist
Cuz it seems every time I've forced myself to learn a language in the past I crash and burn out
And I really don't know how I'm going to change it this time through sheer self-discipline when my heart says just do what you want to do
if everyone hated it i would not not gotten into games, and made a career on software development and do electrical engineering as a hobby
I never said you have to hate it. I don't hate coding. I just see it as a tedious means to an end
If I absolutely hated coding, I want to get any progress done at all
then do so
if you don't enjoy it, don't force yourself to do it
Then why are you guys suggesting otherwise?
i already said you don't have to code just to make something
I think a key difference here is most people here. Start getting into Game Dev with a love for either programming or making games themselves. Whereas the whole reason I started is cuz I got so passionate about my story and lore that I just wanted to bring them to life in the way I best see fit. So then I just went through the motions of learning what I had to do as it came up
the suggestions here were for tackling it, under the assumption that you wanted to
but if you don't want to, then just.. don't
I don't want to but I have to
Nobody wants to pay taxes but you have to unless you want to go to jail
no-one's forcing you to code
Except the market
no, not at all
And potential employers
Then how come I see so many job listings that require you to be proficient in C++ or C sharp?
you already said you don't like coding. why would you get a job that involves coding
That's a good point
I guess it's just because I am passionate about games and bringing them to life but not the process itself
I'm more interested in the art and creativity and writing of it all
what you want is narrative and game design, it does not require programming
how many artists or musicians or teachers or managers or marketing people or lawyers are required to know how to code
But yeah but they don't get paid as much and their jobs are under threat by AI more so
also, have you tried visual scripting (or its analogs) that try to make it easier for beginners?
no they aren't lmao
Yep, we're all slaves to capitalism
the only AI threat is managers who don't know shit thinking it can replace actual brains
it's not actually going to replace real output
my old job is trying to contract me to fix shit made with AI, the jobs are not going anywhere
Keep in mind I don't use AI as a crutch. I use it as a tool. I follow tutorial or follow advice others give me and if it doesn't work and amount of options I use it as a solution and you know what it does work sometimes
And even if it doesn't, I can usually go back and tweak it and see what it did wrong
the downturn of jobs is not all AI its just a great excuse to look like growth is happening in a downturn
cool, i don't really care how you use AI
Then why is everyone so elitist against it here?
i care when i have to deal with the shit it generates lol
I just feel like you think I'm stupid
Yeah, you're probably right
It's just like I took such a long hiatus from my passion game cuz of over analyzing and getting angry about other stuff. And I guess just blowing it off and being defeatist and yet last week I spent 3 hours straight working in blender to make my character looking up ways to integrate it into game maker. But I was just happy in the moment. Just listening to some rock music. Not even carrying what lies ahead
And that's when i'm most productive
But in the back of my head. I know you guys are right
I'm only setting myself up for more frustration and failure in the long run
Guess I'm just trying to have my cake and eat it too
Anyway, I'll shut up now. I'm just going to look at that c-sharp introductory course at the top of this channel. Hopefully won't bash my head in
tbh i think the best solution for you would be to find a programmer friend who's willing to go with your ideas but that's easier said than done
I don't know. I've been grinding my wheels for what feels like years now
Do I go in and break things or do I take it slow and try to force myself through the pain?
Either way I'm going to feel pain. It's just a matter of when
I'm a dopamine junkie just doesn't mix well with patience
But it's not like it can just rewire my brain. I can't fight my nature
I see coding as an enemy, an obstacle, something to conquer, something to punch metaphorically with just grit and trial and error. Not something to enjoy
Does anyone know 2d very well
in unity?
Yes
I know the basics I jus need assistance
In coding and components
!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
Trust me buddy, you're going to thank me later. Do not use Unity for a 2d game
Game maker is a lot easier and faster at prototyping and most of the shaders and visuals you can use. In unity, you can find in game maker
I'm serious man. Save yourself the trouble. GML is a lot easier to learn than C sharp
unity for 2d is fine
I mean yeah if you want to go slower for similar results
if you're just gonna be here disparaging other people then that's not a very good use of your time
the door is free to use
I just wish I could meet someone with my mindset here
ngl it's starting to sound kind of toxic
Better toxic than elitist
But fine
What mindset is that
you've also been elitist in claiming gamemaker and GML are way better than unity/c#
Learning to code as you go to make your game instead of forcing yourself to learn the basics first by listening to some old codger babbling at you on a screen about variables and functions and loops and all that crap
I'm saying people underestimate it and it's better for rapid prototyping
yeahhh noone recommended you that
I'm trying to prevent this guy from getting burnt out too fast
You did earlier when I weared you down
unity is fine for rapid prototyping too
no, you're extrapolating random stuff
Only if you know C sharp first though
rapid protyping comes more down to familairty with a system then features
we recommended learning basics, not listening to lectures
Learning as you go is fine, but you have to actually learn.
You don't just get good with no effort. You have to actually eat your vegetables
Everything is easy if you already know it
Then how come when I go to the top of the screen and click on the link that says basics to C##. It's just another guy talking at me?
Whatever I'm just too prideful
which one..?
I'm not just making this game out of passion but anger too
Then get over it
That's entirely a you problem. If you can't work on improving yourself then you won't be making a game. Learning a complicated skill like this is about slow methodical self-improvement. You need to want to improve for no reason other than "It's fun to get better at things"
Extrinsic motivation will dry up. If you want to get to the finish line, you need to be motivated to learn for learning's sake
All right you're right
I'm done rambling then for real this time
I'm just really afraid to get started
start with something easy
whats stopping you
there's no point worrying about that, start doing and then you will find out
dont use ai for coding
its really bad
its not a purist mindset, the ai is actually bad for this
like, objectively
No need to restart this conversation. If you have coding questions, post them.
that's because you don't have much experience yet
@silver fern
@queen adder #💻┃code-beginner message
Indeed
no-one's forcing you to be here. i gave you multiple outs. if you want to go use gamemaker, then go do so. if that will make you more productive or hate the process of making your project less, go do so.
what tactic, avoiding things i don't like?
heh, disclipline, wish i had that
not doing things i don't like. that's it. i'm not trying to restart a discussion here. there is an out, you have every opportunity to take it.
if you choose to stay this path, that is your choice and your choice alone. we don't need your ranting over something wholly avoidable.
If you know what the outcome is, then break your game down into separate pieces (game mechanic/systems). Keep breaking them down until you have a list of tasks for each part of your game. Now you have a bunch of starting points. Pick where you want to start, then learn. That's it. Good luck . . .
You know what doesn't help you make a game? Arguing on the internet.
fundamentals does not meaning knowing everything. Even developers with decades of expereince are using documentation and looking stuff up daily
@queen adder Can you at least make a thread at this point, thanks
hello i have a question i just downloaded unity what game development guide should i watch to make my first game
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
You do that along the way (learning the fundamentals). If you have any issues, errors, or coding questions, post here. People will help, but we can't make you or hold your hand to do it. As Osteel mentioned, start a thread for people to help or respond in so it doesn't take over the channel . . .
How would you count the # of these?
I'd use a list instead . . .
You would not have six different variables and use a list or array
If you ever find yourself numbering variables, you are doing it wrong
Collections, such as arrays, lists, stacks, etc., keep track of the number of elements and provide methods to add, remove, and perform other operations. If you need x amount of something, then you need a collection . . .
Hmm alright back to Google for more lol
your case you want a List<T> or Array
You couldn't afford me
!warn 799077053721870336 Don't insult community members. Don't spam the channel with off-topic.
@.strivvy warned
Reason: Don't insult community members. Don't spam the channel with off-topic.
Duration: Permanent
!ban 799077053721870336 Spam, insults.
if I want to show code here can I just link to it on my gitlab?
or a code sharing site,
but there's no rule against it I mean
i would not link a whole repo, since thats asking alot for people to read it all
!code
Posting code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, 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.
use this to post your !code, but yes, links are best as it's something we can copy/paste to help with . . .
Just don't give us the whole repo. small snippets are fine in the server with the proper formatting . . .
https://paste.mod.gg/zktxbsnoufhs/0 I was trying to think of ways to avoid the big switch statement since the actual list of effects is even longer. But I can't come up with anything that doesn't end up in me doing a bunch of similar checks elsewhere later, except maybe writing a dictionary that groups the effects by constructor. Is that a worthwhile idea?
A tool for sharing your source code with the world!
I'm sure it's fine if you link directly to a file in the repo. I don't see how it's any different from using a paste site for the exact same file
alright, yeah that's what I was gonna do originally
what calls StartEffect
kind main issue is is you are mapping from a enum to a other type, so the way to avoiud the switch would be to not do that and pass it instead
Effect Object is it just a regular C# object?
StartEffect can be called by a few different things that apply effects
yeah
so generic method might do it
StartEffect<T> where T is one of your EffectObject types
as long as the constructoirs are consistient enough it should be able to create it as needed
I would make a struct for all of the parameters and pass that instead . . .
anyone ever have an issue with all file folders disappearing and no asset showing up even though it still runs?
You sure you're just not typing something in the search bar of the project window and it's returning no results?
I'm not getting anything it's like my whole folder list has vanished. I was doing a cleanup and doing a re-organize of the folders.
Can you show a screenshot of your unity window
doesn't just replace the switch with a method for every effect type?
I thought about that too but then I still have to check those to know where to put everything
generic type
more or less CreateEffect(EffectType) becomes T CreateEffect<T>()
though ideally would try for a more data oriented way, what is different between all of these types?
public T StartEffect<T>() where T : EffectObject, new()
{
var effect = new T();
// Set Some common stuff on effect
return effect;
}
though depending on the structure of things still some much better ways
well the effects are all different so I still end up having to write a case for each type individually
they don't really have much in common except for their structure
it looked like to me most were having the exact same args pased to them
yes but they do different things
so would be able to construct them, and create them no matter the type with the above code i put
then just have a method on EffectObject that lets you set all the common dependencies and data
well if I do that that moves the checking to the EffectObject but I still have to check for each type
checking what though
if they all have totally different thigns passed you will need to handle that, but if they have things in common that can all be done as 1 step
I've noticed all of my UMA characters have disappeared as well, I can still move around but my avatar has disappeared.
this is a code channel
oops sorry
Clear the search
hey! I got a problem, I need to instantiate an object with a shadow caster and the shadows need to render. but when I do it in my build, it doesn't render any shadows. what can I do (no I can't make it without instantiating)
I mean the effects are still different effects so I need to know which one exactly has to be created
my best idea so far at this point was to group the different calls in the switch by constructor so the switch is at least a little shorter
well either that
or ditch the whole enum thing, make all of them in a central place and reuse them
then the thing calling StartEffect passes th actaul instance already amde
if it works in editor and not build, either the rendering settings arent the same as editor for build or you may need to debug some error specific in player mode
it works in editor (almost...) but doesn't work on build
how do you mean?
ya misread it, anyway I edited it. Make sure the pipeline settings match, often they are different
I'm with urp, where are my pipeline settings?
under Graaphics and another under Quality I think
in project settings.
also this might be more of a #1390346776804069396 than coding Q
I could also use the same constructor for every effect and pass in everything possible regardless of the value being used or not and dynamically create the object with effect = Assembly.GetExecutingAssembly().CreateInstance(effectName) as EffectObject;
but that feels wrong
i would not use reflection
if you need that just do a switch over the type its self
also reflection just moves the problem but still is the same amount of logic
maybe the switch is actually the best solution since everything is in one place atleast
but now its slower harder to read logic
that or the generic method + a switch over hte created type, since it would atleast let you set all common things on one line
then deal with the edge cases after
alright thanks
in my case i just avoid the problem since all effects are created early on, and anything that needs one just holds a reference to it and passes as needed
in my exact situation there were not that many code types for effects, since they were made in a data oriented way and a few effects just modify like player stats or something
and there is a generic way to do that already in the game
mine can do all sorts of things, and I also need to be able to differentiate between buffs and debuffs as well as being able to end them early
If there are buffs and debuffs, they can both inherit from the same Effect type and use some virtual bool property to indicate what they do
you can make an enum to see if it's a buff or debuff
yep I'm already doing both of those things
there are definitely ways around this, like you could create a new class/struct containing all the possible data sent to an effect. every single effect takes 1 parameter which is this new class. the individual effects read the data they want from this new class
what's the difference between setting Rigidbody2D.rotation and Rigidbody2D.SetRotation?
the 2d docs are kinda lacking and there isn't a 3d analog of SetRotation to extrapolate from
I am confused. I just used it few days ago and now it says CharacterController does not have Move method
Set Rotation is the method, rotation is the property
it has a Move(Vector3) method, not a Move(float) method
and what's the difference in behaviour
I think you're not supposed to change the property directly
set rotation is also a method
if you weren't then there wouldn't be a setter
Then it would say no compatible argument
put in Vector3.Forward * Time.deltaTime * _walkingSpeed
seems you made your own class CharacterController