#💻┃code-beginner
1 messages · Page 738 of 1
That's fantastic. Thank you
the objects which is spawned upon a Instantiate which is clones, which is not a object within the scene or anything like that by standard, it appears once started the game, so i cant refer to those
Why not
it kinda sounds like you've fallen into an x/y problem
once started yes, not before
they're still in the scene
Yeah, that's how things tend to work
so what's the problem
they "spawn in" they are non existent in the scene while editing
Again, so?
I want to disable them upon clicking on them.
So call SetActive(false) on them
I have. it disables the reference one in the scene, but more keeps spawning, even tho its disabled
📃 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.
its the reference one
What does disabling an instance have to do with spawning
that tells us nothing
thats what u were refering to with setactive lol
You've disabled an instance of a prefab, which is what you want to do. Why are we now talking about spawning?
you're getting ahead of yourself
you're bringing up links that either are not there, or are very weird links that need context, and you have not given context
No? I'm referring to setting the active state of an object. Which is what SetActive does. What does spawning have to do with this
answer this please @feral sapphire
not trying to spawn. the opposite
So turn off the spawning???
So then don't spawn things? What does that have to do with disabling instances
yall are talking past each other
The thing doing the spawning and the thing you spawn are different things
If they were the same thing, it'd replicate itself until the game crashed
So are you saying you want to turn off the spawner when you click on an instance of a prefab?
the scriptmanager (where the script is attached to) which is an empty object itself. the SBA (reference object in the scene) has the "onclick" actions. and the prefab is from it. its refering to that one when spawning. the spawning works fine, but I want to disable it upon reaching 1 click (hitting one bread) so they dont stay active. but the thing is ive no idea how to do that per say.
What is the "it" you want to disable
so just have the onclick action deactivate itself
and it sounds like it is not the SBA, no
it kinda seems like you're overwriting SBA each time you spawn, so you lose references to previous spawns
again - you're getting way ahead of yourself in your descriptions
I have an interesting question.
I read in the UnityHowHuh - "larger values approach the target faster"
The main problem of WrongLerp is the last parameter not having any consideration of that right? Usually it's something like myRotateSpeed * Time.deltaTime
What if it does have consideration of the "desired delta"? Hence, larger delta values result in higher maximum allowed movement. Then it's not WrongLerp anymore is it?
A tool for sharing your source code with the world!
it's wrong lerp because it's not linear interpolation, that's it
it's.. not that complicated
Okay, so SBA is the prefab
Disabling that won't do anything
But I also still don't know what you're actually trying to disable
the "correct"/intended form of lerp is y = lerp(a, b, t) where a and b are constant, and t changes in a given direction
wronglerp is in the form a = lerp(a, b, dt), so a is not constant, and dt fluctuates (but is pretty much constant)
trying to disable the already spawned in "breads" that has been placed there
ya just made it straight into my Unity_Knowledge screenshots folder
thank you so much! it's making sense
or simply remove them from the scene
So, the clones of SBA? You want to disable all of them?
yes, the clones of SBA correct
Then you're going to need to actually store those references somewhere and call SetActive on them
Right now you put them in the spawnedObjects variable and then do nothing with it
So, actually keep that reference around, and disable that
why doesn't this work?
char Character = TargetText[Rand];
bool isLetter = Character.IsLetter();
seemingly char.IsLetter(); is a thing, so why doesn't Character.IsLetter(); work?
I tried it with "breadlimit" as they are a float that should be counting them, if there is more than 1 bread on the scene i want it to be disabled
It's a static function of char. Not a member function of a variable of type char
You call char.IsLetter(Character)
Which ones do you want to disable
clonses of sba, same as always
But you said "if there is more than 1 I want it to be disabled"
which ones
Presumably, you want one of them to not be disabled
which one
If you just want the first one to exist and not have any others, why not simply not spawn extras if there's still one?
Sorry guys if it's dumb question -
Does anyone understand the math of this UnityHowHuh about WrongLerp?
They say to use 1 - Mathf.Exp(-decay * deltaTime) as the t value with decay = 10
I'm really unclear on what this is doing or how it affects the Lerp. Thank you 
How do you apply the former to something where X is following Y though? X and Y are both not constant, nor is t, assuming that you want this smoothed motion that you usually get when using a = lerp(a, b, dt) so you cannot use MoveTowards with a maxDistance.
so if you look at the code, 1 of them is spawning, the other ones doesnt until xx amount of time. (its set to short now) but Its alright if there is more on at the same time. the problem is that they dont ever go away. so if I dont make em dissapear, the whole screen will be filled, and you can click on them infinitely
When do you want the bread to be disabled then? Is it when they're spawned? When they're clicked on?
like, they are supposed to be like in cookie clicker where 1 golden cookie spawns
agreed, MoveTowards and RotateTowards tend to feel pretty ehh if used in a basic way. I think it's because it reaches the 'max delta' fast and ends up feeling too constant
when clicked on
...so have the bread disable itself
how do I do that?
Whatever code you're doing to detect when the bread is clicked on
also disables itself
Yeah it's neither an Ease-in nor an Ease-out whereas a = Lerp(a, b, dt) would be more similar to an Ease-out.
I actually was able to make them feel about the same as Slerp/SmoothDamp, by having the max rotation this frame scale by the angle delta. on a curve.Evaluate() of course
As I understand it the basic idea of smoothness is "large delta, move more. small delta, move less"
it's an exponential decay curve
freya holmer has a pretty good video on it
its the one I showed
What's the one you showed
I get that part, I just wondered if anyone knew exactly what
okay thanks i'll check it out! I wanna learn more before I go re-doing all my Lerps.
I've watched that one but asked this question again because the talk is omega-confusing for me.
its the code. that detects if its been clicked on
if it's smoothed then it isn't lerp
Nothing in the code you've shown has anything to do with clicking
There's no click detection in this code at all
Mostly I never have myMagicValue * Time.deltaTime there's always some "higher delta yields higher allowed change this frame"
it is smoothed... because of the mis-use of the lerp function i gave...
Pretty sure the behaviours are identical in this case. Or is there more to it.
i shouldve been more clear - if it's smoothed, then it isn't "correct" lerp, so it doesn't fit the first form
you mean like "OnClick" ? I dont have any of that. every "void" i have is for a button, and then i put that onto a object and call that one a Click xd
So, go to where you detect the click
and add in one
that disables the object
yeah i know, i was just trying to get a "reference experience" if you wanna call it that
not sure what you mean by that, could you elaborate
well, everyone knows what the interpolation feels like if it's a = lerp(a, b, dt)
that's why i asked how you do it properly
i mean, depends on what you mean by "proper", i guess?
if you just mean making it consistent, that would be the exponential decay thing
properly solving the problem means actually reaching b and not approaching it
sounds like your thinking its like right click and boom done. Its like asking what is 3984x192 with no help ive no idea lol.
Well, obviously you know how to call a function from an on click since you already are
you would define an epsilon and then snap to b when the distance is less than that epsilon
and you know how to disable an object because I've told you
Yes. What is the way to handle that?
For some of my functionalities, I've literally just implemented a "minimum approach velocity" because, well, yeah the
SNAP? I KNEW IT!
So, just, do that
HAHAHA!
I dont have a "onclick" funciton anywhere
Then what is calling the function
i had that thought when watching the talk too, which makes me wonder why the complicated exponential decay was brought up by her in the first place
because that makes it not frame/fps-dependant
its a button on the reference (SBA) and the script for the button is the one I showed earlier
So the button
One Lerp away, from AAA! 
what is the name
of the thing you do
to set a function
what is that called in the inspector
so add a function
why can't you do a = lerp(a, b, p * Time.deltaTime)? i think she tried to explain it in the talk but the entire talk was pure confusion and overwhelming so i didnt really undersatnd it
that disables the object
you can
it'll just be fps-dependant
OH HEY LOOK ITS A FUCKING ON CLICK
its what i refer to "button"
Yes and I called it what it's actually called
So add a function to the on click
that disables the object
You know what function it is
I've told you it before
You can put the pieces together
I believe in you
how so? p would be p per second and p * dt would be p per frame
ok, and what is p
myMagicNumber * dt - no good
the 3rd parameter isnt supposed to be a delta time, it's just supposed to be normalized time
thats pretty much the whole reason its wrong
Normalized time? Sorry, what is that
this is addressed in the talk, the "per second" is just some vague quickness factor
Percent of the way done
dont xd
0 means none done
1 means full done
i mean, it should be neither, it should be a percentage
"normalized" usually just means it's something to do with 1
normalized time means between 0 and 1
normalized vector means magnitude 1
etc
You know how to call a function in on click. You know the function that disables an object.
Call that function
from the button's on click
which normalized time is
So guys again... If the "t" value is dynamic, NOT just magicNumber * dt - we're actually totally cool right.
but the percentage concept is inherently flawed because a is not constant
yes which is why it's called wronglerp
if you dont know what normalized time is, thats fine, two people above have written it above already
No, it's still a percentage. Unless the third parameter reaches 1, it won't reach the value of b
So, if you want to make sure it reaches b, make sure you do something that involves t being 1 or more
What if the t value is lower or higher based on the delta?
a is not constant because you're using it wrong. Look at the docs for example for vector3s lerp
https://docs.unity3d.com/6000.2/Documentation/ScriptReference/Vector3.Lerp.html
parameter a is a Start value not current value
It's not a WrongLerp then or?
it doesn't matter because delta is like, 1/60, nowhere near 60/60
i just checked how it was explained
Oh goodness. that's right...
but the problem is that there is no predictable start and end
so you cant normalize it
petition for unity to rename lerp to wronglerp
no, the usage is wrong, not the function
lerp stands for linear interpolation. if you aren't using it for linear interpolation, you're technically using it wrong
Lerp does exactly what it says it does. It gets you a value that is t percent of the way between a and b
the issue is on you, not unity
The problem is assuming "Lerp" means "Do this thing over time"
yeah i use Lerp correctly sometimes too. for like, "happens over 0.5 seconds" things that have a start and end
there is a Lerp and LerpUnclamped specifically for this. By default it should limit the t value to be between 0 and 1. Unclamped should allow you actually use a value such as t=2
lerp is just a * (1 - t) + b * t
i mean "wrong" depends, the function does what it should, you just use it in a way that isnt what you actually want
yes, that's why we're talking about wrong usage
Basically. Our whole issue is, to go from currentValue to desiredValue - and how much to approach it the current frame.
what are you going on about
then you shouldnt be using lerp if you dont know what the end is lol
If you want to move a value towards a destination and the destination is amorphous, you'd want to use MoveTowards
i just struggle to continue talking about this because everyone is just saying that everything is bad and wrong and that all people using it are bad and wrong but i dont see any explanation of what the alternative is what to use instead
we don't know what you want
but that wouldnt give you the same feel
also, no-one is saying it's bad
it's objectively a wrong usage of the lerp function. but if the output is desired, then it's a correct application of wronglerp
It's not "bad" it's just "not a linear interpolation"
bawsi is saying you shouldnt use lerp which is the equivalent of saying that the approach is bad
There is also SmoothDamp
🤷♂️ if you wish to minimize everything that was said to "everything is bad and wrong" then is there really a point in this?
please read more than half the sentence
that message was vague tbh. i think bawsi interpreted it differently and gave a perfectly reasonable response given the interpretation
Lerp can be part of a greater mathematical function that achieves something that is not a lerp.
I can explain things in different ways if you don't understand it. I can't read things for you
My message specifically said if you dont know the end value
that's not what i wanted to say, i'm just overwhelmed because everything is confusing about this topic
and i probably still didnt process the talk and am still confused and overwhelmed by it
ok, let me summarize then. give me like, 10 minutes
It's a fundamental issue, so, yeah there's no "this is how to handle the issue"
i omitted "if you dont know the end value" because that was our context for the topic
The best solution is to just actually get a grasp of what Lerp actually does. Then it becomes a tool in your toolbelt and not necessarily the magic words you throw at a problem. When you have two values, and you want to get a specific value between them, use lerp
This shows each with non-constant inputs.
but ultimately the solution i have rn is "use fancy freya formula that i dont understand nor comprehend"
and that is what is frustrating
Yeah that's why I freaking hate MoveTowards.
The only way I can make it feel decent, is by basically making it like SmoothDamp with curve.Evaluate()
Then maybe you should break down the math and figure out what it's doing
this is definitely misleading considering none of these objects are at the same horizontal position. MoveTowards and Lerp cna be used to achieve the exact same result.
using them wrong gives different results
how am i supposed to break down a completely uncomprehendable exp(x * dt) factor? but as you said, maybe i'll take time to watch the talk but for now it'll just be "not understand"
Anyways, do a and b need to remain constant for SmoothDamp to work properly?
no
hello im starting programing in unity. Im making 2d game what extensions in visual studio code can help me with that?
!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
Assuming deltaTime is 1/60, it looks like this
(missing a 0 in that 0.0166)
Ah, you're right
So shift the whole thing down a bunch
So.. basically, it's some kind of smooth curve
either way yea thats how exponential functions look
IRL everything moves in curves eh? Just how things work physically
lerp stands for linear interpolation. the "correct" usage to get a linear interpolation is y = lerp(a, b, t) where a and b are constant and t is a normalized value that either increases or decreases over time.
if a or b aren't constant, or t does not increase/decrease over time, then it is, in regards to "linear interpolation", an incorrect usage of lerp.
a = lerp(a, b, dt) is a common usage of lerp that can be useful to emulate ease-in smoothing, but ultimately is not linear interpolation. since it's a common pattern, it has the name "wronglerp".
since it's using a function that isn't designed for smoothing, it comes with a few hidden issues, mainly time inconsistency and asymtotic behavior.
time inconsistency: dt does not have reasonable "percentage over time" units as one might assume, and multiplying in factors just have a vague "quickness" effect. different values of dt will make wronglerp approach b at different rates.
this is solved by sampling an exponential function instead, yielding consistent results with different values of dt, due to some math regarding euler's number.
asymtotic behavior: lerp will yield b once t reaches 1. since this usually will not happen with wronglerp, b won't be reached.
this is solved by setting an epsilon, where b is yielded once the distance between a and b is less than the epsilon.
@hardy wing
oh shoot, it's not exponential decay is it, it's just exponential
and TIL euler's constant and euler's number are not the same thing
thanks, euler
how can i find the point at where two different strings change.
iterate through them until you reach the end of one or you find a different character
@naive pawn the epsilon snapping thing is just a hacky bandaid fix for WrongLerp right?
Or when doing things correctly is it also required?
I'm wondering if there's a way to have the smoothness but also reach the final value.
it's useful for any asymtotic function
(asymtotic just means it approaches some value but never reaches it)
Copy that. I'll keep that in mind
Yes thx i googled it already 🤣 math class was long time ago
freya's video also has a plot with the "better" wrong lerp i think? and that was asymtotic too
sorry 1 last dumb question. this part of the UnityHowHuh - this is still technically wrong or it effectively becomes like SmoothDamp?
It says it solves frame rate dependency, but it doesn't say if it's still bad practice to do this
the website has a graph underneath showing the values you get as a result. if thats the result you want, then its not bad
i think SmoothDamp also does the epsilon thing inside but i can't confirm that because i cannot wrap my head around its code lmao
it's still technically wrong, and it's not like smoothdamp because smoothdamp also has ease-out
but neither of those are bad
tf is a unity how huh
https://unity.huh.how
it's a site made by one of the moderators here and has a plethora of useful debugging info
The lerp info there also linked to this, which has a lot of useful stuff for making your own animation curves for easing in and out
https://easings.net/
Like if you want only an ease in with a sine curve
function easeInSine(x: number): number {
return 1 - Math.cos((x * Math.PI) / 2);
}```
That's not C# code syntax, but easy to figure it out from that formula
I have tried using:
private void OnMouseDown()
{
Destroy(gameObject);
}
public void HitButton()
{
RewardText.text = "You hit 1 Bread";
BreadHit += 1;
Destroy(this);
}
but none works so im out of ideas.
Is this code on the object you want to destroy
Destroy(this); <-- be careful with that one, as it will destroy the script/component running it, but not the game object it's attached to
2 different types ive tried upon click
yea noticed that
Destroy(gameObject) will destroy the object the script running this is attached to.
Destroy(this) will remove the script running this from the object it is attached to.
Both affect the object that is running the code. Is this script on the object you want to destroy.
and now it just magically works
I had the Destroy Gameobject on the manager as well (removed it from there, and added to only the object and it works)
HOLY SmoothDamp code, I just looked up the reference implementation
how do I change the triggers using code in a button component?
specifically the Normal Trigger
oh i figured it out myself right before finding yours
thats lucky lol
why did all my animator controllers clear?
Hi everyone, could you please help me with this error in my code? Please watch this video first so you can understand exactly what's happening when it shouldn't.
instead of spending more than a minute wiggling your mouse around and waiting for loading bars, you should have just recorded just the last bit so we can point out that it seems to be an issue with either your animation or the placement of relevant objects
The object that prevents the player from moving does its job, but it doesn't move the player's vehicle; that's what you've observed.
so your issue is not that the player is floating above the seat? because if that isn't the case then your video was not clear at all
!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.
https://paste.ofcode.org/wVTu29YzsdCLv2Ekdm7cjj Look at what the code looks like
now actually describe your issue in detail
is UI Bugged and confusing or is it normal for it to make the objects and sprites disappear?
Read the code, it doesn't mention control of character or car, it's just telling the player to get into the car and activate the car script. So your issue isn't in this script
When I select on my sprite, everything appears, but when I go to my text everything disappears
Bugged in that version, try version before..
it only disappears in the editor
not the whole game
so when I run it, or preview it, the text is there, and everything is there
show relevant code. otherwise #📲┃ui-ux (you'll also need to provide relevant details about your UI setup)
There is no code, it's just Legacy Text with Canvas
this is a code channel
Oh sorry
hi, since machine learning and LLM AI has been all the rage for a while now i'm wondering if someone's made some sort of "game" or tech demo that lets u make an NPC with any type of skeleton (i want it to use my custom Ark raptor model) make any movement, sound, or activate any particle effect or script u want on command, either through talking to it through your mic or text? i know these types of experiments have been going on for a while but i'm wondering if any have been somewhat successful
That'd be up to if a specific AI tool would handle that. There have already been games with npcs have AI generated speech at runtime. You generally arent gonna find people here interested in these kind of things.
The rest of this would be pointless because you can be sure it'll fail very quickly. AI isnt going to make good animations, particle effects, or scripts at runtime.
well the movement stuff would basically just be for animations and even then not even all of them, the particle effects and scripts can be made normally
🤷♂️ doesnt matter to me if its if its one or all of them. My comments still stand on it. its up to you to find a tool which can generate what you want, and then you hooking that up to your existing logic. Either way you're going to quickly find out why no one here does this
Don't be dumb and use some api in the client because people will just steal the api key and fuck you
if it must be some llm then you need a local model or a server you create that then uses some third party llm rest api
yeah i do prefer local processing instead of cloud shit
I have no idea if anything exists that is compact enough for viable use with a game but you can do some research on this
k, any other discord server u could recommend for what i'm trying to accomplish?
i mean i'll use cloud shit if i have to for now
you can just dont directly use it in the client/build
I dont know any places where you'd find these kind of tools. That depends if they even exist in the first place.
Even generating text/speech at runtime is just a gimmick thats already quickly faded out. I doubt AI companies are rushing to push AI animations (at runtime) considering it'll likely just bug out and get boring after the first 10 mins if it works
Interesting idea, however consider the issue of accents. Let's say you programmed it, and it worked, but you have a heavy south eastern American accent. Me, a fellow with an English accent wouldn't be able to use it
You're mixing up several unrelated concepts. Or at least concepts that would require many different AI models(speech recognition, llm, tts, animation generation model, etc...). While some of it is possible given enough effort and costs, other(like animation generation) is probably not gonna be good enough for a real time app, even if you're using a cloud service via an api.
If you're looking for a simpler example(TTS + LLM + peach recognition), could look at a game called AI2U.
The animation for running seems to keep playing even after I stop. Anyone know how to fix it? This is the code I'm using for the triggers.
if (Math.Abs(Input.GetAxis("Vertical")) > 0 && uIManager.isGameActive)
{
anim.SetTrigger("Move");
}
if (Math.Abs(Input.GetAxis("Vertical")) == 0 && uIManager.isGameActive)
{
anim.SetTrigger("Idle");
}```
Seems like an issue with your locomotion state(or rather it's transition to ide). Probably too long of a transition.
GetAxis has smoothing. It doesn't go to 0 the instant you release the button
that any to locomotion transition seems bad too
disable transition to self for a start
I know it's bad, but I'm jury rigging a more involved animation that the pathway gives to you
Thats why there's all that unconnected stuff to the right
What does that mean?
I think that is an option for any state transitions
you can see it keeps transitioning into itself
dis guy
Doesn't fix it
you need to do more like correct the other transitions to not have exit time + a long duration
anyway this isnt code stuff anymore so ask in #🏃┃animation for animator problems
ah lame they changed a bunch of channels to be forum-style so it's less efficient to just bounce ideas off of people
the channels still there, but hidden at the top of the forum channel
looking for some help here real quick, I wanted to change how I do my Raycasts (to turn it into a CircleCast so it can see a little below the line)
so I wanted to turn it into a seperate bool because the way I have it done now kinda sucks. but now it constantly sets off.
https://paste.mod.gg/uyacorvwjivt/0
main note is that
``` is constantly true, regardless of player distance*
A tool for sharing your source code with the world!
so distance has to be after layermask?
Yeah
okok let me try that
no
oh
I misread that since it is late lol, distance is before
Yours doesn't have "distance"
So the mask is acting like it
tysm
Im gonna say it just in case its simple, but all I need now is to find a way to the number positive/negetive depending on direction, but its prolly a transform thing
(trying transform.rotation.x + 1)
please do not spam here
67777 😂
No reaction gifs . . .
that isn't even a reaction gif
I mean in general... Don't be annoying
can somebody help me with a weird issue with the inspector breaking?
I don't want to dump all the error messages here but I haven't touched anything editor related and I'm getting strange unity UIElements issues
Is it things vanishing like text on the right hand side?
What unity version are you using
most recent lts
6.000.0.58f1
windows
I started with 6.000.2.5f1 and had the same issue so downgraded to lts and the issue kept happening
I can give specific error messages if it would be helpful
First step is restart your application, see if that fixes, if not since it's an editor bug you'll have to file a proper error report with screenshots
If it's your code, here, if it's Unity itself, their proper channels. 1st step for all issues is restart as you did etc, 2nd can it be repeated.. in this instance it has been just not by you.. 3rd report it
do you think it would be worth it to keep downpatching until I find a release where it isn't an issue?
i've been working with unity for 4 years ish and i've never run into this issue before
thank you, i'll try that
I read over it and I just saw one reference to CharacterController.Move
Hey I'm having large spikes in my game right now. Looks like its under "other" category. i have like 6-10 objects in the 2d scene
not sure why thats happening
looks like the rendering is super slow? not sure since im new
could be my pc as well, but my pc is pretty good. i have had problems with my GPU in the past though
I mean.. I thought my pc was good then blue screened it 4 times in a row... There should be some tests you can perform online to see if it's any failing components
The screenshot shows that you player loop is waiting on a Semaphore most of the time.
Semaphore means that the main thread is waiting for another thread or the GPU.
Use the profiler hierarchy view/mode to see more info.
Pro tip: don't use the timeline view unless you know what you're doing. The hierarchy view is way easier to understand for a beginner.
Also, it seems like the player loop is just 13 ms, which is more than enough to run at 60fps.
Around 2/3 of the frame time seems to be coming from the editor loop.
If you don't care about editor performance, test and profile an actual build.
If you do, then you'll need to switch the profiler to editor mode to see what's going on.
ah okay thank you! i guess ill look into the Semaphore thing
if i have a composite collider for my ground objects and i move a ground object from the left to the right side of ground plane would the composite collider update? and would that impact performance?
im making a 2d endless runner and i have like 10 ground objects
that i move to the front after the player runs past them
i should probably make each ground object long, so i dont have to move them too often
is there a way to use FindGameObjectsWithTag() on a list rather than an array? i need to find active objects with a specific value in one of their components and my way of doing that is to find all objects with the right tag, get the component and remove all of those with the wrong value from the list but i'm getting a conversion error
Why do you need it in the list?
You can add the desired element to a separate list that you reuse.
because i can't remove the values from an array, from what i know. i may be stupid
Why do you need to remove them?
how the Fuck did i not think of that
i'm getting all objects with a tag and removing the ones i don't need from the list
So the result is gonna be several objects?
In this case yeah, create(or reuse an existing one) a new list and add them to that list instead.
thank you
i can't find much on the unity docs about lists so i may need to ask a few silly questions
The unity docs arent gonna cover lists, they are a c# thing
foreach(Itemtype item in listname)
{ if(item.GetComponent<component name>.variable)
itemlist.Remove(item);
}
else continue; a quick example may need tidying
Its not a good idea to spoonfeed and is discouraged. Plus that is just straight up wrong
yeah i prefer knowing what to do myself
Expand on why
Dlich gave you good steps above. Google how to do the individual steps if you dont know how to do a particular one "how to add to a list c#
because solving people's problems for them teaches them nothing
It completely removes the critical thinking aspect of problem solving
Oh I meant the wrong bit
thank you guys, i'll get back to it
Well first off it just wouldn't compile. Your else is in the wrong spot. It also does the opposite of what's needed, adding to a new list
Its also particularly a hassle to go into a lesson correcting someone providing wrong information, in the middle of helping someone else. Generally this happens when people try to spoonfeed
I did say it needed cleaning up, formatting on phone is not the best.
And the adding to a new list is needed if he needs the data of the components he doesn't want in the new list
protip: if you're on mobile and not confident with writing accurate code, just write in pseudocode
If you already have one singular list, and don't need certain aspects of that list, just remove them
Confident enough, able to type it on phone no. So I'll take that into factor next time
transform.rotation = new Quaternion(0, playerCam.transform.rotation.y, 0, playerCam.transform.rotation.w);
I did a little "hack" to rotate in third perspective based on a Cinemachine orbit look camera, is there a good reason not to do this?
You can justify it all you want, saying it needs cleaning up is just an excuse that doesnt change anything about what I said above. The code is just wrong.
It was also clear they are starting with an array, so it makes no sense to be removing values from a list that doesnt exist
foreach (GameObject saveData in objectsToSave)
{
state = new();
nSaveable = saveData.GetComponent<ISaveable>();
if (saveData == null)
{
continue;
}
if (data.sStates.Contains(state))
{
data.sStates.Remove(state);
Debug.Log("Data Changed");
}
// HandleInventory(state);
// state.itemsInInventory = nSaveable.SendData().inventory.SendItemFromInventory();
// state.itemQuantities = nSaveable.SendData().inventory.GetItemQuantities();
state.id = saveData.GetComponent<DataHandler>().objectID;
//Iterates through the entire list of states in the List<SavedData> and for each one, checks its ID against the objects raw ID
for (int x = 0; x < data.sStates.Count; x++)
{
int sDataID = saveData.GetComponent<DataHandler>().objectID;
//If the ID matches, saves the data below but first, deletes the data from file to replace it fresh, this happens to prevent duplicates
if (data.sStates[x].id == sDataID)
{
data.sStates.RemoveAt(x);
HandleChangeableData(nSaveable);
HandlePermanentData(nSaveable);
data.sStates.Add(state);
}
}
Ignoring the end aspect, you are telling me this code would not work?
Because it's nonsense?
Well it's just a quick prototype and it does what I want
well it's nonsense code that doesn't even maintain quaternion normalization
Are you asking your code question here or is this a response to my messages above?
If the latter, this completely different code block doesnt change anything that you shouldn't spoonfeed. Especially code that isnt valid.
well, its not a code question since I know it works, and it does implement the feature i mentioned, albeit far tidier. The original question asked if it was possible to do in an list and not an array, hence the foreach loop mentioned, yes the code wouldnt work due to several issues, but was enough for someone to look into ie what is a foreach loop
Ok, my thinking was that I might as well use the exact rotation from my Cinemachine camera to match where my character is looking exactly instead of constructing the rotation myself
it's unclear what you're even trying to do because the code makes no sense
yes the code wouldnt work due to several issues
then it shouldntve been provided as code - it's misleading to a beginner that might not be able to recognize the flaws you might think are obvious
if you want to suggest foreach, then do so
🤷♂️ I dont know what youre trying to prove here, nor do I care to continue the conversation. The code you tried to spoonfeed initially was not valid c#, nor what they needed for their problem. Even if it wasnt wrong, spoonfeeding is still discouraged.
I dont care to look through this completely different codeblock which is brought up for no reason
don't use the xyzw components from a quaternion, they are not designed to be directly modified without proper knowledge of the underlying maths.
Why not use Euler angles?
Just simple look rotation. Orbit camera rotates -> character rotation is matched with camera
You could even consider using a RotationConstraint and to not write any code at all
Yes but I'm not modifying anything no? I'm just copying the rotation over (y-axis only)
Yes it's very much a "hack"
Here I don't need anything precise but yeah I should
ok so i have a typewriter effect and i'm using maxVisibleCharacters but i also want that movement of the text when typing how can i achieve that?
With tmp you can modify the mesh produced via an event (or you can modify the whole mesh and replace it if you prefer). This can be used to animate the text. There are also free packages that offer many different pre made animations for tmp text.
https://docs.unity3d.com/Packages/com.unity.textmeshpro@4.0/api/TMPro.TMP_Text.html#TMPro_TMP_Text_OnPreRenderText
https://github.com/Luca3317/TMPEffects
i'm not looking to animate it, just have the characters move to center themselves.
Center alignment? Do characters that are not visible still affect alignment then?
yeah.
if you just want the text to appear over time then you can just update the text with more characters.
Otherwise alignment wont act as you wish
Hello, I am new to the channel.
I want to share data between multiple mono-behaviour script files of game objects. Anyone interested?
Not interested, thanks.
You can pass data between instances via methods or properties.
Other than that, go learn C# basics.
Easier : i could keep public variables in the header of the class. whatsay ?
Bad practice. Goes again OOP and SOLID principles.
You can have a public property though.
can you create a game like whiteout survival using unity?
also, a common data file that all can share ....whatsay ?
cant you just use static fields
Unity is a tool like any other, the possibilities are endless, it is defined by you and your capabilities
yes, that is obvious if one is sharing the data between several classes
is it possible to create a large game?
it sounds like you want global variables, but global variables will lead to all kinds of trouble. instead you should rethink your design.
Very much so, Devs such as Owlcat Games worked with unity when making their pathfinder games
cool , thanks
Sounds silly. File reading/writing is expensive.
I think scriptable objects.
That would be sharing a reference to an object in the memory. Not a file...
Yes I'd say so
To start with if you know little to nothing, unity learn.
Else 2d, importing the multiplayer packages
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
thanks
hlo , we wade some levels of a game, initially they're doing well and now after 7 8 levels when pressing the play button, it immediately stops playing and there are no errors showing in any case like on console, script is the same for every level with only some changes but 1 or 2 levels works sometimes
ill be frank this isnt really scripting but it is very simple and i dont know how im messing it up, imported a bird library and the textures are all fucked up, the sextures are set in the material but alas, its still pink? tried swapping the textures and playing with some value to no avail
and please use the correct channels next time instead of intentionally using an incorrect one
unity.huh.how is an incrediibly funny url
it was not intentional???
ill be frank this isnt really scripting
you knew you were posting in an unrelated channel, that is literally the definition of intentionally using an incorrect one
to my knowldge other channels were more discussion not for help, most servers for other engines have like, help_0 help_1 etc
is anyone able to help over vc my codes not well written and i cant figure out the problem im trying to put a score text over my game when its running and a gameover screen wich also shows the final score
there are no voice chats here. if you need help then you need to actually provide details about your issue here
!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
!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.
How can I create a Texture2DArray that only lives inside the GPU?
You most likely want to write a compute shader for that but im not 100% on that topic 😄
Make it not readable and call apply with the correct params:
https://docs.unity3d.com/6000.2/Documentation/ScriptReference/Texture2DArray.Apply.html
Look at the lines that are underlined in red, and start to fix them from top to bottom
i tried but its like really bad
I thought that too, however the CPU texture2darray still survives. Now im playing with a RenderTexture set to texture2d array which seems to, at least, not create it ever on the cpu
RenderTextureDescriptor descriptor = new RenderTextureDescriptor(sizeX, sizeY)
{
dimension = TextureDimension.Tex2DArray,
volumeDepth = texturesLength,
enableRandomWrite = true,
useMipMap = true,
autoGenerateMips = false,
graphicsFormat = GraphicsFormat.R8G8B8A8_UNorm,
mipCount = mipCount
};
current = new RenderTexture(descriptor);
You make a RenderTexture that is an Tex2DArray.
Seems i'm on the right track then!
Now, separate but similar, can I somehow move NativeArray data into a RenderTexture? Basically write directly to the render texture, without going through a Texture2D copy. I understand I can create a texture2d, get a writeable native array, write, and then move it into the GPU, but then I still would have the CPU version
Apply, once again, only makes it unreadable, but it still exists on memory
Is the code alright or Is it a complete messes? (sryy for low quality vid)
!code
💤
Uhh I don't get it?
bot is slow..
fyi. no one wants to watch a video of code..
if you want to share code use the appropriate paste bin sites
📃 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.
Am I suppose to place my code inside the website? (Tbh I should ask before paste and save it)
The code isn't finished by the way. I just feel like I wrote it in a bad way, So I just came to ask for someone to review.
what specific concern you have about the code?
& paste the code onto one of the sites, save and send generated link
you can paste it here by doing this
no do not share large code this way
yeah, if it's big don't
codeblocks are good for like 5-6 lines of code
The specific concern about it is that I worry that I wrote it in a way that doesn't look "Clean" or something familiar in that term.
here's the link:
https://paste.mod.gg/wvahxebcngtw/0
A tool for sharing your source code with the world!
Well, first thing, you shouldn't manage turns via a string
if it works and you can read it , thats whats important.
a couple of things wrong I see though.
that Coroutine there is not doing anything
Coroutine will delay code inside the method not outside
eg
IEnumerator DelayCoroutine(float delay)
{
yield return new WaitForSeconds(delay);
//some code to run after delay
}```
so that for loop is not delaying
every iteration you start a new coroutine that does nothing for 0.1 basically
okay so.. what's the correct way here?
Do I just use yield return new WaitForSeconds(delay); inside of other medthod that is suppose to be delay?
look at the comment I put in the example
what you could do is also pass a specific method as Action to run if need be .
currentPlayerTurn could probably be turned into an enum for a slight efficiency , clarity , consisentcy.. like not having to worry about any string mistakes (spelling, capitalization etc.)
you better remove that
<@&502884371011731486> spam
!ban 1412567089360928779 span
@osamaatef0429 banned
Reason: span
Duration: Permanent
bye bye 😄 thx
@pallid forum I see you used enum for DicePhase, why not also use it for playerTurn / team for player
other than that, I think you should be okay
I was gonna use string for both but found a little problem while writing OnRollDice method but yeah.
I think I will use enum for both now.
yeah strings are finnicky. they are not type-safe and generally a pain to work with, you can mitigate some issues with const but with enum is basically a const numeral with human-readable labels
Be sure to give every enum also an integer, just in case you gonna use them in inspector or what not and change the enum list afterwards
wdym by that ? enums are serializable in the inspector (you get a nice dropdown for them)
by default they already are integers too
Yeh, but they are 0,1,2,3 for example. but if you use the enum dropdown in inspector and you add in between 1 and 2, the integer of the new entry now will be 2 and previous 2 becomes 3 and so on. And the dropdown would still show integer value 2, which is a new one now and might make your inspector use the wrong enum value
Wow, sorry for that bad description, but I hope you get what I mean 😄
I get what you mean, in certain cases I guess that could be useful if you add additonal entries but here its only two teams anyway
(black, white)
One option is to create a Texture2D, write to it on the CPU, Apply, then use Graphics.CopyTexture to copy from it to the RenderTexture, then Destroy(tex2D) to release all the memory from that texture, on CPU and GPU.
Another option would be to create a GraphicsBuffer, which you can write to with a NativeArray, and copy the data from that to the RenderTexture in a compute shader. I don't really know if there's much benefit to that, though.
Hey uhh, I think I am a little bit confusing in this part.
if I want to delay the medthod OnRollDiceButtonClick() do I have to put in IEnumerator too?
But that cause a red line.
how do I delay it?
public void OnRollDiceButtonClick()
{
if (rollDiceAvailable)
{
int diceNumber = 0;
for (int i = 0; i < 8; i++)
{
diceNumber = Random.Range(1, 7);
rollDiceText.text = diceNumber.ToString();
yield return new WaitForSeconds(0.1f);
}```
yes, if you want to yield within the method it must be a coroutine
you cannot yield a void like that, it needs to be IEnumerator
well... when I put in IEnumerator it cause redline on it too
buit yeah basically aside from wrong return time thats how you delay between each iteration
thats cause AddListener expects a void
What's the solution here?
put the code you just showed in a IEnumerator you call from OnRollDiceButtonClick
private void OnRollDiceButtonClick() => StartCoroutine(DiceRollWithDelay()); // lambda for brevity but you can put it in braces (actually called expression body )
private IEnumerator DiceRollWithDelay() {
if (rollDiceAvailable){
int diceNumber = 0;
for (int i = 0; i < 8; i++)
{
diceNumber = Random.Range(1, 7);
rollDiceText.text = diceNumber.ToString();
yield return new WaitForSeconds(0.1f);
}```
https://gameprogrammingpatterns.com/state.html
Looks to me like the State Pattern could be a good read. The page includes the Enum route, but there's other ways to build it, and useful information overall 
Another great resource: Unity SOLID eBook! Page 80
https://unity.com/resources/design-patterns-solid-ebook
How can I make the head bead get past without problems.I want it to look like head bead is moving and other follow it.
maybe have the collision matrix set where the colliders dont collide with each other... but do collide with the ground
Snake layer -> snake disabled
Snake layer -> everything else enabled
Hello! I'm running into some problems with Unity 6.2 and Tilemaps. My project consists only of a scene, a grid with a script, and a tilemap. If i declare a public Tile array member, then i get all these errors above when i click my grid GameObject in the Hierarchy, even without running the game. What am I missing? Any help greatly appreciated.
Known issue, it's an editor issue nothing to do with your script, current fix appears to be roll back to a prior version that is stable
Thanks! Is 6.2 not considered stable?
do a little search around here.. 6.2 be notorious for bugs RN
stick to LTS unless ur actively help Beta and bug test the engine
F*** me i just read "supported" and figured i'd give it a go
ya, apparently that Tag is "misleading"
THANK YOU though!
I couldn't find that one but gonna try this one
you always want the latest patch for the editor version
as you can see its marked LTS
Is there a way to make other Delay than coroutine
async as well as MonoBehaviour.Invoke()
or just keeping track of time in a float
or keeping track of the target time to reach
void Update()
{
timer += Time.deltaTime;
if (timer >= limit)
{
CallFunction(); // Do the thing
timer = 0f; // reset for repeat
}
}
void Update()
{
if (triggered) return;
timer += Time.deltaTime;
if (timer >= limit)
{
CallFunction(); // One-time call
triggered = true; // stops repeating
}
}```
as a beginner my timers usually consisted of just counting in update
like Passerby mentioned above ^
you can count up, you can count down, you can reset it to count again, or stop it for a single thing
can also just do something like nextTrigger = Time.time + duration;
then in update check if (Time.time > nextTrigger)
does someone know how to disable this reference?
it's part of Code Lens. and it's typically better to leave useful debugging tools like that on
Hym.. u got a point
It's impossible to turn off
The all collisions in player were already disabled including that spike and weapon
I would have said somewhere in the preferences settings
Bearing in mind i dont change my visual studio because i’m a very boring person
Shit im a bit late
Dotnet > Code Lens > Enable References Code Lens Probably good for a beginner to have it on, but I personally dislike the extra height padding so I always disable it 
How can I make movement look better I mean how can I prevent the build up of limbs in one place. I tried freezing the head rotation but build up stayed the same.
So, I'm trying to use OnMouseDown(), but it's not working, and googling it shows a lot of people saying the same thing, but they're all from like, a decade ago. Is there something I'm missing?
Is the object you're trying to use OnMouseDown on a world-space object with a collider?
It is... a sphere? With a collider and rigidbody, if that answers your question
So, it's not in UI, and has a 3D Collider?
Oh, wait, it's working now, but my debug.log still isnt posting anything
Weird
Hmm, it doesn't seem to wanna work once it hits the "ground"
Could be that when it's close to the ground your mouse click is detecting the ground instead
Oh wait, this project comes with a box collider
Would that be interfering?
Yeah, it seems to stop responding once it enters that zone
Doesn't explain why debug.log isn't working when I click it
Fine for my current purposes, though somewhat annoying for the future Im sure
Well, it's not logging because OnMouseDown is hitting something else and the function isn't running on the object you want it to
You might want to manually do a raycast, that way you can set your own LayerMask:
https://docs.unity3d.com/Manual/CameraRays.html
More work, but you can actually customize what you hit
New input system fully breaks those mono mouse messages
im using renderer.isVisible to debug.log true when this cube is in sight of the camera. for some reason, this renders as true even though it is out of sight from the camera. yes i made sure that the scene camera is not triggering it
it states that if used for shadows its also considered "visible" so its not reliable
A better way is to get its bounds, figure out its screen/viewport space bounds and then see if the min or max is within the screen
needs extra steps if the mesh covers the entire screen but the general idea works
oh also needs handling to know if its in front of the camera of behind too
What do your timers look like now that you're a pro? 😃
im still not a pro.. but i typically use coroutines now
maybe #⚛️┃physics could help ya out
Good to know 🙏 I've seen this "coroutine" term thrown around enough times that I'll atleast have to check it out during my commute tomorrow xD
async is where its at 😎
I would not recommend async for beginners though
especially in unity. elsewhere well its the only choice probably
How often do you guys use async? Ive only ever really used it when handling HTTP stuff so im trying to think of use cases in game dev
my loading screen uses it to load in and out scenes
I only use it and stopped using coroutines almost entirely
makes integration with anything else async much better and also fixes the problem where coroutines require a mono instance to be started (and be executed)
if its not a Web/long running operation not often
as a beginner/novice the only time i need async is to load scenes that way i can animate a progress bar and not have the display frozen while it loads up
else its just .... hung loading screen ... pow game
really any other time a coroutine is just fine
Is there a particular reason for the unity disclaimer? Is async operations in unity unnecessarily complex?
oh and awaitable is really handy when dealing with switching threads in unity (or like coroutines you can yield things like fixed update)
async in general (i dont think unity raises the complexity) altho i couldbe wrong
Its because of how coroutines stop "executing" when the monobehaviour they were started with is destroyed
but async doesnt give a shit, its up to your logic to make it stop when you want it to
unity offers alternatives b/c its such a great game-engine 💪
well unity took too long to implement their own task alternative so UniTask is better
https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/
Microsoft's explanation of what it is in C#
ya, i can tell im still a beginner b/c looking thru UniTask stuff and async stuff just feels outside my realm of understanding.. trying to think of a use-case I ,myself, would run-into is impossible it seems lol.. overkill in otherwords
Honestly, can say the same for a few aspects of Unity, but that's why larger teams have speciality. So far what I saw of your work and the questions you answer/ask you have a pretty good footing
"generalist" lol.. jack of many trades, master of none
one day i might start caring about how the threads are working in my projects.. but not anytime soon i would imagine lol
I like the term "Research capable" lol what I don't know I know how to learn and find resources to help me on my way. I can't make 3D art to save my life, but I know how to follow tutorials and replicate that.
Code is same, get the code down, look at why it works, play with it, see what works and what doesn't work, best way to be
Whenever I make a script it makes some other misc files that cause unity to throw this error and enter safe mode. How do I fix this? I googled online and I've found conflicting answers and am now just confused.
PLEASE PING ME WHEN YOU REPLY
What are the files? And have you ensured your Using statements are outside of the class
these are just some files that get created whenever I make a script
and this is what unity automatically puts in them
There are .meta files which is normal
yes my issue is that the second they're created they immediately start throwing these errors
it says I'm using C# 9 over 10 but documentation about switching to 10 seems unreliable
Unity is on C9 i believe anyway, I'm using c9...I can't say I've seen that bug generated outside of my own file I made
yeah this is recent too and I
'm not sure why unity does this by default if it immediately decides to do this??
do you think that editor version would matter here?
I think it's probably the IDE that is making those files.
oh yes I should've included this is VSCode with the project also being a github repo
!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
I've done this already
I ended up finding a kinda dumb fix, I just deleted the first global in every line and it stopped throwing errors
The first? There's more?
the code was along the lines of: global using global [package]
I just deleted the first global and unity was magically happy again
There's probably a duplication or something... Otherwise it would throw other bugs
this was a consistent issue across multiple created scripts
It's not that awful though ig
this obj folder shouldnt exist so delete it
it shouldn't?
I also just got this warning what does this mean?
The project currently uses the compatibility mode where the Render Graph API is disabled. Support for this mode will be removed in future Unity versions. Migrate existing ScriptableRenderPasses to the new RenderGraph API. After the migration, disable the compatibility mode in Edit > Projects Settings > Graphics > Render Graph.
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadMethodAttributes ()
it pretty much tells you exactly what it means lol
you have some type of fullscreen effect that is using the old API so your project was switched to compatibility mode , its telling you in the future it will be removed so its best to merge to new api
ok I did that but when I go to save it prompts me to choose a new location for my project. . . why??
e is my repo name(I was lazy I'll fix it eventually) and changle later is the current project name until I get around to making a better name for it
Hey, i want to create some rooms in my game, which i can go through with my player. I thought the solution was to have one scene with every room of my game, but each room is one gameobject who has children of what it's in the room in particular. Each room can be disable/enable depending on the player's position.
I want to know if this is a good solution or maybe I should have one scene per room, which can cause some problems with the enemies in the rooms.
I ask this because i don't really know if go.SetActive(boolean) with a lot of children costs a lot of performance or not.
Well the code I'm using onmousedown() with is something I stole from youtube for picking things up with a mouse, and I only vaguely understand it. Raycasting is a bit beyond my ability right now.
Loading an entire scene is still going to need to load the game objects in the scene. If youre looking for a seamless transition, setting it active will probably be faster. The speed might not matter depending what youre trying to go for here. It could be bad if you're trying to keep a ton of different rooms all loaded at once
Okay so just having all disabled and only the current one active and maybe its neighbors should be correct for me, thanks 🙂
onmousedown() is pretty trash.. also pretty sure does not work with new input system
I've tried closing and reopening the project and this happens every time why is unity prompting me to do this?
It's doing it's job for now
It's trying to save a scene, so you probably never saved it before.
where should I put that in my project foldes then? I"d assume the default destination is good enough
Should be good enough, but I'd save it in the scenes folder, since you already have it.
ty!!
hey bois how much of the intro to c# do I do before jumping into junor pathway ? Is doing the Getting Started section and the Fundamentals good enough?
Learn up to classes and objects
oh ok thanks friend
For video format it's not bad to say. There both good , the pin resource and this .
Hi everyone, I need help with this animation issue. As you can see in the video, the animation doesn't work correctly when in play mode, but it works fine when not in play mode. During gameplay, you can see the animation of the character getting in and out of the car, but when testing it, it behaves as shown in the video. Please take a look.
!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.
I need help. Can someone teach me unity events? I understand the basics but I am stuck at a place.
The problem will need a lot of explaining.
So start explaining?
In a thread preferably
Its better to Name variables and comments in Englisch
its usually not a big deal since a lot here can understand the code based on the context and methods used, the person writing it needs to understand it too. Anyways its clearly written with AI lol
Okay. This is the whole situation. To test what I have been learning, I am making a first person game. For moving the character, I did these steps:-
- Added a script on the player.
- In the script, made an OnMove function and got InputAction.CallbackContext context.
- Got the player input there and saved in a variable.
- In the FixedUpdate, used the variable to move the character with some speed.
- In the editor, added a Player Input component on the player.
- Expanded the event and used the Move event which I had defined in the new input system.
- Dragged the player object into the Move Event and selected the OnMove function from the dropdown. Doing all this made the character move.
The camera is a separate game object from the player so, in the camera script, I am moving it with the player by using LateUpdate. Now, I want to use mouse to look around. This is what I want to do:-
- In the player script, I have an OnLook function.
- I want to get the mouse delta values in that function.
- When the user moves the mouse right and left, the player will turn right and left and the camera will turn right and left too.
- When the user moves the mouse up and down, only the camera will rotate up and down.
Turning the character is simple, I can do it exactly the same way I did the movement. I will just get the X value of the mouse delta and use it to rotate the character along the Y axis. The problem is with camera. I know I can just take reference or get the player input in the camera script and then get the mouse input values there. But I want to learn how to decouple scripts. I don't want to get any references. I want to learn events or something like that. Youtube tutorials are confusing me even more. I don't understand what I should use, Unity Events or C# events and why? Then I read another term everywhere called Scriptable Objects. What are those? How do I use them?
I want a centralized place where I can declare all the events for now and fire the events from anywhere and listen for the events anywhere.
I'll give you the codes.
!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.
https://paste.ofcode.org/SuuC5ki2JGPWs6wS7jQAG6
Here are the codes.
hi im very very frustrated with this error because well im obviously a beginner
I have set the variable at the Components
i do not know how tf GetComponent work, neither did the tutorial im following did say, I am just following himm with this, BUT im getting an error with it and He is not, error is
Object reference not set to an instance of an object
Imm well aware that textMeshPro Variable is being set to another object, but does not know what is, I have 3 different buttons working on it so I need it, and the tutorial apparently said it is so communicate scripts with a variable
you should just consider using cinemachine for camera functionality. it has pretty much everything you'll ever need. Your current code for it isnt logically correct. you're reading quaternion values and plugging them into a function expecting euler values. Your controller script is also a little bit confusing, you have playerControls which I assumed is the generated c# class from the input asset but then you also use OnMove and OnLook which should come from the PlayerInput component. That component could also just send inputs to a script controlling the camera though still cinemachine has this behaviour by default.
as for your actual concern above "I don't want to get any references", this isnt something to always strive for and doesn't make sense in a ton of cases. All you'll be doing is hiding dependencies and making it harder to debug if you needlessly "decouple". The furthest id go here at the moment is having a separate component purely for input and you can choose to either pass values to the movement component, have the movement component directly read values, or use events (which i dont see a major reason for). Separating these out would let you use an interface and have different types of input if needed like npcs.
as for events, "Unity Events or C# events and why", unity events are just serialized events. you can assign them in inspector and thats about all. It has its uses but I tend to avoid it because I find it's quite annoying when trying to follow a chain of logic and then suddenly theres a unity event so I can't find everything referencing an event in my IDE. Scriptable objects is mainly just a data container and you dont need it for this case. Theres a lot more to it that I just dont want to get into right now. It'll be best if you just experiment around with it
if you are assigning the value in inspector, you don't need to get the component, you already have it. This is calling GetComponent on the same game object that HealthUpdate is on. If theres no tmpro ugui component on this object, then it will be null and you are trying to set the text on null
Calling GetComponent in Update is not recommended. It is better to call it in Awake or Start.
I wanna clarify something, so first of all,,
there's 3 different buttons that im working on with only one script, Im trying to know or detect the type of functionality of that button with enum, so it is in the component, if it Heals or Damage, and then use switch function on which is working when the button is pressed.. The reason im doing this is because I think that the 3 different scripts are independent to each other, and when I tried not having a getComponent, the variables simply cant communicate to each other because the scripts have its own variable I wanna give an example:
when I pressed the damage button, the public variable on it changed, good, but the public variable on the other scripts doesnt, that's how I got the idea of script independency or simply all of the script imported aren't the technically the same
Now I tried searching how to get it communicated, and so far that's the thing I got, GetComponent
all youve shown so far is 4 lines of code, nothing that has anything to do with buttons. If you have 3 different scripts, then you need to drag in the references to each script or make sure each object with the script has a text mesh pro component with it
oh wait yeah im stupid lol
lemme send the script and see if you could review it
either way, your code is calling GetComponent so it doesnt matter what you assign to textMeshPro
its being overwritten
hmmm ok, so how do I get those 3 scripts work on only 1 variable?
After connecting to Unity MCP, I can create objects and do everything, but script creation is limited, so Claude keeps recommending only generating code and inserting it directly into Unity, but I don't get why. Does anyone have a similar experience?
I know the code is messy but im just experimenting in the mean time
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Linq.Expressions;
using UnityEngine;
using TMPro;
using UnityEngine.InputSystem.Controls;
using UnityEngine.UI;
public enum CurrentUse
{
MaxHealth,
TakeHealth,
Heal,
}
public class HealthUpdate : MonoBehaviour
{
private const int maxHealth = 100;
public CurrentUse usage;
public int currHealth = 100;
public TextMeshProUGUI TextMeshPro;
void Update()
{
TextMeshPro = GetComponent<TextMeshProUGUI>();
TextMeshPro.text = $"Health: {currHealth}";
}
public void onClick()
{
switch (usage)
{
case CurrentUse.Heal:
currHealth += 10;
break;
case CurrentUse.MaxHealth:
currHealth = maxHealth;
break;
case CurrentUse.TakeHealth:
currHealth -= 10;
break;
}
}
}
I did write above what you need to do
#💻┃code-beginner message
You dont need GetComponent here. Just drag the references in inspector
alr alr thanks for help and you're welcome for the frustration talking to me :D
one more.. I want to have a global variable which those 3 scripts can communicate through because rn the script is working on the variable they have and not what the other scripts have
how...
i dont really understand what you're asking or what variable you're talking about here. if its just the text mesh pro component, you should just keep this as dragging it in manually or in a way where you can GetComponent it always from every instance
@turbid plover you said you followed a tutorial? Check if the tutorial put things inside Start() or Update(). Start runs once, and Update runs every frame
Also yeah, GetComponent can be confusing if you’re a beginner.
If you create a reference by starting off typing ‘public’, you can click and drag the component you need into the field in the editor.
If you set it to ‘private’, you have to tell the script which reference you’re refering to. So GetComponent is the script way of saying “Just give me the component that is attached to me”
A bit like if I had a script on me with a “ShootGun” function, and the script needs to know what gun I want to shoot, I use GetComponent to “Just shoot whatever gun I’m holding”
public class Stare : MonoBehaviour
{
[Header("Target Settings")]
public Transform target;
public Vector3 upVector = Vector3.up;
[Header("Axis Locks")]
public bool LockX = false;
public bool LockY = false;
public bool LockZ = false;
[Header("Rotation Settings")]
[Range(0.1f, 50f)] public float rotationSpeed = 10f;
private Transform _t;
void Awake() => _t = transform;
void LateUpdate()
{
if (!target) return;
Vector3 direction = target.position - _t.position;
if (LockX) direction.x = 0f;
if (LockY) direction.y = 0f;
if (LockZ) direction.z = 0f;
if (direction.sqrMagnitude < 0.0001f) return;
Quaternion targetRotation = Quaternion.LookRotation(direction, upVector);
float t = 1f - Mathf.Exp(-rotationSpeed * Time.deltaTime);
_t.rotation = Quaternion.Slerp(_t.rotation, targetRotation, t);
}
void OnDrawGizmosSelected()
{
if (target)
{
Gizmos.color = Color.yellow;
Gizmos.DrawLine(transform.position, target.position);
Gizmos.DrawSphere(target.position, 0.05f);
}
}
}
hi, do you have a question
we arent psychic, we won't know what you need unless you tell us
I think they're just showing off their code😬
Of all the code I’ve ever seen, that is some of it
Hi, could you tell me if it's better to create a UI document for each menu I want to create or do everything in a single panel and manage the visual elements on the script side?
However you want to do it. More documents means more referencing
hi guys, could you tell me what's wrong with this, I'm trying to teleport my player to the otherLadder position
void TeleportPlayer()
{
if (player != null && otherLadder != null)
{
Vector3 newPosition = otherLadder.position;
newPosition.y += 0.1f;
player.position = newPosition;
Debug.Log("teleported");
}
}
```csharp
teleported gets logged in the console so the problem is with the logic itself but I can't figure out what's the issue
you haven't said what's wrong, what happens other than the logging out..
nothing happens while the player should spawn at the otherLadder's position
then player is not your players transform
or something else overrides the change
how could that happen?
all the variables are set properly
a badly written character controller or an animator.
Its unlikely though.
Are you sure otherLadder is positioned correctly too?
yes
It's an empty gameobject which is the child of the "ladder" gameObject
log out all the various positions so you can confirm
already did
Well we know that something is incorrect here. Add extra logging or use a debugger to verify things further
the player just doesn't move and the ladderPosition neither does
how is your player moved? CharacterController or rigibdbody?
charactercontroller
afaik - that's teleporting to move the transform. And IIRC someone else had this issue the other day, it conflicts with your teleportation, and sets it back to where it was expecting to be.
before, I was also changing the player's rotation and it worked, player.rotation = otherLadder.rotation;
Cant remember the fix, disabling the CC for the teleport (re-enable after).. I think
I just removed it because the rotation was inversed
oghh
is character controller really that weird that it has some old pos internally?
okay tyy,I'll try this
tbh,the character controller I'm using is from an asset I've found
and he's really good
so I don't think the problem comes from this but yea there's a problem somewhere
oh, so not the Unity one.. so what Ive said may not be valid
Yea its worth a shot still to disable it and see if it works
it uses the character controller component from unity
but the script controlling it I mean
is from an asset
yea,I'm doing it now
okayyy, thank you much guys @grand snow @hexed terrace , it's working now
I just disabled the cc while teleporting
thank you so much
nice nice
The Unity CC just seems.. lacking of basic features. No graivty, no teleport method
fr
Hola, is there a linter available for the Unity style guide?
I want to add a GH action to one of my repos that ensures the style guide is adhered to on merge.
hello, I'm extremely new and wanted to start with a platforming style of game, I've followed a tutorial and made a C# script for character movement (simple left and right) and I thought I understood it, but when applied to the character it still won't do anything, can I upload the script here? I don't want to look like I'm spamming or anything
2D platformer btw ^
oh wait
public class PlayerMovement : MonoBehaviour
{
private Rigidbody2D body;
private void Awake()
(
body = GetComponent<Rigidbody2D>();
)
private void Update()
(
body.velocity = new Vector2(Input.GetAxis("Horizontal"), body.velocity.y);
)
}```
that's what I've got
If it works in the tutorial and not for you - you've either missed a step or done something wrong. Go back over the tutorial and see what you've got different
also check the Unity console for errors or warnings while playing
there is one
About using the wrong input system?
vector2 does not contain a definition for Z
dang
but it should only be X Y anyway no?
is it pointing to this class though?
Yes, and that's why it's an error to try to use Z
theres no Z in the code though
wdym?
I'll follow it again rq it's understandable so I can redo the project quickly
is the error in this class.
then I'll import that script and see
it is but it was fixed a while ago
originally they put vector3 with z then fixed that
Save the file
I'll make a new project and use the script in that and see how that goes maybe
I have
That is a waste of time
Just watch the tutorial and compare to what you have
If you've saved the file, close VS and Unity and reopen them. No need to redo everything
alright I'll give it a go
I've compared a few times so other than the placement of the floor which isn't related to movement there shouldn't be a difference
How about you show the code you have, and link the tutorial
I did show the code I have, I'll find the tutorial rq cause I had it on my phone
one sec
If it's still not working, screenshot the error in Unity and screenshot the full VS window with the script open
alright I'll find the tutorial rq then do that
I can't test it now something about compiler error
The code you've posted doesn't have anything that uses z, is that the script the error says it is in?
Learn how to make a 2D platformer in Unity even if you are a complete beginner. In this episode we're gonna focus on installing Unity and making our player move around and jump.
● Unity Hub: https://unity3d.com/get-unity/download
● Black Square Sprite: https://www.mediafire.com/file/yge3smeon4kpxcg/Square.png
● The complete code: https://p...
that one's gone now, maybe it just wasn't going away?
Okay, but you apparently still have a compile error since you just said you couldn't run it?
yep and other problems
I'll get the VS ones too
Okay so it's the player movement script all right. Look at the lines underlined in red in your IDE and then compare them to the tutorial. You should see the problem
okay I'll give it another go
Okay hang on something is very wrong here.
is it to do with the speed part of it?
The first error makes no sense, it doesn't seem to recognize that's a function and thinks it's a normal line?
cause he had that stuff working before implementing speed
that's what I originally thought but I thought maybe I was missunderstanding it
I think I'm missing something, some weird stray character somewhere
Like your original code that you posted had an extra ) on the last line
I mean the colours in his one look different idk how much that changes
👀
I don't see it
Look at the tutorial and see what characters the functions are wrapped in.
oh my holy fuck
Or check the C# spec:
https://www.w3schools.com/cs/cs_methods.php
that was my problem after like 7 hours lmao
spec?
like what the brackets do and all that?
ah
Yes, how the syntax works
okay so that's what I need to really dig into then
I think I remade the project 4 times tryna find the problem lmao
thank you for your help
Just for the future, remaking everything every time you run into a problem isn't really useful. There's always a reason why things don't work, the project doesn't just suddenly get corrupted into an unrecoverable state. It's easier to fix the mistakes instead of redoing everything, including the same mistakes
yeah I'm aware, I would definitely not consider that an option had I done much in the project but I will remember that
gotta reset for the input handling but hopefully it works this time
yeah that worked thank god
thanks for the help and patience
specification, a description of how the language is structured and what it provides (though technically what digi linked isn't a spec, a spec is a pretty technical document)
diabolical
I probably wouldn't handle or remember anything from a document more advanced than what I was sent lmao
yeah I can't even defend that lmao
I couldn't remember the word documentation 😭
I just woke up and for some reason "spec" crept into my brain before "docs"
I noticed that in the tutorial video there are a lot more "commands" and such that pop up in the suggested thing as he's typing, is that something I can add?
!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
Help..... im stuck to how to make that when u click a button new scene loads , i searched a bit of tutorials but none work
i´ve been stuck on this for a long while now, the boulders don´t work like they are supposed to, and for some fricking reason they are directional. I tried everything i could think of. They are supposed to work like when the snake hits them, or the way slowed down turtle. Them also being pushed while the turtle appears staying still also is as intended, it´s when you input movement while right next to it.
when it´s a single boulder it works also as intended, being pushed normally and making the turtle stop
managed to fix it
Which part do you not know how to do
the clicking or the loading
i think its maybe an issue whit the OnClick component?
i think maybe both i will show u some pictures
i made the script by AI cause i didn't have the last script saved cause i tried other things anyways here tell me if u find anything wrong
the AI forgot to tell you that "No Function" means nothing will happen when the event is invoked.
instead of relying on bullshit generators to generate bullshit for you, consider going through the pathways on the unity learn site
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
you haven't actually set the listener
yeah i used like 5 tutorials and the unity web for the last code i did but it didn't work ima try to rewrite it
way to completely ignore what was said!
i have a question, how do i make it that clicking a button makes the code go for a single instance instead of it going constantly as long as it´s hold down?
gonna need a bit more info
what button are you referring to? a UI button? how are you reacting to the press?
movement
why read when ai tell me what do with perfect accuracy!!! /s
my player moves in a straigh line until it hits something
why don't you show the code so we don't have to play 20 questions to get a little bit of info from you
it would also help removing the click cooldown code, it was a workaround but it´s not working with an interaction
!code and show all of it, not just a small snippet of it
📃 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.
i don´t remember why i have the "moveEast();", only this part of the script calls it, i could just put it back there
Ideally you handle movement with a vector2 instead of if else
as you can see you repeat yourself
setting the rb constraints is also.. questionable
along with moving the transform
A tool for sharing your source code with the world!
I wonder what might be causing no functionality to happen when you click on this button 🤔
idk what to put there a string?
Free tutorials, courses, and guided pathways for mastering real-time 3D development skills to make video games, VR, AR, and more.
i want the player, and other things in the game, to be constantly centered on the tiles
without it it cause unwanted interactions
like getting stuck on walls
or touching something with the side and triggering it
Ive done grid based movement before and I did it by movement triggering a linear move in the direction. Once done we can read input again and repeat the process.
I deny the move it the player would move into a tile on some layer.
I did not use physics because that isnt really needed if we have tiles
the player and enemies can hit boulders. and when they do the boulders get pushed around
it shows nothing about function thing
if everything is grid-based you can just use that instead of physics
also i want the player to only stop moving upon hitting a wall, or boulder
like pokemon when using strength?
the boulder moves until itself hits another boulder or a wall
you can just make the grid do that
or use raycasts
if everything is using tile movement only then physics has no place
you don't need physics if they don't make sense for the thing you're trying to make
is the video playing on your end?
Yea this could all be done without physics because grids and tiles are easy to query and modify and move things around in
ah, noticed some more unused code
how would you suggest doing it then? i found collision detection necessary. At least for as much as i know about programming
If we have a 2d position in the grid, e.g. 2,2. We can look at other positions to figure out things.
e.g. check 3,2 to see if its empty, if yes we allow a move from 2,2 to 3,2.
no physics needed
Vector2Int would be the ideal type to use for such positions
If you want your own 2d grid of data you can use a 2d array: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/arrays#multidimensional-arrays
that´s not how the movement works for my game
if i click left, the turtle constantly goes left until it hits something
it´s not one step at a time like in pokemon
it´s like the ice puzzles in pokemon
but you can do that still, you can step along till you hit a wall or perform each move one after another
Very possible and certainly does not need physics to work
it can, but you don't need collision to do this
Well you can trust us or not
i´m not saying that i don´t 😓
unity tilemap makes it easy to do tile based stuff and the components can be used to handle positions too
i´ll look into it, thanks
Or you can go with your own system
i´m still curious if there is a way to only have an input he used once per click
using axis values no
using keys directly yes but then you want to use new input system if you care about input rebinding
i can change it to key directly
But if you know some "movement" is active then you know not to accept input right?
"Input.GetKeyDown" right?
if(!moving)
{
Vector2Int input = move.ReadValue<Vector2Int>();
Vector2Int nextPos = currentPos + input;
if(CanMove(nextPos))
{
Move(nextPos);
}
}
made up example
using new input system: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.14/manual/QuickStartGuide.html
anyway if this is just some beginner short term project you can read keys directly
Why does my character floats when crouching, and despite being small enough, i still cant enter the small opening?
i only followed tutorials before, they all ended up not working later down the line. More often than they should they just added lines of code out of nowhere and the new feature wouldn´t work. Been working on this game on my own and i´ve been having way more fun. I´ve also been learning easier
thanks
Tbh lots of tutorials dont do things well because they are also beginners or are outdated.
Its usually a bad idea to read keys directly because it makes things harder to change in future and it means you will do movement logic in a funny way too.
My example sticks with vectors (we let input system handle key/controller binding for the action) and thus greatly simplifies reading input and the logic to check + perform character movement.
it has low traffic so I post it here and maybe we cans olve it with scripts.Also I actually posted there but no one answered.
*I posted this yesterday but posting one more time so I can reach more thoughts
How can I make movement look better? I mean how can I prevent the build up of limbs in one place. I tried freezing the head rotation but build up stayed the same.
maybe a weighted tail piece?
I will try making them heavier except head
or only the last
thankss that worked
How can I make movement look better?
Open ended question so not many will bother responding.
how can I prevent the build up of limbs in one place
More likely to do with your physics setup or design rather than coding. You cannot code a solution to a design problem - no implementation without design. This doesn't look related to coding. Try #⚛️┃physics or #💻┃unity-talk
using UnityEngine;
public class Bouncy : MonoBehaviour
{
private string playerTag = "Player";
private float bounceForce = 1000;
void OnCollisionEnter(Collision collision)
{
if (collision.transform.tag == playerTag)
{
Rigidbody otherRb = collision.rigidbody;
otherRb.AddExplosionForce(bounceForce, collision.contacts[0].point,5);
}
}
}```This does not seem like the best way to get the Player tag? (Stole the code from a youtube video, which didn't even originally set the string to "Player")
CompareTag() is a better alterantive
if(collision.transform.CompareTag(playerTag)
For my purpose, it's not actually the player. I'm trying to make a plinko game and I just need the balls to bounce off the pegs and side walls
well w/e the tag is CompareTag is better than a string comparison like u have now
Yep, that works. Thanks.
They were just using the name you gave it in your own code. If that's not a player, you should call it something else
I was more bringing it up because I thought the context might mean different code would be needed, since a player is usually a single consistent entity, not 30 plinko balls
why does my unity 2d character randomly bump into invisible barriers during movement, even though i'm using overlapcircle for ground detection and have a composite collider on the tilemap? how can i get around this problem
use a composite collider
on the player?
with the tilemap
anyone knows what seems to be the problem?
- Crouching/Sliding works but capsule seems to float
- It cant enter the small opening and seems to have a specific limit before it can fit/enter properly.
turn on gizmos
so you can see the CC capsule
there ya go
don't forget about the skin width
it will add an additional 0.16 height here
eh? im quite still stupid enough to know correctly the problem is, the green line (i assume the collider CC) fits enough for the hole, so why cant I?
as i said...
oh aight thanks that fixed it
A problem I'm having is that it's possible to drop a ball in a way that it bounces out of the plinko machine. I'm wondering that the best way to solve this will be. Ideally, my idea for this game is to put a cup next to the cast full of balls you can drag and drop into it, so just putting an invisible wall at the side would cause issues. I thought I might be able to make a one way wall, but that seems easier for a single character than 30 balls.
ive did what u told me but the bug is persisting
this needs to be set to "Merge"
I also recommend Geometry Type on the composite collider to be set to "Polygons"
i think the bug is solved now thx for the help
the only thing i can think of is
- add those invisible walls u mentioned
- use different physics materials.. (make the top pegs less bouncy)
I might just change it to instantiate a ball where I click and make the game about getting the highest score within a set number of balls
Seems easier
!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.
or just make the colliders of the walls on the side longer ... i dont think it matters if thecolliders go more up or down...
model it after a real plinko machine.. im pretty sure the top portion is inclosed as well
Inclosed? I don't think so? 🤔
the sides are yes.. almost every version i see the side rails come up above the top pegs
Oh, the sides. Yeah, so is the one I made
I could make it higher, i just think it'd look weird
u shuld be able to tune the values and things u alrady have
Yeah yeah, I was in the middle of doing thar before I had to leave
u can use colliders without having graphics..
invisible collider.. wouldn't need them too high.. just enough to guide the jumpers
you can also adjust the bounciness on your physics material to be less bouncy so there's less likelihood of it bouncing up and over the sides