#💻┃code-beginner

1 messages · Page 783 of 1

solar hill
#

why not just send the code causing the bug here

#

giving some context

#

and we might be able to help

mental shoal
#

Okay, so I'm trying to make a civ like game by following a game dev guide video (https://www.youtube.com/watch?v=EPaSmQ2vtek) but I'm following exactly what he's saying. Now I've got a problem with the player movement on the tile; whenever I click on a tile, the player doesn't move on it, and I'm not sure if it's because of the map generator, the tiles, the player, or the camera. This is why I fought it was easier to give the game (it's not that big) for you to help me find out

solar hill
#

well youre going to have to start debugging it

#

set up debug lines everywhere you can and try and pinpoint at which point is it failing

#

deduce if its the generator, tiles player or the camera

lucid turret
#

hey guys iam starting on my first Incremental game. How do you handle big numbers? You think that long type is enough? Or build something to handle really big numbers?

slender nymph
#

BigDouble is the typical solution since you'll definitely want to handle numbers beyond what a long can handle

lucid turret
#

Do you mean BigInteger? i dont know about bigdouble is it like a mantissa and exponent thing?

rich adder
timber tide
#

I think eventually you start using StringBuilder or something, right?

#

or like usually these games you get to a point where those lesser values are nothing and can be rounded off

lucid turret
#

thanks guys, i check the breakinfinity out

slender nymph
#

but no matter what, long/ulong wouldn't be enough considering ulong only supports up to about 1e19

#

but also afaik BigInteger has a much bigger performance impact than BigDouble

zenith cypress
#

And depending on the wanted numbers, you can get very far with just double/ulong tbh. I've played many incremental games where they just cap at those

timber tide
#

I'm pretty sure I've played clickers where with rediculous values where no value type could work

#

it eventually becomes fluff

#

They get to a point where you wouldn't notice you getting shammed by having some of those values rounded off

slender nymph
#

That's part of why BigDouble is so performative, it sacrifices accuracy for speed so when you do get to those much larger numbers it's less accurate but still much faster than something like BigInteger

solar hill
#

seems like a huge sin for a game to do that in said genre

zenith cypress
#

The ones I play aren't idle games, so they tend to be progression focused through user actions. Idle games it would make sense for it to not be capped sure.

slender nymph
#

it does seem kind of silly for a game where the whole point is "number go up" to make the number stop going up

solar hill
#

also if you have to cap anything you might as well do it within some kind of prestige system

#

where you basically say wow your number got so big you are now on numbers 2™

lucid turret
#

wow that BigDouble works really good, exactly what i was looking for. Thanks again

slender nymph
#

it helps that it was literally made for an incremental game lol

pliant dome
#

I created an airdash but the box collider would loverlap too much with another box collider. I heard suggestions to use addforce cuz this prevents this but Im getting more of what I want from rb.linearVelocity

#

Does addforce prevent box colliders from overlapping? I dont think thats possible is it?

#

Would it matter when picking between linearvelocity or addforce

slender nymph
#

provided you are moving the object with physics (like with setting velocity or adding force), it is dynamic, and both colliders are not triggers then if they are overlapping you need to adjust the collision detection mode on the rigidbody, the default is typically good enough, but if you are moving things at higher speeds then you definitely need to change it so it can be better at predicting collisions to prevent penetration
simply changing from assigning the velocity to using AddForce won't really change a whole lot when it comes to collisions because AddForce is really just changing the velocity under the hood anyway (just with extra math that you are likely not doing yourself)

pliant dome
#

Ahh okay thats actually great then that means I can change my airdash code back to linearVelocity

#

Was having some problems with addforce anyways

graceful wolf
#

Hey guys question, I have a parent class with a Start() function and a child class that inherits from the parent one. The Start() will not get called on the parent one? Only on the child one?

grand snow
slender nymph
#

if you're going to go and paste the code into some site to share it anyway, at least use a site that shares the code correctly instead of screenshots

#

!code

radiant voidBOT
grand snow
#

thats a first, sharing with the fancy reddit images

solar hill
#

thats actually really neat, i wonder how its done

graceful wolf
#

it's a nice extension (codesnap) in vs code

grand snow
#

anyway Its as i said, SelectableObject.Start() wont get called here

#

it needs to be virtual so it can be called still

graceful wolf
#

ah so bcs it's private it won't

#

wait nvm dumb question

grand snow
#

nope that doesnt make a difference

#

go learn about virtual methods

slender nymph
#

gotta at least be protected

grand snow
#

wrap it guys

ocean matrix
#

is there anything wrong?

slender nymph
#

are we supposed to know what your issue is?

#

or are you just trying to show off whatever asset you're using to force the enabled checkbox on the transform component despite it not inheriting Behaviour to even have an enabled property

ocean matrix
#

wdym?

lunar temple
slender nymph
#

useless comments like that are not needed here, thanks

rich adder
ocean matrix
rich adder
#

are you talking about transform having a enable/disable tickbox?

ocean matrix
#

yeah i dont remeber it being like that

rich adder
#

which version of unity is this? unless its an asset, I've never seen this

#

also next time this isn't a code question.. maybe..

slender nymph
#

note that transform does not and never had an enabled property which is what that checkbox even displays so whatever is causing the checkbox to show there is some third party asset

solar hill
#

whats even the point of an enabled property on the transform lol

#

what does it do just freeze the transforms?

#

if only there was a system for that in unity

slender nymph
#

presumably this checkbox is purely cosmetic and doesn't actually do anything

compact grove
#

Guys I need help with a school project its my first time on unity and i need to create a unity world create a player and be able to play the game on pc and on my VR headset my problem right now is that I 'm using the Kylebot asset and I don't know how to make him the character that the player plays as, also i dont know how to make the world be able to be played on VR. Please help me!!

slender nymph
#

!learn

radiant voidBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

radiant voidBOT
solar hill
#

wow

slender nymph
#

double kill

solar hill
#

i was faster, at least on my screen, hehe

solar hill
compact grove
#

i mean i only have one day until its due, what is like the thing i need to know for my problem

solar hill
slender nymph
#

a lot. there is no way you can get this done in only a single day with no experience

solar hill
#

whats with like a million people on this discord that somehow all have unity school projects and its always like "create a highly ambitious project on your own lol, oh also you have 2 hours"

#

what kind of schools do you people go to

compact grove
#

well i have created the world

#

so far

rich adder
solar hill
#

yeah but theres no way there we given one day to do this

#

even if they were expected to do it alone

#

a month at the very least

slender nymph
solar hill
#

i think procrastination is the major player here

ruby lion
#

Good evening, I'm having trouble with Unity. This error code appears when I launch a project: "Code execution cannot continue because Unity.dll failed to load. Make sure you meet the system requirements for Unity."

I've tried uninstalling the Unity vrctimes and Unity Hub, restarting, and reinstalling, but the problem persists.
Thanks in advance.

solar hill
#

Lucas be honest with us how long did you have to figure this project out

#

curiousy has gotten the better of me

compact grove
#

idk like 2 weeks or something

#

but ive been working on it for a week

rich adder
#

its prob a basic thing but yeah they are making the scope big because "game"
instead of pong or something small scoped

compact grove
#

i dont need to create like a whole entire game i dont think i just need to have a player and play it on vr

solar hill
#

because if you can choose i say choose flappy bird or even pong

fickle plume
rich adder
fickle plume
compact grove
fickle plume
#

If you have code related questions them ask them.

solar hill
#

yeah lucas we cant really help you here because you need to actually have some basic understanding of unity outside of creating a "world", theres a lot of good videos online telling you how to set up vr controls for your game

radiant voidBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

solar hill
#

and of course the unity learning pathways

#

so yeah good luck

rich adder
solar hill
light cave
#

Genuinely

#

I feel like unity wasn't made for me

#

Everytime i code i forget what i did

#

And then debug for hours

quiet pollen
#

How do I stop players from just... scaling walls

#

it needs to be pretty much straight up for them to not be able to scale it

#

(using a char contoller, idk if that makes a dif)

solar hill
#

and a lot of comments

#

nobody can remember everything they wrote

#

even after a day

jaunty wing
quiet pollen
#

I think youre talking about the slope limit

#

but its more of a jump issue

light cave
quiet pollen
#

idk if the jump is using a raycast actually lemme check

solar hill
light cave
solar hill
#

deadline?

#

is this a paid project

solar hill
#

you are going to need some way to cancel the upward movement of players when they hit sloped walls

light cave
quiet pollen
#

Yeah I checked and it said I was grounded in that image

#

im using just the character controller ground check

solar hill
light cave
solar hill
light cave
#

Not sure about time because i forgot

quiet pollen
#

idk it is lit just the character controller ground check

#

built in I think

solar hill
#

built in?

quiet pollen
#

im going to change it to a really small ray cast

solar hill
#

into what

solar hill
quiet pollen
#

idk its lit just charactercontoller.isGrounded

solar hill
#

if you go to the controller class how does it implement isgrounded...

quiet pollen
#

Is that a thing I can see?

#

the charactercontroller code?

solar hill
#

you should probably use your own isgrounded check using a raycast

#

because youre going to need that raycast to check if its hitting a sloped surface

quiet pollen
#

yeah

solar hill
#

basically if the surface the raycast is hitting has an angle larger than your slope limit return false for isgrounded

quiet pollen
#

The big issue is that it is all part of a terrain piece, and because the terrain piece itself isnt rotated I dont think that is working for me

solar hill
#

terrain colliders support surface normals

quiet pollen
#

ok nvm I was doing it wrong I think

solar hill
#

youre also not detecting the rotation of the object youre hitting

quiet pollen
#

yeah I was just using a weird function

solar hill
#

but rather their surface normal

quiet pollen
#

I have this rn but for some reason it is saying normal doesnt exist

#

figured it out

solar hill
#

you should probably have a bool method to return a true or false

#

rather than using a global variable for isgrounded...

#

imo

quiet pollen
#

I mean the biggest issue rn is that you can still stick to walls, but at least they cant really be scaled

quiet pollen
#

yeah but like

#

yeah

#

wait what would that even do

#

they dont have upward movement

#

they just dont have downward movement either

#

I think its just the collider getting caught

naive ferry
#

Hey I am currently running into a weird problem in Visual Studio whereby I keep getting the same error:
"The active document is not part of the open workspace. Not all language features will be available."

and All the codes are unresponsive to Unity infrastructure like not even telling me in Visual Studio if there is any syntax error.
The namespaces are greyed out too.

slender nymph
#

!ide

radiant voidBOT
pliant dome
#

Can a box collider get stuck overlapping against another box collider??

quiet pollen
#

I mean it depends what you mean by stuck

pliant dome
#

It almost feels like the bottom of the player box collider is clipping through the top of the stage box collider

#

and getting stuck

#

Everything seems like it should be working. Like the ground check is marked and isjumping is unmarked and all that

slender nymph
#

is this 2d

pliant dome
#

but I can't jump or do anything

#

3d

#

but Im making a 2d fg

#

2.5d?

slender nymph
#

obviously i was referring to the colliders in use, not the actual game perspective

pliant dome
#

oh yeah 3d

slender nymph
#

then it's most likely an issue with your code.

solar hill
#

is the stage seperate from the rest of the ground?

#

is the layer for the stage set up properly?

pliant dome
#

I have three lmao. One for the player box collider, one for a boxcast, and one for when bth are touching

quiet pollen
#

Are you spawning the player above the ground or like right next to it

pliant dome
pliant dome
#

That wouldnt really matter

slender nymph
#

show code

quiet pollen
#

I mean if the colliders are weird that could make them overlap weirdly

#

But yeah

pliant dome
# slender nymph show code

Being honest I could show code but I feel like thats not gonna really explain the full situation and Im bad at explaining stuff in text

slender nymph
#

then i guess i can't help you 🤷‍♂️

pliant dome
#

Lemme try to explain one problem Im facing

slender nymph
#

make sure to share the relevant code too

pliant dome
#

So if Im off the stage and I jump back onto stage with the character box collider up against the side of the stages all the way to the top of the stage then the box cast touches the stage then I enter this weird state of kind of jumping but Im grounded.

#

Code is extremely messy rn

solar hill
#

this is a 3d game?

pliant dome
#

No

#

ye

#

yes

solar hill
#

why are you using a boxcast to check for the ground?

#

why not a sphere cast or just a normal raycast

slender nymph
#

presumably your boxcast is too wide

solar hill
#

its catching the edge of the stage

pliant dome
solar hill
#

if the boxcast is wide enough then its going to collide with the side of the stage

pliant dome
solar hill
#

do you understand what a boxcast is?

pliant dome
#

Yes

#

Its basically a raycast

solar hill
#

it is a raycast

#

but instead of it being a singular line

#

its in the "shape" of a box

pliant dome
#

I know

solar hill
#

you should switch to sphere cast and also check for the surface normal of whatever surface its hitting to ensure its flat or less than your slope limit

slender nymph
#

what difference is a sphere cast going to make if it's still too wide. they just need to reduce how wide the cast volume is

pliant dome
#

Yeah and this isnt even the issue

#

The boxcast isnt the only one chekcing if Im grounded

solar hill
pliant dome
#

Whats truly going to check the ground is both boxcast and the box collider

slender nymph
#

why

#

just use the cast

#

that is literally all you need. provided it is not too wide and doesn't go too far.

pliant dome
# slender nymph why

I seperated this way because when I jump I want the box collider leaving the ground being the one to deicde when Im "isJumping"

solar hill
slender nymph
pliant dome
#

and also when I airdash into the ledge. Its gonna overlap with teh ground box collider. To prevent this I made the boxcast smaller so even if the collider touches the ground ledge. I wont be grounded

pliant dome
#

without jumping?

slender nymph
#

whatever you tell the code

solar hill
#

is your grounded check just in your jump method?

slender nymph
#

presumably your ground check physics query will handle that

solar hill
#

also if you dont want to get grounded during a dash

#

couldnt you just use an if statement to prevent that happening

#

given you have states for dashing?

pliant dome
solar hill
#

yeah but your solution doesnt make sense, its overengineered and a bit complex

pliant dome
#

The issue is yknow what hold on lemme just record it

solar hill
#

if im understanding what you are saying correctly

slender nymph
#

right now you're trying to smash together a decent ground check with an extremely naive one that only works properly in very specific situations. get rid of the bad one and only use the good one

solar hill
#

yeah you only need the cast

#

just make it less wide, switch to sphere and have checks for dashing to prevent yourself from getting grounded mid dash

pliant dome
#

So if I walk to the ledge and only use the boxcast to detect the ground and since the cast has to be smaller then the collider. That would mean I would be not grounded but still on the top of the stage

slender nymph
#

getting the size of the cast right takes some trial and error, but it must be sufficiently wide that it determines you are grounded in all correct scenarios, while also not detecting walls as ground when you jump against them.
a collider with a round bottom also helps with being at a ledge (assuming you move with physics) because it can correctly slide off when too far over the edge instead of allowing you to stay stable when even just a single pixel of the bounds is on the ground

pliant dome
#

Not really liking the idea of sliding off the ledge

solar hill
#

i mean its a pretty common solution

pliant dome
#

does changing the friction cause the slide to be very quick? So it doesnt look like you slid off

solar hill
#

its rarely going to be noticable

#

this is only in fringe cases if players carefully itch themselves towards the edge

#

most of the time they would walk just off regardless

slender nymph
#

it's not that you are causing a slow slide from a stable position. it's supposed to prevent stuff like this from being a stable position at all

#

also wtf when did paint gain the ability to create transparent images

pliant dome
#

Maybe I could make it like how Smash Melee has the collision box

#

where its a diamond shape

solar hill
#

i mean thats pretty much the same exact concept

#

except why not just use the built in capsule collider lol

pliant dome
solar hill
#

i think you are imagining the "sliding" aspect of this wrong here

#

i suggest you try it with the capsule first

#

and if you really dont like it try the diamond shape but both are going to be better than the box

sour fulcrum
#

the guy who lead the project is working on the new audacity which looks sick

frosty yarrow
#

does someone know a way to make me stop forgetting how to make player movement

umbral wadi
frosty yarrow
umbral wadi
#

Question

#

My assignment asks for AI logs what does that mean?

#

If anyone has any ideas XD

slender nymph
#

surely you could ask your instructor?

umbral wadi
#

i wish. Its 1 am now. This is due in 12h and he is impossible to get hold of

#

I should of asked weeks ago

solar hill
#

like 4 seperate people have unity assignments due tommorow

#

what is happening

sour fulcrum
#

end of year

solar hill
#

half the people here who asked for help were weeks away from finishing projects they have due tommorow lol

slender nymph
#

pretty common for this time of the year. people realize they put off their important assignments and rush to finish them not realizing that they needed a lot of work to complete their ambitious goals before the end of the semester

solar hill
umbral wadi
solar hill
#

so not what i thought ok

#

what kind of professor would even let you use ai for this

#

why even teach you unity to begin with if you can just shake the magic 8 ball hallucination machine

umbral wadi
#

Lol you think he taught me anything?

solar hill
#

yeah i mean thats my point lol

#

worst kind of professor ig

#

just given up on what they have to teach

umbral wadi
#

I used it quite a bit because i didnt understand what he was talking about (i was in hospital and missed the actual practical)

solar hill
#

i think llms in general will just hurt you in the long run when learning

#

also surprised your college doesnt have mandatory practicals, mine expects you to rise from the dead if you might miss one

umbral wadi
#

Like break down this line

#

I let it generate a file then make it break it down into what each line does then use the componats to write my own

high anchor
#

That's a better way of using it than most, but LLMs still tend to take the wind out of your sails.

I did a similar thing in my run through college and while I was able to get more insight than some of my fully LLM-dependent colleagues, I was definitely behind where I should have been by the time I was ready to graduate.

#

I've been playing catch-up since with self-directed study intentionally avoiding LLMs like the plague.

crude mirage
#

Hey! This might be a super simple question that I am just overlooking in the documentation, but I am coming from Monogame and having some trouble understanding the camera. I am using the MainCamera in orthograpic with sprites rendererd onto 3D meshes. My question is: what exactly is a size of "5" in the camera? My assets are designed for a 480x270 game, how do I ensure my camera is set to show that resolution for the viewport?

slender nymph
#

orthographic size is half of the height of the camera in world units. if you want pixel perfect rendering then use the pixel perfect camera component

crude mirage
#

Will pixel perfect camera work fine in a 3D environment as well?

umbral wadi
#

based on the assignment sheet

high anchor
#

Using an LLM works... if you're already proficient in coding and can double-check its work. It can save you writing (or hunting down) some boilerplate or simple algorithms.

But you need to know what you're doing, because A. code can go off the rails very quickly, and B. LLMs can only copy what they've seen. ChatGPT is basically a quick reference of StackOverflow that filters out the people who rag on you instead of answering your question, but if you need to do something even remotely unique... or god forbid, you're working with newer versions of stuff with a long history and a lot of deprecated and/or removed features, you're going to need to know how to do research and problem solving yourself.

sour fulcrum
umbral wadi
#

And I have a background in C and Java programming so I could tell when it was feeding me bullshit

high anchor
#

Nice, that's a good background to have.

umbral wadi
#

I didn’t blanket copy and paste

#

I copied 2 functions because they worked and I understood that they would work

#

I need to make a statement in my write up that I understand that I copied that bit and I won’t be marked on those functions

#

But it’s 2 functions out of hundreds

modern meteor
#

can someone teach me on where to start, I just started using unity not too long ago

radiant voidBOT
modern meteor
burnt wyvern
#

C# is pretty funny, coming from Swift it really does feel like a Java-fied version of it. If only I could drive Unity directly from Swift...

ancient rampart
#

is it possible to add a new mixer track through code?

burnt wyvern
#

Does C# have optionals?

sour fulcrum
#

Nullable is the equivalent i think

#

It’s slightly new-ish and you gotta do some stuff to make it work with unity iirc

#

But also the shorthand where you do like foo?.bar.Thing() isn’t supported in Unity because of reasons google will probably explain better than me

burnt wyvern
#

So like, basically not

#

That’s a shame

tulip vortex
#

hey, i'm doing a board game and i'm having questions about how to code the board, some part of it can rotate but i need to keep the same direction, also some paths are active and some are not, how would you guys code a board like this ?

charred spoke
# burnt wyvern So like, basically not

It’s not supported only for gameObjects and types deriving from UnityObject. You can write regular plain old classes that use the ? Operator. For the unity stuff you just do a normal null check

still oyster
#

Using the new input system, what's the simplest way to make a sprint? I have the movement, I just can't figure out the way to make it so that when I hold it it sprints and when I let go it stops.


{

    sprintInput = value.isPressed;

    

}```

This is what I was using to get the button input
pliant dome
#

How do I go about making it so that the capsule collider doesnt slide off the ledge?

#

I normally had it as no friction material

livid anchor
#

Hey folks. I have this gorgeous broccoli in my scene, and I would like an animation where it flashes from normal color to a more white color in a loop. The basic gist of it is the crop is expiring and will soon disappear, thus it flashes.

I'm trying to use the animation system to do that but changing the base color doesn't do crap. Any advice ?

scarlet raptor
#

is it worth learning coding with Unity for game making. or just quicker just to use the tools instead

keen dew
#

What tools are you thinking of? Ultimately coding is the tool for making games, anything else won't get you very far

sour fulcrum
#

if you want to make games in unity you need to know how to code or work with someone that does

scarlet raptor
#

so learning basic code is a need really?

scarlet raptor
sour fulcrum
#

visual scripting

scarlet raptor
sour fulcrum
#

you can try starting off with that if it helps you get comfortable with programming but a majority of people that release stuff end up going from it to direct programming

keen dew
#

It's good enough for very simple game logic but it becomes unwieldy very quickly

scarlet raptor
#

yeah ok fair enough. Ill learn from the Unity Learn site about coding before doing anything then

warm sequoia
#

Hi, when I click "remove assets from project", on a asset doesn't it get removed. And when I try to add a asset doesnt it get added. It just download to the package manager that works

midnight plover
warm sequoia
midnight plover
#

When you downloaded them manually, I guess unitypackage

warm sequoia
#

My asssets and then import to project

#

but import to project doesnt work anymore

midnight plover
warm sequoia
#

And usally "import x.x.x to project" get changed to in project or something, but that doesnt happen either

midnight plover
warm sequoia
#

In Package Manager, is their tabs like Unity register, Services, Built-in and also My Assets.

I go to My assets, and then click on my asset that I have downloaded from the unity website, through the package manager.

and then I click Import 1.1.1 to project

#

and then usally "Import 1.1.1 to project" changes to "In project", but that doesnt happend, so something is bugged iguess

midnight plover
warm sequoia
#

Is it possible to clear caches or something in unity

#

I did try to restart my computer but that didnt fix it

midnight plover
warm sequoia
livid anchor
#

Is it possible to apply a sort of mask to an asset ? I have this asset with a weird color/palette and i can't change the color like I want to. If I change the material to a white material, the object becomes red :/
I'd like to have the object to go from normal color to white and I have no idea how

crimson laurel
#

I've seen some tutorials w/visual studio community that have this neat little autofill, but that doesn't seem to be the case for visual studio code which kinda sucks

is there an addon/plugin that implements this?

#

probably just best to switch to community, but I'm curious

midnight plover
crimson laurel
#

only works for existing variables and a couple other things in visual studio code

midnight plover
radiant voidBOT
crimson laurel
#

yeah I have those plugins installed already, guess it's just better to switch to community

midnight plover
crimson laurel
#

oh weird

#

I'll try reopening it via unity

crisp quest
#

guys how can i learn event system ? i tried so hard i know what it does but i cant understand how it actually works

#

how to use it and all

midnight plover
crisp quest
midnight plover
crisp quest
midnight plover
naive pawn
naive pawn
#

that was an "A or B" question

#

is your issue with the EventSystem component, or the event c# feature, or events as a pattern

crisp quest
#

c# feature

#

idk to make event system

crimson laurel
#

that's the ticket

candid pilot
#

i wanna add post processing through unity's post processing package but effects doesn work. i searched a bit and find out that it is because of URP. how can i switch back to the built in one

candid pilot
#

yes but i want to add to 1 specific layer

#

and no i dont wanna do camera stacking it couse too much performance

#

as i know, making to specific things only be done by using colliders in volume component

nimble shadow
#

Can you provide a path script for the latest version of unity?

candid pilot
#

for what?

nimble shadow
#

For 2D platform

candid pilot
#

i dont make a 2d project

#

if u mean that

midnight plover
candid pilot
#

do u know how i can make a post proccesing for specific layers?

#

thanks

candid pilot
#

o right

#

sorry

livid anchor
#

Can we know where the "collision" happened with a ontriggerenter ?

naive pawn
#

you can work it out externally probably

#

there is Physics/Collider.ClosestPoint

left path
#

What is Render pipeline?

naive pawn
left path
#

Aah sorry :D

blissful stratus
#

how can i fix this?

charred monolith
plush zealot
#

The light in my scene is not being rendered, might be overlooking something trivial but can't figure it out rn

rough granite
plush zealot
#

I had it as Realtime before and it doesn't change anything sadly

rough granite
#

Just to be sure you understand the light here is a directional light so it works like a sun does where position doesn't matter only rotation

#

Also have you tried messing with intensity

plush zealot
#

yes, to both things :/

#

I've been trying around with a bunch of different ways of casting light in the scene and none of it is really working

rough granite
#

Just checking this isnt a 2d scene is it? (Not sure if it'd change much but just checking)

plush zealot
#

it shouldn't be, I don't think. It was created in a 2d project if that influences it in any way

rough granite
#

It might have you check to ensure unity's 3d assets were installed

plush zealot
#

how would I do that?

naive pawn
rough granite
naive pawn
#

might be your materials being unlit

rough granite
naive pawn
#

eh, it happens. happens to me a lot too lol

plush zealot
plush zealot
#

looks like this so I think it should be fine

naive pawn
rough granite
naive pawn
#

anyways i don't really do 3d or lighting stuff, so can't really help anyways

plush zealot
naive pawn
rough granite
naive pawn
#

i don't remember which tab it's in, and mightve changed in unity 6 anyways

plush zealot
naive pawn
#

mmm not sure, i don't do 3d

plush zealot
#

xD

#

ill see if it helps

naive pawn
rough granite
naive pawn
rough granite
# scarlet raptor yeah

Visual scripting is more of a crux than it seems, its like learning all the unique rules that a language follows but writting all its words in your native language.

still oyster
naive pawn
still oyster
nocturne kayak
#

Hello guys should i use Transform.rotate to create a shake effect for a camera ?

polar acorn
#

Do you want to rotate a transform?

solar hill
polar acorn
#

If so, Transform.Rotate is a way to do that

solar hill
#

imo the simplest and easiest way to create camera shake is using cinemachine

slender nymph
#

obligatory: use cinemachine

nocturne kayak
nocturne kayak
#

To be honest i'd like to script it

solar hill
#

personally

midnight tree
#

I'm using shake effect though changing a current local position of camera...

It makes better effect than just changing a rotation.

solar hill
#

but theres also virtually no reason to not use cinemachine

snow raven
#

Heya, is this the right way to add a collider to my player? using the polygon collider and adjusting edges manually?

Thanks 🙂

nocturne kayak
gloomy heart
#

I would prefer a simpler circle collider

solar hill
#

but also theres no reason to choose a worse option once you do learn it lol

snow raven
solar hill
#

yeah a box collider is probably the best option here

#

since the top and bottom of your character are flat

snow raven
#

then its the sides which have an angle so the box collider won't fit perfectly

#

if i hit something diagonally it won't work properly

polar acorn
#

Why does it need to fit perfectly

solar hill
#

you dont need a perfectly flush collider

snow raven
#

going for a precision platformer

solar hill
#

i think you are slightly overthinking the important of those 2 corners of the collider not being perfectly flush

#

even for a precision platformer its more than enough

snow raven
#

probably just a beginner want it to be smooth though

midnight tree
nocturne kayak
polar acorn
naive pawn
solar hill
#

its all realtime

polar acorn
#

There is very little practical reason for your hitbox to match your character exactly

nocturne kayak
#

Oh

snow raven
snow raven
#

sorry guys i'm just starting so yeah though i needed it to align better

naive pawn
#

it doesn't need to be exact, it just needs to feel nice

solar hill
#

most important part

naive pawn
#

if anything, slightly smaller is better

snow raven
#

i'll try box collider then thnank you guys

#

makes sense what you are saying yeah, i'm overthinking 🙂

#

love ya!

nocturne kayak
#

i Think my camera have a cinemachine camera ,

#

Okay i'am gonna check how this work Thanks for the help

wintry dew
#

Hey guys i have a question about making level scenes
So would it be a wise idea to organize level scenes by build index or is there a better scene specific way to like find the "next" level scene, because what i currently do is add one to the current build index and then that becomes the next unlocked level

stray marten
#

why the fonts are not generate correctly.

rough granite
stray marten
#

what us the channel thet i should go.

naive pawn
#

you also did not say what the issue was, as i asked previously

#

and don't crosspost please

crisp quest
#

im having probs with delegate pattern in unity

naive pawn
#

it's not a pattern, but sure

#

!ask

radiant voidBOT
# naive pawn !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

crisp quest
solar hill
crisp quest
solar hill
#

to put it simply they let you pass a function like you do a variable

#

well does your script require you to use delegates?

#

what are you aiming to accomplish

crisp quest
slender nymph
#

so what does that have to do with delegates

crisp quest
naive pawn
#

delegates aren't necessary for that

#

it's one thing you could use, but definitely not the only way

solar hill
#

you could but also why

crisp quest
#

event system?

slender nymph
glass summit
#

i want to make an interactive textbox in my Visual Novel game in Unity. If the player clicks it and type a code, it should be correct and the story continues. If the code is incorrect, it should show an error screen. Can anyone help me with this?

polar acorn
solar hill
#

also pretty sure a lot of delegates can trigger garbage collection so relying on them too much isnt ideal either

naive pawn
#

you simply don't need it

crisp quest
naive pawn
#

make it work, don't worry about the specific pattern you use

crisp quest
naive pawn
#

you should learn them, because they are an additional tool in your toolbox

solar hill
#

this "someone" person seems to be giving a lot of people in this server bad tips

naive pawn
#

but it is not necessary

slender nymph
glass summit
grand snow
#

Undertale code moment

polar acorn
solar hill
crisp quest
naive pawn
solar hill
#

please tell me you dont have seperate thousand something lines classes for each scene @glass summit

#

because you should probably fix that before you work on anything else

crisp quest
naive pawn
crisp quest
polar acorn
crisp quest
slender nymph
naive pawn
glass summit
grand snow
#

Events use delegates

polar acorn
slender nymph
polar acorn
#

If your issue was events, you should have asked about events to start with

glass summit
#

Can anyone help me? My safe code does not seem to work

#

Or it could possibly be something related to the project panel

slender nymph
#

mate, you can't drop 1400+ lines of code and say "it doesn't work". you need to provide details and actually say which part is not working

naive pawn
#

take some goddamn time to make your life easier instead of powering through with the content

polar acorn
cosmic quail
crisp quest
solar hill
#

events are delegates

glass summit
solar hill
#

but not all delegates are events

polar acorn
naive pawn
solar hill
polar acorn
glass summit
#

what else am I supposed to do XD

slender nymph
solar hill
crisp quest
solar hill
#

and use a different approach

glass summit
solar hill
slender nymph
#

then read your own code instead of expecting other people to spend hours trying to deduce wtf it is doing and where to even look

solar hill
#

how do you not know which part is responsible for handling the safe

polar acorn
polar acorn
solar hill
#

you also need to seriously consider switching to a more data driven approach for your game, at what point do you write 50 something coroutines for dialogue in a row before stopping and realising there has to be a more efficient approach

grand snow
#

It's common for beginners because they don't realise this fact at the start

#

We know from experience that it's the wrong design

glass summit
naive pawn
solar hill
#

coroutine thirtyeight.

#

buh

crisp quest
grand snow
#

Ah well if noobdev doesn't want to learn then too bad I guess

solar hill
polar acorn
grand snow
#

What do we know with our many years of experience 😜

solar hill
#

no such thing as cost sunk fallacy in game development, never commit to a flimsy foundation

polar acorn
naive pawn
#

@glass summit seriously, fix your goddamn code. i'm tired of going through it at this point.

crisp quest
polar acorn
#

Your code seems scientifically engineered to be impenetrable to anyone

solar hill
naive pawn
polar acorn
glass summit
grand snow
#

Scroll up bud

solar hill
#

bro was not listening

#

anyways ill be nice and say it again

separate your story content into external data files and build a simple interpreter that reads them, with a state manager component as a centralized storage for states

#

rather than hardcoding your dialogue directly into 50 something coroutines per scene

glass summit
#

it's not just abt changing the dialogue

solar hill
#

yes...?

#

do you think you will lose those capabilities if you switch to a data driven approach?

#

if anything using data files lets you manage this in a far easier way

#

heres an example

naive pawn
#

i described it very briefly here, when you said you didn't know how to make it work with a loop
#💻┃code-beginner message
you never followed up

solar hill
#

scene_intro:
   character: "Me"
      text: "Use a data driven approach for your visual novel"
      expression: surprised
   choice:
      - "No" -> scene_wronganswer
      - "Youre right" -> scene_goodanswer```
#

then you would have some sort of interpreter that can emit the events

naive pawn
#

an approach with less overhead (on designing the schema and interpreter) could just be a list of tuples for stuff to do

#

hell, you could have a delegate in there for event-specific actions

glass summit
#

I don't understand what you mean by this...

rough granite
naive pawn
alpine fog
# glass summit so I wanted to make an interactive puzzle, if a 3 numbered pin is entered correc...

can't you do something similar to what you had a few lines above your // SHOW SAFE INPUT line? You wait for the text length to reach some length
if all you want to do is wait for the user to type the code then you can check/wait again with conditions and something happening?

obviously it would be better if you just scrapped that thing entirely and remade it in a much better way, but if you want to keep doing what you're doing then it might work

glass summit
naive pawn
#

you don't understand how loops work?

glass summit
naive pawn
#

then you should at least understand that each iteration is (or can be) different

crisp quest
rough granite
crisp quest
naive pawn
# glass summit no

do you seriously not understand this

a loop can count up or go through a list

alpine fog
# glass summit no

you should learn a bit more C# before you go around to making an entire game
loops are very useful and will help in a million ways when you understand them and use them properly

glass summit
naive pawn
#

and how does it do that

#

have you see the keyword for before

snow raven
#

Why does this gap exist?

You can cleary see my box collider green lines it should be further down so it doesn't create a gap with the floor collider but there is still this gap

any idea? 🙂

glass summit
naive pawn
snow raven
naive pawn
glass summit
naive pawn
# glass summit no

alright, so you definitely don't understand loops. consider go learning them

still oyster
#

Opoe

#

Found it

naive pawn
naive pawn
nimble apex
#
updatedPublicData = new()
{
    { nameof(PublicPlayerKeys.UserID), await GenerateUserID(context, gameApiClient) },
    { nameof(PublicPlayerKeys.Name), $"User_{updatedPublicData[nameof(PublicPlayerKeys.UserID)]}" },
    { nameof(PublicPlayerKeys.Lv), (byte)1 },
    { nameof(PublicPlayerKeys.Exp), 0 }
};```

this is just a dictionary, what i want to ask is , dictionary cannot guarantee sequence even in this kind of declaration?
weak cloud
#

there's nothing in the standard dictionary implementation that guarantees order
so sure because you declared it in that way it might be in the same order you declared it but there's no guarantee

#

you shouldn't count on it basically

nimble apex
#

welp i guess i can only use tryget

glass summit
#

WAIT I FIXED MY ISSUE

#

SOMEHOW

#

😭

weak cloud
nimble apex
weak cloud
#

yeah then tryget is your friend

nimble apex
#

so im generating it on first element

#

and get it on second element

naive pawn
#

that's definitely wrong

nimble apex
#

i can somehow feel it lol

naive pawn
# nimble apex ```cs updatedPublicData = new() { { nameof(PublicPlayerKeys.UserID), await G...

even in this kind of declaration
technically that's a definition, not a declaration.

the kind of definition you use doesn't affect whether or not a sequence is guaranteed, what matters is the implementation. no matter how you define the contents, if you're using Dictionary (and not a subclass that implements it differently, for example) then you don't a guarantee of order.

naive pawn
weak cloud
#

does mono have OrderedDictionary or is that .NET exclusive

#

I can't really think of a usecase of it

weak cloud
weak cloud
naive pawn
#

and mono does support a version of .NET that has OrderedDictionary

weak cloud
#

OrderedDictionary would be part of the .NET standard library

#

System.Collections.Specialized iirc

#

which comes part in parcel with the .NET runtime

#

there'd probably be issues using the .NET standard library with mono runtime

naive pawn
#

no

#

that's.. not how stuff works

#

but the generic OrderedDictionary is on newer versions of .NET so unity doesn't have that

weak cloud
#

which includes Systems.Collections

#

and they don't have OrderedDictionary because they haven't updated their implementation to support all the new C# stuff

nimble apex
#

i think this should ease the tension lol

updatedPublicData.Add(nameof(PublicPlayerKeys.UserID), await GenerateUserID(context, gameApiClient));

updatedPublicData.Add(nameof(PublicPlayerKeys.Name), $"User_{updatedPublicData[nameof(PublicPlayerKeys.UserID)]}");

updatedPublicData.Add(nameof(PublicPlayerKeys.Lv), (byte)1);
updatedPublicData.Add(nameof(PublicPlayerKeys.Exp), 0);```
naive pawn
nimble apex
#

because im adding it now, assume if the first add is successfully executed, second add should be able to refer to first one

weak cloud
#

or any usage of it

naive pawn
#

again, the nongeneric version is available, the generic version is not

weak cloud
#

yep that's where i've got the mixup

#

the generic stuff isn't in .net standard which makes sense why unity wouldn't have it

#

they'd have to add the system.collections library or reimplement

nimble apex
#

i think tryadd should be better lol

weak cloud
naive pawn
#

kinda confused tbh. ive tried looking this up before, and i distinctly remember finding just results with only string keys (and object values)

#

maybe that was a different class...

weak cloud
#

you mean the generic one?

naive pawn
#

no, the generic one takes generic keys too

weak cloud
#

ye

#

i'm not sure what you're confused about tbh

naive pawn
naive pawn
weak cloud
#

oh

naive pawn
#

ah, if it's AddRange then it wouldn't work, yeah

#

hmm, are you sure it's addrange?

weak cloud
#

looks like it

#

for the constructor passing in a dictionary

#

calls AddRange

naive pawn
#

this isn't the constructor passing in a dictionary

#

this is a collection initializer

nimble apex
#

in fact, i just realized tryadd maybe more suitable to my method

this function is a validation of account data, what it does :

  1. check if certain field exists or not
  2. if yes, ignore it , just let it be
  3. if no, generate the field with default data
naive pawn
#

the docs for the collection initializers don't mention addrange at all

nimble apex
#

yep thats just tryadd

naive pawn
#

no, it'd be Add, it errors

weak cloud
#

it'd be a thousand times easier for you to just generate the userid outside of the dictionary

nimble apex
#

yeah

naive pawn
#

that'd also be true

nimble apex
#

i just isolated userID

naive pawn
nimble apex
#

no matter on which conditions, i will check userID first

naive pawn
#

you don't have existing fields anyways

#

you're overwriting the entire dictionary

#

did you try your code before asking at all?

weak cloud
nimble apex
#
updatedPublicData = new()
{
    { nameof(PublicPlayerKeys.UserID), await GenerateUserID(context, gameApiClient) },
    { nameof(PublicPlayerKeys.Name), $"User_{updatedPublicData[nameof(PublicPlayerKeys.UserID)]}" },
    { nameof(PublicPlayerKeys.Lv), (byte)1 },
    { nameof(PublicPlayerKeys.Exp), 0 },
};```
#

went back to the old way

#

i gonna do add instead

#

its much safer

#

yep, if its add it will be working smoothly , sry guys and ty 👍

naive pawn
#

ah right, because updatedPublicData isn't actually set to that dictionary yet

#

something like this would make it more obvious

tawdry helm
#

How can I access the alpha of a color in an image component of something in the UI? I want to make a visual effect (as a PNG image in the UI canvas) set its alpha value to 255 when losing health (and also make the same visual effect lose alpha value in update every frame if it's over 0 but I can guess how to do that)

#

In a script I mean

#

The method I'm planning to use is making a function in a script attached to the visual effect image object and make other objects call that function whenever a damage conditional is fulfilled

#

But I'm not sure if I can access the alpha variable in the color of the Image component in the script, couldn't find that in the documentation

rocky canyon
#

image.color

tawdry helm
#

Thanks!

jovial bone
#

I have been following this tutorial, https://youtu.be/zbBwKMRyavE?si=QZM6cZLYtc8Ap_r_ and have tried to recreate it. However at timestamp 8:24 when the code is run, I get a memory leak due to allocation whereas the code in the tutorial runs fine. I have referred to his github and cross checked my code. I am using Unity 6 and a built-in 3d template. What appears is a single particle and no other particle. For reference, my specs are rtx 5070, 32 gb of ram and ryzen 5 7500f

Got really curious about Realtime Fluid Simulations and I put together this video that will hopefully help you understand how it all works, the core technology used is Smoothed Particle Hydrodynamics, and everything is written from scratch in Unity using C# and Compute Shaders.

If this video gains some interest I'll release a second part about ...

▶ Play video
teal viper
jovial bone
#

Ill share it just give me a moment

#

this is the error

teal viper
#

!code

radiant voidBOT
teal viper
jovial bone
#

this is what i get

teal viper
jovial bone
#
Found 1 leak(s) from callstack:
0x000001cbef3ee283 (Mono JIT Code) UnityEngine.ComputeBuffer:.ctor (int,int)
0x000001cbef3eb773 (Mono JIT Code) SPH:Awake () (at C:/Users/UK202/Fluid 1/Assets/Scripts/SPH.cs:63)
0x000001cc9b1ff3b8 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007ffb0cc86bfe (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffb0cbc8984 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)
0x00007ffb0cbc8a70 (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3115)
0x00007ffb152d30f4 (Unity) scripting_method_invoke
0x00007ffb152d9fb3 (Unity) ScriptingInvocation::Invoke
0x00007ffb152da09e (Unity) ScriptingInvocation::InvokeChecked
0x00007ffb15311858 (Unity) SerializableManagedRef::CallMethod
0x00007ffb151e680b (Unity) MonoBehaviour::CallAwake
0x00007ffb151e4ee6 (Unity) MonoBehaviour::AddToManager
0x00007ffb151e590f (Unity) MonoBehaviour::AwakeFromLoad
0x00007ffb15344368 (Unity) AwakeFromLoadQueue::InvokePersistentManagerAwake
0x00007ffb15348e8a (Unity) AwakeFromLoadQueue::PersistentManagerSingleQueueAwakeFromLoad
0x00007ffb15348bad (Unity) AwakeFromLoadQueue::PersistentManagerAwakeFromLoad_NoChecks
0x00007ffb15276670 (Unity) LoadSceneOperation::CompleteAwakeSequence
0x00007ffb15276f5d (Unity) LoadSceneOperation::CompletePreloadManagerLoadSceneEditor
0x00007ffb15277cc1 (Unity) LoadSceneOperation::IntegrateMainThread
#

this is what it gives

#
_particlesBuffer = new ComputeBuffer(totalParticles, 44);
#

apparently this line is the issue

#
_argsBuffer = new ComputeBuffer(1, args.Length * sizeof(uint), ComputeBufferType.IndirectArguments);
#

as well as this one

#

is it something wrong with the code or unity version?

#

wait i have fixed it

#

it was to do with the order of the items in the struct

naive pawn
#

oh god, c# has alignment stuff?

#

i shouldn't be surprised, but damn

jovial bone
#

im like a very beginner level dev, and ive just started my first year in uni

#

so i dont know much but im learning

naive pawn
#

if it's alignment as i suspect, i could probably explain the issue

#

what's the struct in question?

jovial bone
#

it is a particle struct

naive pawn
#

yeah, i'm asking about what's actually in the struct

jovial bone
#
[System.Serializable]
[StructLayout(LayoutKind.Sequential, Size = 44)]
public struct Particle {
    public float pressure;
    public float density;
    public Vector3 currentForce;
    public Vector3 velocity;
    public Vector3 position;
}
naive pawn
#

it also seems like _argsBuffer could be "wrong", in a way? though i'm not familiar with ComputeBuffer so maybe it's structured in a way that that's necessary

jovial bone
#

before my struct fields where in reverse order

#

causing the leak issue

naive pawn
jovial bone
#

i find it weird tbh

teal viper
#

Perhaps changing the order just fixed the issue temporarily.
It could be something with the buffer lifetime.

#

I mean, it must be.

grand snow
#

hmm yes a beginner issue for sure /s

solar hill
swift crag
#

yes, if it's complaining about a leak, then the problem is that you aren't freeing a buffer

#

I would not expect this to have anything to do with struct layout

#

you need to call Dispose() on the buffer when you're done with it

swift crag
#

When the buffer is allocated, Unity makes a note of it (and remembers the current callstack)

#

It can check later (probably when it's winding down from Play Mode) if any of these allocations weren't freed

#

This isn't a fatal problem, but it would be best to neatly dispose of the buffer when you're done with it

jovial bone
#

so then where would be the right place to call dispose?

swift crag
#

(especially if you're only "leaking" it when the game quits)

jovial bone
#

it leaks during play mode

swift crag
#

as in, when you exit play mode, yeah

#

You can dispose of it when the component that's managing the fluid system is destroyed

#

of course, you shouldn't try to use the compute buffer after disposing of it

jovial bone
#

the sim does not run i.e. work

swift crag
#

ah

jovial bone
#

this is what im seeing

swift crag
#

You are not getting a message that says "GarbageCollector disposing of GraphicsBuffer. Please use GraphicsBuffer.Release() or .Dispose() to manually release the buffer. To see the stack trace where the leaked resource was allocated, set the UnsafeUtility LeakDetectionMode to EnabledWithStackTrace.", correct?

jovial bone
#

yep

swift crag
#

er, that was GraphicsBuffer, but same idea

#

That gets logged in the destructor of the ComputeBuffer if you didn't dispose of it yourself first

#

However, it only gets logged if native leak detection is disabled, and native leak detection is what's printing that information to your console

#

so that's not surprising, actually

swift crag
#

this is especially relevant if you've turned off the enter-play-mode Domain Reload (so that entering play mode is faster)

jovial bone
#

ah i seee

swift crag
#

although, either way, you'd wind up seeing a message as you enter play mode

#

(assuming that it's checking for native leaks upon reentering play mode)

jovial bone
#

but now my simulation is not advancing

#

ill send my current code

swift crag
#

That's going to be unrelated to the leak warning.

jovial bone
#

yea

#

this is my code

#

there should be a cs file and a compute file

#

wait its working again lmao

#

thank you so much for the help @teal viper @naive pawn @swift crag

pliant dome
#

I want to make the boxcast half the length of my capsule collider

#

I managed to make it go half way down

#

but I can't anything else past this idk what to do

solar hill
#

half the length?

#

width or height

pliant dome
#

Height

solar hill
#

well if you are moving it down and its half the height then you need to move it down 50% more

#

so it doesnt go half way down

#

if you need it to go all the way down

#

in fact what are you trying to do

pliant dome
#

making the boxcast reach the same length as the capsule collider

#

then Ill add a very small value like 0.1f to it

#

so it extends past it

#

nevermind

solar hill
#

since boxcasts originate from the center of the box iirc

native willow
#

Hey, does anybody where can i found some help?

edgy sinew
polar acorn
#

On whichever channel is the most relevant to the question

edgy sinew
#

omg hi digiholic! maybe u know the answer to my question

native willow
#

Ok, thx i will keep that touch. 😉

edgy sinew
#

blushie hi all, I was wondering how to interpret the time that returns from animationClip.length
i noticed my clip time says about 1:20 but the value returned is 1.875 🤔

verbal dome
edgy sinew
#

The source take says 24 FPS but I don't know how that would matter.

verbal dome
#

100 frames should be 2.4 secs then 🤔

edgy sinew
verbal dome
#

Ah so you didnt take into account that it starts at 57

#

Problem solved?

#

I guess length doesnt care about the start/end frame

#

Hmm wait no thats backwards

edgy sinew
#

So, two clips from the same source, totally different start/end, yield the exact same time.

edgy sinew
verbal dome
#

Whats the actual issue you are solving?

#

As in, what do you need the exact duration for

#

@edgy sinew have you changed the speed of the playable?

edgy sinew
native willow
#

Can someone tell me what is the script of Opening & Close Credits Panel instead of using Scroll Bar? I'm so pissed off by ChatGPT now.

solar hill
#

theres no premade rolling credits template of any kind iirc

edgy sinew
#

@verbal dome Interestingly at runtime the clip seems to end perfectly, at "1.875", I think it's the Inspector value that shows up at the bottom that is skewed.
For ease of view, image is of the other clip for which animationClip.length shows 4.25 (but the Inspector preview thing only goes to 4:05.)

native willow
edgy sinew
# native willow Is this part of animations?

Well, yes. For some [SerializeField] animationClip or any animationClip in general,
animationClip.length returns a different value than what the Inspector preview says at the bottom.

#

And using .GetDuration() on an AnimationClipPlayable seems to return the source take length,
not the length of the clip you've configured by moving the Start and End frames

fast tulip
#

I need help, my animation does not save the position, I tab out on the animator tab and go into the animation again and the positions are reset. The values in the object position and rotation in the animation editor do change, then reset when I go out of the tab

verbal dome
fast tulip
verbal dome
#

Were you directly modifying the position values in the animation window or were you moving objects around?

fast tulip
#

moving them around

verbal dome
#

Yeah that needs to be recorded

fast tulip
#

Okay, thank you!

#

also is this the right channel? I didn't know as "animations" were in the "Artist Tools" section and you guys were fixing other people's animation problems so I was confused and decided to try here.

verbal dome
#

The other person was asking more code-related stuff so that goes here

#

Either channel woulda been fine for their question tbh

fast tulip
#

Ok, Thanks!

ripe prawn
#

guys can somone who litlle bit knows in unity help me with somthing im beginner i went to void and i dont know how to get out of it i ask chatgpt and he didnt know wha i was saying

rough granite
ripe prawn
#

i had all this in my screen and now its all gone

radiant voidBOT
# eternal needle !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

ripe prawn
#

now its only that 😭

rough granite
#

In the project tab go to Scenes and reopen the SampleScene if stuff if missing theres nothing we can do its lost for good

#

Also not a code question

ripe prawn
#

omg thank u soo much

tawdry helm
#

When I try to use "rigidBody.AddForce(Vector2.up * speedVariable * Time.deltaTime);" to make a bullet get speed on spawn it just goes upwards instead of inheriting the rotation of its parent object. Is the problem in that line?

deft loom
#

I'm following a tutorial that uses the old input manager. How can I take what they show me and apply it to the new input system?

eternal needle
verbal dome
#

Especially if you call it from Update/LateUpdate, the bullet's initial speed will depend on your framerate

tawdry helm
#

Thanks! It works now! But if i remove Time.deltaTime it won't move.
Also the line is at void Start

#

Oh nevermind it was the mass on the rigidbody, changed it accidentally

#

I feel like the bullets are speeding/slowing a bit alongside the fly movement maybe??? I can leave it like that but I would also like to know how can I prevent that from happening

verbal dome
tawdry helm
#

nope

verbal dome
#

You are probably using a 3D position to set the direction here

#

You should ignore the Z coordinate (depth)

#

But I'm just speculating, maybe show more of your code

tawdry helm
#

This is attached to the invisible object that shoots bullets which is a child object of the fly

#

Oh

#

There it is, deltaTime

umbral bough
#

Hi, I am updating an asset to the latest unity api and am not sure whether these are just drop in replacements or if there's some more work to be done?

naive pawn
#

like velocity to linearVelocity

umbral bough
#

Thanks!

naive pawn
#

and technically fixed to be more accurate, drag would be proportional to the square of the velocity, but here it's proportional to velocity

old skiff
#

how do i activate the hint that suggest word you wanna write like gameobject or ray

radiant voidBOT
old skiff
#

tried that didnt work

rich adder
old skiff
#

still not woking mabye i shuld reinstall

old skiff
#

what modules are nessesary

wicked cairn
left path
#

Hmm should I change the velocity? using UnityEngine;

public class PlayerMovement : MonoBehaviour
{

public float speed;
public float jump;
private float Move;
public Rigidbody2D rb;

void Start()
{
    
}


void Update()
{
    Move = Input.GetAxis("Horizontal");

    rb.velocity = new Vector2(speed * Move, rb.velocity.y);

    if(Input.GetButtonDown("Jump"))
    {
        rb.AddForce(new Vector2(rb.velocity.x, jump));
    }
}

}

umbral bough
safe harness
#

It could be implemented at runtime, like this? And plug it to some UI element for player inputs/interactions 🤔 if it is what you meant by changing asmdefs

using UnityEngine;
using UnityEngine.InputSystem;

public class KeyRemapExample : MonoBehaviour
{
    public InputAction jumpAction;

    private void Awake()
    {
        // Create the action if not assigned via Inspector
        if (jumpAction == null)
        {
            jumpAction = new InputAction("Jump", InputActionType.Button);
            jumpAction.AddBinding("<Keyboard>/space"); // Default binding
        }
    }

    private void OnEnable()
    {
        jumpAction.Enable();
    }

    private void Start()
    {
        // Override the binding at runtime
        jumpAction.ApplyBindingOverride("<Keyboard>/enter");
        Debug.Log("Jump key changed to Enter");
    }
}

umbral bough
#

wym

safe harness
#

Eh eh, I know code-fu

left path
#

Im trying to do this cube 2D game https://www.youtube.com/watch?v=6xn0Sokihdc

More videos coming soon!

Intro 00:00
Setup 00:22
Creating Variables 03:12
Move function 03:58
Jump function 05:56
Inspector 06:33
Ground Check 07:20
Outro 10:44

Main Channel: https://www.youtube.com/c/bblakeyyy

Patreon with fully explained c# scripts:
https://www.patreon.com/BlakeyGames

NEW SERVER LINK: https://discord.gg/cyskvvyDeH

Silhou...

▶ Play video
safe harness
left path
#

I don't know much i'm just following the tutorial

#

Hehhe

sour fulcrum
left path
#

Aah okay

sour fulcrum
#

its a change to unity newer than that tutorial

left path
#

Aah okay

umbral bough
left path
#

Ty for help!

umbral bough
safe harness
umbral bough
safe harness
umbral bough
#

6.3 lts

safe harness
umbral bough
#

maybe, not sure tbh

#

The thing is, it's not even an asmdef ref that I am missing.
I just tried creating an empty script in the assets dir and I can't access it from there either.

safe harness
umbral bough
crisp quest
torn mango
#

anyone knows why I cant change the mat of the eyebrows

safe harness
umbral bough
#

I am on linux and not seeing an so file is a bit odd, maybe this package doesn't support linux or something?

#

and I can't even switch to windows as the "module is not loaded", even tho I did install it and restart unity, this engine is a joke

safe harness
umbral bough
#

Let me delete the library dir, maybe unity did the unity thing and corrupted itself

#

nop

alpine bronze
#

yo why does Math.Round(); not work?

umbral bough
alpine bronze
#

well it doesnt round up the number

umbral bough
#

and you probably wanna be using Mathf not Math when working with uniy

alpine bronze
#

but what difference does it make

umbral bough
#

like what the input and output is

alpine bronze
sour fulcrum
#

floating point precision probs