#💻┃code-beginner

1 messages · Page 602 of 1

red igloo
#

so I shouldnt use joints?

rocky canyon
#

simpler.. i'll show u 1 sec

#

let me show u what i have and then u tell me if its something that ur after

mystic ferry
#

Ah no gifs.

rocky canyon
#

no rigidbodies involved except on the cube itself

red igloo
rocky canyon
#

no joints.. or anything else

red igloo
#

since my game is at a side view

rocky canyon
#

ohh well pooey!

#

ohh it still can work w/ side view

rich adder
#

idk i tried joint and works

red igloo
rich adder
#

just need to clean it up

#

you would prob need to lock rotation so it doesnt flip the player
I also had code to push rigidbodies it probably messed with the pull code

red igloo
rocky canyon
#

okay.. i tried lol

mystic ferry
#

There’s 100 solutions to everything.

rocky canyon
#

yessir

red igloo
rich adder
rocky canyon
#

thats pretty fun lookin lmao

#

like that pick-axe climber game

#

w/ the offset mass

mystic ferry
#

It reminds me of Little Big Planet more.

red igloo
red igloo
#

my fav game

rich adder
rocky canyon
#

ahh u shoulda led with that

#

yea, nav was right i was wrong 😢

rich adder
#

just gotta refine it a bit

mystic ferry
red igloo
#

I hate sony for killing sackboy and replacing it with a shitty white blue eyed robot

rich adder
#

little big planet 1 was peak

rocky canyon
rich adder
#

i bought a ps3 just for it

red igloo
rocky canyon
#

thats epic

rich adder
red igloo
#

custom servers on their discord

rich adder
#

yeah wish they would've me a good pc port

#

with like Steam community / workshop

mystic ferry
#

They don’t make children’s games like they used to.

red igloo
# rich adder yeah wish they would've me a good pc port

Note: This product is in development and subject to change. All content featured is from an in-development Alpha build of the game.Level Editor / Community ContentBuild new 2.5D platforming experiences with an extensive in-game level editor! Browse the community's creations via integration with Steam Workshop, or publish your own content for oth...

Release Date

To be announced

▶ Play video
#

the old devs are making their own

rich adder
mystic ferry
#

🤷‍♂️

#

I mean that’s not a bad thing.

red igloo
#

any ways should I not use fixed joint?

#

one person is saying yes the other no

red igloo
mystic ferry
#

Are you using the input system or just doing it the old fashioned way?

simple vine
#

guys how do i add minigames to my project because its very short and i need minigames for players to play without just leaving so does someone know how to make minigames

mystic ferry
simple vine
#

like i want to add 3 mini games

#

the first one is like a memory game

cosmic dagger
simple vine
#

and like a red light green light

#

and i got no clue for the 3rd

simple vine
#

also how do i get rid of a background

ruby python
#

Pwease? lol.

red igloo
mystic ferry
red igloo
red igloo
rocky canyon
#

u could.. or u could put it w/e side it needs to be on

mystic ferry
#

Yeah I was gonna say that. You could also use a trigger box collider on the box that makes some bool true and that means you can grab it.

#

Sounds like some math to me.

ruby python
#

I might be missing something, but why Raycasting? why not simple colliders?

ruby python
rocky canyon
#

either or work.. some ppl prefer raycasting

#

me for one.. i dont like having colliders scattered about that i need to keep track of..
esp if they'll be some thats not even used unless at specific times/directions

ruby python
#

Okay, yeah, was just a little confused is all. lol. And yeah, that makes sense.

mystic ferry
rocky canyon
#

lol.. ur supposed to already know that..

#

thats basic HS stuff 😛

ruby python
rocky canyon
#

well the code/API stuff i guess not

#

but the math! yes lol

ruby python
#

Dude, I haven't been to high school in 32 years and not done that stuff since then. lol.

simple vine
#

guys how do i add a memory game

mystic ferry
simple vine
#

who

mystic ferry
#

The purple guy.

ruby python
simple vine
mystic ferry
simple vine
#

how i no clue how do that

ruby python
#

I recreated my 2019 Brackeys Game Jam entry. This first video I show you how I created the card grid layout.

The game is playable on itch.io:
https://kregames.itch.io/one-true-pairing

Timestamps:
0:00 - Intro
0:14 - Creating the project
0:41 - Setting up the Canvas
5:45 - Create the Grid Layout
7:23 - Calculating card size
14:10 - Add spacing...

▶ Play video
cosmic dagger
# simple vine guys how do i add a memory game

You need to look at what a memory game consists of, then work on creating all of those individual parts. Next, look at the steps taken to play the game, and again, work on creating each of those individual parts . . .

red igloo
cosmic dagger
ruby python
simple vine
mystic ferry
#

How much programming do you know?

simple vine
#

i started like 2 days ago so like 0.0001

mystic ferry
#

Yeah that explains it. You gotta learn about the basics like what variables are, methods, data types, if statements and the whole shabang.

#

Also when you use tutorials it’s important to make sure you understand what they’re doing and not just copying code. So next time you don’t need to come back.

wild island
#

Is there any point to profiling in the editor? My script runs like 4x faster in build

simple vine
#

and this is what i want it to look like so it will be even more harder because the after they done i want it to apper when they complete the mini game and if they fail i want them to fall to the void and die

mystic ferry
#

What is a patton bored?

cosmic dagger
simple vine
wild island
red igloo
#

when I use a fixed joint why cant I move?

rocky canyon
#

not sure.. is it anchored to anyhing static?

deft loom
#

Is it fesaible to think that I could gain a similar performance boost to occlusion culling programatically by setting SetActive true/false for each gameobject based on it's distance to the player? It sounds like it'd work but before I start trying to implement it I just am hoping someone can give me a sanity check lol

mystic ferry
# red igloo no

His ball moves by rotating I think so maybe it’s because the box is stopping its rotation.

mystic ferry
#

But maybe.

#

I don’t know.

cosmic dagger
red igloo
#

literally cannot move

rocky canyon
#

put the ball into the connected RIgidbodySlot

red igloo
#

why would I put the player in there?

rocky canyon
wild island
rocky canyon
#

to check if ur player moves that way 😄

#

just basic troubleshooting.. more info = more better

#

with a 2D fixed joint it doesn't seem to have taht issue

red igloo
#

it wont let me put it in the slot

rich adder
red igloo
rich adder
#

ya

red igloo
wild island
#

I'm experienced with reading c++ disassembly, so ideally I'd like to inspect the machine code that's actually running, so I can judge if there is anything unexpected?
No idea how that works with C# code though 😦

cosmic dagger
rocky canyon
#

may want to leave the fixedjoint disabled until u need it

rich adder
#

oh thats weird

cosmic dagger
red igloo
rich adder
#

maybe because I add it at runtime I didnt notice

rocky canyon
#

i had to assign the rigidbody of the player

#

but thats when i realized its probably better to just leave it disabled

#

until u need to use it

opaque canopy
#

yoo @rocky canyon

rocky canyon
#

b/c it gives an error

opaque canopy
#

@red igloo, hello

red igloo
rocky canyon
#

are u trying to add the Player -> the same object the rigidbody is on?

opaque canopy
#

what's up @rocky canyon

rocky canyon
#

disable it and try moving around..

#

and then add the thing u want to drag and then re-enable and try to move

rich adder
#
 if (Input.GetKeyDown(KeyCode.E))
        {
            if (joint != null)
            {
                Destroy(joint);
                joint = null;
                return;
            }
            var hitz = Physics.OverlapSphereNonAlloc(transform.position, 1, hits, hitlayers);
            for (int i = 0; i < hitz; i++)
            {
                if (hits[i].TryGetComponent(out Rigidbody rb))
                {
                    joint = gameObject.AddComponent<FixedJoint>();
                    joint.connectedBody = rb;
                }
            }
        }
    }```
rocky canyon
#

^ see it takes a little hands-on

rich adder
#

its very important you lock the rotations btw

#

i forgot to do that in code but did it in the inspector
this prevents the picked up box to do anything to the original holder

wild island
#

That's good. I definitely would check

rich adder
#

box ^

rocky canyon
#

lol.. tomato tomato

rich adder
#

ngl this mechanic is kinda smooth

rocky canyon
#

i like my raycast one

#

b/c i had to write it 😄

rich adder
#

raycast good too, i just got lazy and did a catch-all sphere xD

#

probably not the best if you got rigidbodies above yourhead..

red igloo
#

BRO this is soo confusing why can't I move??

rich adder
red igloo
#

I even restarted unity to see if it worked

red igloo
rich adder
rocky canyon
#

disable the joint! and re-enable it only when u need it..
aka.. *try adding ur box into the connected RIgidbody before u play)

#

and see if u can move that way ^

rich adder
#

yup ^

#

you can see in my code I dont even have it there, I just add it at runtime

rocky canyon
#

it doesn't allow u to move with an empty joint..

#

it basically locks u onto the ground

red igloo
rocky canyon
#

yes.. watch ^ same thing happens to nav's i bet too

#

when theres no rigidbody assigned and its enabled.. ur not moving..

#

but if u have an object slotted in there.. and enabled you can

red igloo
#

alright I will just only enable it when I pull objects then

rocky canyon
#

ya, i think its just a weird quirk of the physics engine

simple vine
#

im back

rocky canyon
#

w/o a rigidbody slotted in there.. it just knows ur connected a fixed joint? but fixed to wat?

#

i gess it just fixes u to the scene in general

rich adder
#

i think

simple vine
#

can someone help me with making a memory game and making the platfrom disapper and the after they done it apper when they complete it

rocky canyon
rich adder
#

idk i had fixed joint on moving objects b4 but didnt affect their movement but that was transform movement btw

rocky canyon
#

my 3d uses CC too so culdnt test accurately

#

but was it fixed to a child of the rigidbody?

#

mine works when i fix it to myself..

#

but unity biches

rich adder
#

nah yeah you dont wanna put your own rigidbody in the slot itself lol

rocky canyon
#

u can move b/c ur translating thru the physics

#

f*** u physics.. im moving anyway

rich adder
#

teleport at its finest

rocky canyon
#

thats how my Physics Pickup mechanic i showed off earlier works

#

🤫 dont tell anyone

#

it works pretty well even against walls and stuff

median hatch
#

hey does anyone know how to fix "failed clustering job" when baking lights in unity? im using HDRP

rocky canyon
#

so until it doesn't imma keep it lol

red igloo
#

the FixedJoint does not have an enabled property so how would I enable/disable?

median hatch
rich adder
#

did you verify thats the issue tho

#

did you move object without it

red igloo
#

without the fixed joint?

rich adder
#

correct

#

to narrow down that is indeed holding player movement somehow ?

red igloo
#

yes I can move the object around without fixed joint but when I add it back I can no longer move

rich adder
#

ok

#

so add it at runtime like I did

#

its because yours is a rigidbody so a fixed joint also stops the parent/root of fixedjoint

#

mine was a character controller so even if i leave it on empty, it doesnt affect it

rocky canyon
#

or springJoint.spring = 0;
springJoint.damper = 0; might be able to set ur spring to 0

rich adder
#

either way its better to add it via code

rocky canyon
#

id try that anyway if ur locked while movement.. it may be a work-around

rich adder
#

runtime addcomponent should work out tbh

rocky canyon
#

imma open my 3d rigidbody project

rich adder
rocky canyon
#

ya, adding and removing the entire component makes sense tbh

#

now im interested in why 2D joint has .enabled but 3D doesnt

mystic ferry
#

Because Unity.

rocky canyon
#

i mean.. ur not wrong lol

mystic ferry
#

Can’t wait for 4D joints.

rocky canyon
#

(╯°□°)╯︵ ┻━┻

rich adder
#

makes sense since they are different engines

#

they work different

mystic ferry
#

Then 5D joints with multiversal time travel. I heard unreal has those.

rich adder
#

2D kinematics have velocity and can move with it, Rigidbody3d cannot

rocky canyon
#

yup that tracks

simple vine
#

can someone help me with making a memory game and making the platfrom disapper and the after they done it apper when they complete it

rich adder
mystic ferry
simple vine
median hatch
simple vine
median hatch
#

easier to manage

rich adder
simple vine
median hatch
#

then i dont know what you mean at all

#

sorry

rocky canyon
#

public GameObject urThingUWantToDisable;

urThingUWantToDsiable.SetActive(false);```
rich adder
#

like a memory one and not animated, what that even mean..

simple vine
#

i want to make an memory minigame

rocky canyon
#

you'll probably need a gamemanager.. keeping up with states..

median hatch
rich adder
median hatch
#

otherwise you won't be able to explain what your problem is

rocky canyon
#
  • Move has begun
  • Move in progress
  • Move Finished

then when MoveFinished -> disable the gameobject or UI/Image or w/e it is

simple vine
median hatch
#

unity and coding basics

mystic ferry
# simple vine how idk how too

I’m sure there are tons of resources you can find to teach you Unity or even videos from people of how they used Unity. Because if you went and learnt the basics all this would start to make sense how to do with minimal help.

rich adder
# simple vine yeah 🙂

how? you need to understand basic concepts like state tracking, and references to store objects in variables to compare

mystic ferry
median hatch
#

cant tell if youre trolling or not at this point

rocky canyon
rich adder
simple vine
median hatch
rich adder
simple vine
rich adder
#

plenty of videos there

mystic ferry
simple vine
#

thx

#

okay how do i get the basics one

#

theres about 5

rich adder
#

Essentials -> Junior etc.

simple vine
#

this

rich adder
#

correct

simple vine
#

ok

rich adder
#

this will get you familiar with the basics

red igloo
rich adder
#

looks ok script wise

red igloo
#

I dont know why I didn't think of that lol

#

phew

night quest
#

is there a way using clientRPC for the host to sent a movement input to a client that will move the client because my implemenmtation the client receives the input and does nothing with it

rich adder
#

unless you target a specific playerId

night quest
#

ok thanks ill give it a go again

rich adder
mystic ferry
#

Is networking hard? I don’t know the first thing about it and I plan to add it to my game at some point in the future but I’ve heard it’s not a good idea to add it mid development but I’d rather have a semi video game before I dive into it.

rich adder
rich adder
#

building for a planned multiplayer scenario is much easier

mystic ferry
#

Well whatever doesn’t kill me will make me stronger. 🤷‍♂️

night quest
#

if you recommend something else id be very happy

rich adder
#

the netcode documentation is surprisingly very good

#

the example projects need work, things like boss room are good but they are far too complex

mystic ferry
rich adder
mystic ferry
#

I just joined this one today though but the people in the Unity Developer Community Discord have told me that.

rich adder
#

I dont mind, its whatever to me, it doesnt affect me at the end of the day.
To me its the claim of "clean code" is cringe af and selling whoring their lessons thing every 5 mins is also annoying

night quest
#

so would serverRPC be better, or would i need both to send inputs both ways around

mystic ferry
rich adder
red igloo
#

how do I make slippery slopes? so when I go on it my ball rolls down

rich adder
mystic ferry
rich adder
timber tide
#

physics materials can help here too

mystic ferry
#

I forgot about those.

rich adder
#

oh yeah this is a rigidbody after all. I was doing it with CC and its a bit more involved since we cannot use physics material there

mystic ferry
#

My favorite tutorial channel is llamacademy. Not trying to sell you anything just straight to the point, informative and positive energy. He’s got a video on almost anything.

#

Also a very small channel.

rich adder
#

I can appreciate a few like llamacademy

#

I learned a lot from him when i started

#

git-amend is someone I recently also enjoy some of their content

mystic ferry
#

Nice.

#

This is a corny joke but I would’ve named myself Weimann.JSON.

rich adder
#

I bet the jokes were there in his team

#

we gonna send this to JSON

#

oh wimann ?

#

nahhh like actual Text json

mystic ferry
#

Badum tss

#

Not to brag but I’m also just as famous as him. I got my first itch.io follower. Yeah I’m kind of a big deal.

edgy sand
#

I am currently trying to make a card game following a tutorial by Sinuous, however I am tweaking things as I go to fit my needs. The current problem I have is that the way this is made is through a grid system, and I'm trying to move a card onto the grid. I can pick up the card, move it, and drop it, it registers the correct grid, but instead of putting it onto the grid (picture 1) it puts it onto the smaller grid (picture 2 and 3) located in the center of the world, not the canvas.

private void HandlePlayState()
{
    rectTransform.localPosition = playPosition;
    rectTransform.localRotation = Quaternion.identity;

    if (!Input.GetMouseButton(0))
    {
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit2D hit = Physics2D.Raycast(ray.origin, ray.direction);
        if (hit.collider != null && hit.collider.GetComponent<GridCell>())
        {
            GridCell cell = hit.collider.GetComponent<GridCell>();
            Vector2 targetPos = cell.gridIndex;
            if (gridManager.AddObjectToGrid(gameObject, targetPos))
            {
                HandManager handManager = FindAnyObjectByType<HandManager>();
                handManager.cardsInHand.Remove(gameObject);
                handManager.UpdateHandVisuals();
                Destroy(gameObject);
            }
            TransitionToState0();
        }
    }


    glowEffect.SetActive(false);
    rectTransform.localScale = originalScale;
}```
This code is what I'm using to move it
#

If more info is needed just let me know

median hatch
#

then just switch the sprite with whatever card you select

edgy sand
#

Nice PFP btw

#

And wdym?

median hatch
#

oh lmao

#

you can achieve this by having buttons

rocky canyon
#

ohh gameplay in the Canvas 👀 . that oughta be fun

median hatch
#

xD

edgy sand
#

I can't say hmm?

#

What?

median hatch
#

but i was able to pull it so

#

if i can he can

rocky canyon
#

i stick with SpriteRenderers and World-space with ortho cam for gameplay

#

assigning the correct positions w/ recttransforms be a headache

rich adder
#

switch canvases oh what a nightmare.. parenting

rocky canyon
#

yea.. i felt the same

edgy sand
#

I'm gonna need a bit dumbed down since this is my first foray into 2d game design and I thought this tutorial was good lol

rocky canyon
#

UI should be for displaying Information to the player..

median hatch
#

my idea would be to just have empty framed sprites, then do coding to select a card and place it in one of those empty sprites, switching empty sprite for selected card

#

is this a bad method?

rocky canyon
#

u instantly complicate things when u make UI/Canvas part of the gameplay loop

median hatch
#

i see

mystic ferry
#

Tsk tsk tsk

edgy sand
#

The way it works right now is I have card prefabs that have their own canvas that they print on, and I move that around to interact with them. If I'm understanding this correctly I should restart and not do that, and instead do... Something?

median hatch
edgy sand
#

I mean it was making sense right up until now lol

median hatch
#

someone is more experienced than me, but what suits me is having one canvas for all the cards placed and have a manager deal with that

edgy sand
#

A manager does deal with them

rich adder
median hatch
#

you make a list with all the cards youre currently holding

#

and a list with all the empty slots on the board

rocky canyon
edgy sand
#

There's a Game manager object/script that controls most things, such as the list that you just mentioned

rocky canyon
#

theres pro's and con's to both solutions..

rocky canyon
#

as always 😭 theres not just 1 way lol

rich adder
# rocky canyon

tbh the only reason why I use UI is because it scales with Screen

rocky canyon
#

mmh im thinking about particles and stuff..

#

it'd be so much easier for visual stuff to be world-space

median hatch
rocky canyon
#

lol

rich adder
#

we got particles working before iirc

rocky canyon
#

did u know..
fun fact: anytime u make a change to a UI element

#

the entire Canvas must be updated and redrawn

#

^ thats why i use 2d sprites

median hatch
edgy sand
#

I mean that makes sense for high-cost stuff, but is it really that bad to do it for a small card game?

#

Yea

swift crag
#

well, the canvas has to re-draw every frame anyway :p

#

but it does require an update whose cost is proportional to the amount of stuff in the canvas

edgy sand
#

There's not gonna be much on it

rich adder
edgy sand
#

Like the max I'm looking at right now is like 10 cards and a few ui elements

swift crag
#

I noticed that I was losing a few ms per frame when I had every single single submenu open during a transition

#

i no longer do that

median hatch
#

unless youre someone trying to make a massive game optimization shouldnt be a problem

#

especially with 2D

edgy sand
#

Ok good, so is there a solution for my problem that doesn't require a complete restart and recode of the project?

swift crag
#

your main concern should be making something that works (:

rich adder
median hatch
edgy sand
median hatch
#

that grid cell code you showed look like an headache

rich adder
#

sprites you can get much higher quality with meshes also get more shader benefits

edgy sand
rich adder
#

heartstone is entirely done with meshes / sprite

#

but if you see original cards they are huge

swift crag
#

we definitely do not need to be fussing over VRAM usage right now, lol

edgy sand
#

Seeing as I don't have an artist and probably won't for a long time, the high quality and shaders won't be a problem for like a year plus

swift crag
rich adder
edgy sand
swift crag
#

You'll want to have an image that displays the grid, rather than a sprite renderer

edgy sand
#

Now we're getting somewhere lol

swift crag
#

the rest of your logic should be pretty darn similar

median hatch
# edgy sand Yes, I do think I am

my recommendation is to have a canvas for the cards you're holding + cards in the board, reference all those cute images into a list and go from there

#

grid cell i'd scratch

#

but if you wanna keep grid cell then go for it

#

also once youre a bit more ahead you can even add some animations with dotween or leantween

median hatch
rocky canyon
#

or primetween..

median hatch
#

or secondtween...

edgy sand
#

With the rate this is taking I'll have animations in about a month at the earliest lol

median hatch
#

are you using scriptable objects?

edgy sand
edgy sand
edgy sand
swift crag
#

I see two good reasons to have one Image component per grid cell

#

one -- that lets you add or remove cells easily

#

two -- that makes it very easy to figure out where to put the cards!

rich adder
#

the layout groups were very handy for me

#

I used all 3 for different stack modes i needed

#

huge drawback of grid layout, or any group is having to mess with child ordering

prime cobalt
#

My game has an comic book page filter over it in the ui and I'd like to get it to turn alongside the players head so it doesn't just sit there unmoving like gunk on a visor. Any advice for how to do that?

rich adder
#

ScreenSpace - Camera could also work iirc that was the initial purpose was so you can rotate it like a physical obj w cam

prime cobalt
#

World space would just make it like a screen in the world though right? The effect I'm looking to create is more like an objective marker in 3d space, but it smoothly transitions around the screen to always fill it up. A certain part of it is anchored to a direction and it moves to always have that part of the filter over that direction, with the actual filter always being totally flat.

olive charm
#

how can i detect if a specific object touched specific object?

rocky canyon
#

Notes: Collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached.

olive charm
#

thanks!

rich adder
#

you can potentially use scriptable renderer feature or vfx graph. really need more info

prime cobalt
# rich adder do you have an example maybe ?

...not really, im sorry. It's kind of a really specific effect. It's like the filter moves in a 2d plane, only able to move up and down, and it moves with the camera in the 3d environment just without any depth. For example if you look left it'll move right in your display an equal amount so what was the left side of the filter is now the center. If you look up it'll move down in your display. But if you walk forward it won't grow. No depth.

#

Also if you keep spinning the filter keeps scrolling forever.

compact lodge
#

So I'm working on a dungeon crawler of sorts in Unity (Where the player moves through tiles), and I'm wondering why when I set the smooth transition variable to "true" it results in the player controller moving in place

grand snow
compact lodge
prime cobalt
drifting tree
#

does anyone know what would cause sprite animations to not render properly in build when it works perfectly in editor? even in the build, console is showing that the sprites are correctly transitioning according to the animator but it's just not displaying correctly

wintry quarry
#

Is this a SpriteRenderer, or a UI image or something

drifting tree
#

SpriteRenderer on the character

#

and it's animated using animation clips + the animator

wintry quarry
#

can you show your camera inspector?

drifting tree
void dawn
#

can anyone tell me how to make enemy ai in unity ?

keen cargo
wintry quarry
rich adder
#

"You just got skooled by LyricBattleBot3000. Try again"

keen cargo
#

plus making enemy ai is a whole job field, it's like asking a math teacher "can you teach me math"

compact lodge
#

In the context of a turn based RPG with separate exploration and battle segments, how would I handle the transition between exploration and battle.

wintry quarry
compact lodge
#

Like how exploration is it's own thing, but then when you go into battle, it has different mechanics and it's in a separate area.

wintry quarry
#

you just need to make sure you disable any scripts in the exploration scene related to movement etc when the battle is happening.

rich adder
#

yea multiscene would also be how I would do it, maybe some sort of enum that can track when you're in the exploration vs battlemode. This Event can be listened to toggle your scripts

compact lodge
#

Yeah I was planning on using an enum to store the game state (exploration, battle, outside segment). I just was unsure on how to approach switching. Thanks, I'll look into the additive scene loading.

rich adder
#

might need to keep a few singletons handy to maybe tell exploration world I killed this enemy so it doesn't popup a battle scene again

#

scene A will know nothing about scene B unless you pass that data around

drifting tree
wintry quarry
mystic ferry
#

Assertion failed on expression: 'm_ChannelAccessLeaseEndTime > 0.0'

I get this error every time I open any unity project empty or not. I'm not sure what it means and it doesn't break anything but I'm still curious as to what this is.

teal viper
mystic ferry
#

That's literally all it gives me.

frosty hound
#

According to Google it is somehow related to Collaborate. Are you on an old version of Unity?

mystic ferry
#

2020.3 LTS

frosty hound
#

Yeah, that's old. Open your package manager and remove the Unity Collaborate (or whatever it was called back then) package.

mystic ferry
#

I've never used collaboration though so not sure how that happened. It also looks like I don't have any packages about collaborate.

wintry quarry
#

used to be called unity-collab-proxy or something though

mystic ferry
#

Oh so this?

#

Remove it?

wintry quarry
#

if you're not using it

#

You may also want to consider updating all those

#

also making sure you're on the latest minor version

mystic ferry
#

Yeah thanks I'll do that now.

prime cobalt
# grand snow Ideally the effect would be applied in shader instead for the objects. You can s...

Does anyone have any idea why as soon as the camera holder's rotation enters the negatives with -0.1 the final output of rotationX in the UV rect just becomes -14.396 for some reason? After the random 14.396 gets subtracted when it enters the negatives all of the values add to rotationX like they should, but they're just adding to that -14.396. And I confirmed that there's nothing off about the camera holder's rotation.

leaden shard
#

Hey guys open question I learnt c++ up until the object-oriented programming section. Would c# start to make more sense to me. Whats the best way to learn c#

wintry quarry
#

But any programming is better than no programming

reef bluff
#

also am I dumb or am I dumb

#

for any tutorial on grappling hooks I see this shlt

#

this does not work cuz the min and max distance is relative to the starting distance

#

so this code is essentially doubling the distance of the grappler and adding lots of leeway

#

is this intentional?

rich adder
#

joy of magic numbers

rich adder
#

times anything < 1 gives you smaller number than original, not double

#

ex. if distance is 3
max Is at 2.4
min is 0.75
add those up and you pretty much get almost 3

#

i guess its trying to do this. W spelling error

reef bluff
#

It’s extra distance, so you are only making the joint longer by setting it

#

That’s why I don’t get it cuz it’s like they didn’t read the documentation and thought it was the length of the rope itself

#

Cuz if that was the case then the code makes sense but it’s not

rich adder
#

i always assumed it was the max length

reef bluff
#

ye I ran into this issue cuz I was trying to make a grappler that retracts

#

so I tried subtracting the maxdistance but that doesn't do anything

#

rn I'm epxerimenting with pulling the anchor position in instead

rich adder
#

I think thats what i did with one of my project

#

I can double check

reef bluff
#

Right now it feels rly robotic

rich adder
#

ahh i was in 2d

reef bluff
#

Ye that has a distance variable

#

Only the 2D one

#

Hella annoying

rich adder
#

it was much easier, all i did to come back up / down was shifting distance

reef bluff
#

Ye I wish it was like that in 3D, oh well I’ll try messing around with the dampening and see if I can make it feel ok

rich adder
#

yeah 3d gets weird..

timber tide
#

bonk

#

x 3

rich adder
#

playing with connected anchor is better than spring amnt

muted gyro
#

and dictionaries are hashmaps

#

thats all u have to know imo

#

(if u know java)

reef bluff
#

I think it’s cuz like the connected anchor is both rotating around the corner and getting closer to the wall and so there’s a huge speed boost there, conservation of momentum blah blah blah…

#

Issue is you can’t limit speed while connected to a joint but I’ll figure something out

rich adder
grand snow
fleet venture
#

How do i scale a parent without also scaling its children?

slender nymph
#

scale the children in the opposite direction or don't make them children of the object being scaled

fleet venture
#

ah okay

#

ty

#

opposite direction worked

#

diff question, how would i make the diagnal scaling work? i want it to scale but keep the ratio the same so always a 1, 1 scale ratio. I got the code working but i cant seem to get the math right to get the distance to the pink thing WITH a sign. i can get the distance but it will never be negative

echo ruin
fleet venture
#

yes

#

i do

#

and i got the code down except for getting like the mouse position relative to the diagnal thing

echo ruin
#

There’s a little chain icon

fleet venture
#

no no

echo ruin
#

Next to X and Y

fleet venture
#

for in the game

#

the horizontal and vertical ones were easy i just did (mousePosition.x - _original.x to get the difference

#

but idk how to get the difference for the diagonal one

echo ruin
#

Oh.. you might have to use .normalize if you want it to adapt the diagonal direction

fleet venture
#

i have gotten a bit of vector math but... ye this is a bit hard

#

XD

fleet venture
#

it sounds easy but idk

grand snow
#

Yea its x + y scale but normalised so its length is still 1

fleet venture
#

ye i know what normalize does

#

ah

#

ok

#

wait so where would i normalize it

#

ah wait i think i get it

#

let me try

#

ok but how do i normalize just a number

#

i dont think i quite understand

#
var scaleX = Mathf.Max(0.1f, _effectedObject.localScale.y * (1 - (mousePosition.y - _original.y) * 0.01f) * Sensitivity);
var scaleY = Mathf.Max(0.1f, _effectedObject.localScale.x * (1 - (mousePosition.x - _original.x) * 0.01f) * Sensitivity);
// normalize this? var scale = ScaleX + ScaleY```
grand snow
#

you cant. you should be constructing a vector2 with the scale to add and normalise THAT

#

transform.localScale + new Vector2(newScaleX, newScaleY).normalized or similar

fleet venture
#

oh

#

thats not how im doing it

#
var scale = Mathf.Max(0.1f, _effectedObject.localScale.x * (1 - (mousePosition.x - _original.x) * 0.01f) * Sensitivity);
_effectedObject.localScale = new Vector3(scale, _effectedObject.localScale.y, 1);
transform.parent.localScale = new Vector3(1 / scale, transform.parent.localScale.y, 1);``` this is my horizontal scaling code
#

im doing it diff

#

ii dont use a vector 2

#

or would i put these scales into a vector?

#

but then the + makes no sense

grand snow
#

its just an example of adding the scale change you wish to apply

fleet venture
#

i dont see how normalizing would help tbh

#

i want this to function the same as the chain icon in unity does

#

normalizing doesnt do that does it?

#

i just want to get the green distance

#

well i should just be able to do this msyelf

#

i can do this

olive charm
#

any tips for making simple inventory system

teal viper
west radish
# olive charm any tips for making simple inventory system

In the simplest form, an inventory is nothing more than list of items, and an integer can be used to set which item you have selected based on its index in the list. Then if you created a UseItem() method, that can find the item thats currently selected, do its activation code, then it can be removed from the list.

As for the item itself, my approach would be to have the item class look something like this

public abstract class Item : MonoBehaviour {
  public abstract void Activate();
}

public class PowerUp : Item {
  public override void Activate() {
    // do the items effect here
  }
}
#

This is only one approach out of an unlimited amount of possible ways to do it. Generally you'd design it based on your own needs, Minecrafts inventory system is very different to Resident Evils. For a really simple system, a list would be ideal

unborn valley
#

perhaps a stupid question, but anyways, why is rb initialized in Start() instead of just off the bat when you declare the variable? eg. why can't i just write
Rigidbody rb = GetComponent<Rigidbody>();

slender nymph
#

you cannot call GetComponent from a field initializer because the object doesn't fully exist at that point

unborn valley
#

ah, makes sense

west radish
#

public Rigidbody rb => GetComponent<Rigidbody>(); this could also work

slender nymph
slender nymph
ivory bobcat
west radish
#

it's a little wasteful as it will run the GetComponent every time you every interact with rb

slender nymph
#

in looks, sure. but in actual functionality it is quite different

unborn valley
#

btw, is there any benefit to using a Capsule Collider instead of a Mesh Collider when dealing with a sort of complex cylindrical object? my friend says mesh colliders are a bit buggy sometimes but idk

ivory bobcat
slender nymph
#

honestly that would be better if you inverted the condition

private Rigidbody rb;
public Rigidbody Rb
{
    get {
        if(!rb)
            rb = GetComponent<Rigidbody>();
        return rb;
    }
}
west radish
#

no braces surrounding the if statements 😔

unborn valley
#

seems a bit overly complicated

#

dunno

west radish
#

what is this, python? 😏

ivory bobcat
west radish
#

yeah, I know

west radish
#

that or you could drag it into the field via the inspector

ivory bobcat
# unborn valley seems a bit overly complicated

Just cache the value once in Start as the above examples would attempt on every call to the property - unnecessary if you're certain the conditions are to never change (the behavior isn't the same as what you had initially)

unborn valley
#

so what you're saying is, that code would be good if you planned to have the rigid body not be active at certain points?

#

sorry about my ignorance lol

ivory bobcat
unborn valley
#

right

#

thanks

novel void
#

Hi! This is a question about hub/editor but I didn't see a channel to post about those, feel free to direct me if there's a better place.

I am having an issue with Unity Hub not launching any editor version on Debian 12 Bookworm. The loading icon appears for about a millisecond and then nothing happens. There is no error recorded in the hub log or editor log. Anyone familiar with Debian that could assist? Unity support has not responded after more than a week and I have followed all instructions I could find across the entire first three pages of Google search as well as a ton of unity forums posts none of which have helped solve the issue. I have made sure all depencies (that I could find) are installed.

Apologies if general questions aren't allowed or if there's a better channel for this question. Thanks.

novel void
#

Yes. Unity Hub runs and adding installs for 2019 (from archive), 2021, and Unity 6 appear to install but existing and new projects do not launch with any editor version selected

astral falcon
#

Can you try to run them from terminal and see if you can get any logs?

novel void
#

I will paste the result (very long). One second.

astral falcon
#

use something like !code

eternal falconBOT
novel void
#

I also have tried adding windows build support (current platform for all the projects I tried) as well as installing and switching to linux build support, neither of which makes a difference over default options.

astral falcon
#

I think, the "env is not defined, current application is not an AppImage" is important. Something like a wrong installation of unity, when it comes to env, but thats just guesses

#

But Id say, its not a unity issue but more a os issue

novel void
#

I ran the commands to install unity hub as defined in the instructions you linked above, those commands send no feedback when ran other than installing unityhub apt

novel void
#

I'll keep searching around. I also tried asking the debian discord although that community is rather small and nobody there is a unity dev it seems

astral falcon
#

It would rather not include the unity part and search for debian directly related issues.

ivory bobcat
#

Yeah, those look to be OS specific errors. Have you tried asking the Debian discord server?

astral falcon
#

"vaapi_video_decoder.cc(1206)] failed Initialize()ing the frame pool" , there is def. more going on than just unity not working

#

Maybe unity just does not work on your system because of missing hardware support?

novel void
#

i get that error running any software through terminal, though unity is the only one i'm having any trouble with, oddly

#

blender, gimp for example

novel void
astral falcon
#

You get an error 😄

novel void
#

through terminal

#

i'll see if fixing that one also resolves hub. It's another lead I suppose, thanks

ivory bobcat
novel void
#

it's fine that unityhub is not an appimage then?

#

i guess that wouldnt affect editor since it's separate executable

ivory bobcat
#

Search online for a Debian discord server and they'll be able to give you better advices

void dawn
#

Can someone help me with enemy ai for my fps game

Right now I'm struggling with making ai for my game , I tried making a zombie enemy that the player can shoot but even after I set everything up he just stays in the air statically even tho I added animations , rigbody , navmesh , a dedicated script

And no Im not asking for you to code for me , I just want you to help me understand what I'm doing so I struggle less

I wanna make a enemy that can shoot the player too but I'm not sure how to do it

Can anyone please help

ivory bobcat
novel void
astral falcon
#

!code

eternal falconBOT
astral falcon
#

Its fine here, just show your script

void dawn
#

here

polar acorn
polar acorn
void dawn
#

Well it should move when the player is close to him , but he doesn't for some reason

polar acorn
#

Okay, but is it actually executing that function

olive galleon
#

Hi, I recently started using GitHub and when I pushed from my Laptop to make changes and fetched it on my PC, when I try to save it opens up my file explorer and wants me to save a unity type file, but there aren't any issues when I save on my Laptop. Also, when I created assets like sprites on my laptop and committed the changes, the assets and sprites were gone, the only thing that I was able to get were the scripts I created.

void dawn
#

no wait i was able to fix it

#

now its moving

#

the problem he isnt playing animations and is walking backwards

wintry quarry
grand snow
#

Hopefully they are using github desktop (I hear some try to use the web interface to upload files 😐 )

rocky canyon
#

i do that all the time for readme's and text files and whatnot😛

#

just gotta remember to pull it

fleet venture
#

Quaternion.FromToRotation((Vector2)_original, (Vector2)mousePosition).eulerAngles Is this not how to get the angle between 2 vectors?

#

i want the angle between 2 vectors in 2D

#

but htis just does weird stuff

rocky canyon
#

wouldnt that just be Dot Product?

wintry quarry
#

direction vectors?

fleet venture
#

Vector 2

wintry quarry
#

euler angles?

fleet venture
#

uh ye

#

nah

wintry quarry
#

position vectors?

#

which one

fleet venture
#

they are positions

rocky canyon
#

float angle = Vector2.SignedAngle(_original, mousePosition);?

wintry quarry
#

there is no such thing as an angle between two positions

fleet venture
#

but currently the object is at 0 0 0

#

there is tho

#

the object is at 0 0 0

wintry quarry
#

You need a third position to act a s a pivot to rotate around

rocky canyon
#

theres a direction

wintry quarry
#

so is your third position 0?

fleet venture
#

i mean they pretty much are direction vectors at this point arent they?

#

bc its at 0 0 0

wintry quarry
#

then yes say taht

#

but you need to subtract the third position from each to make them into direction vectors

#

in this case if it's 0 that's a no op

fleet venture
#

its 2D

wintry quarry
#

and then to get the angle between them you use Vector3.SignedAngle

#

or Vector3.Angle

fleet venture
#

ah

rocky canyon
#
float angle = Vector2.SignedAngle(Vector2.right, direction);```
#

i got confused tho.. cuz i was thinking just direction?

fleet venture
#

to get the direction dont i only like have to subtract

rocky canyon
#

yessir

#
Vector2 direction = mousePosition - _original;```
fleet venture
#

ye

rocky canyon
#

there - here

#

ur mousePosition should be converted to world-position tho for that to be accurate correct?

#

b/c mousePosition is pixel coordinates

#

Without converting, you'll get nonsense results when subtracting.

#

Vector2 worldMousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); ftw? idk

fleet venture
#

idk its still weird im doing stuff wrong

#

let me show the full code

#
var mousePosition = _mainCamera.ScreenToWorldPoint(Input.mousePosition);
_effectedObject.rotation = Quaternion.Euler(0, 0, _originalRotation.eulerAngles.z + Vector2.SignedAngle(_original, mousePosition));```
rocky canyon
#

most likely..
got ur spaces confused i bet

fleet venture
#

ye i dont fully know what im doing

rocky canyon
#

You're trying to rotate an object based on the angle between _original and mousePosition, but _original and mousePosition are positions, not directions.

fleet venture
#

im trying to get this rotation circle to work btw

fleet venture
#

right?

rocky canyon
#
var mouseWorldPos = _mainCamera.ScreenToWorldPoint(Input.mousePosition);
var direction = (Vector2)(mouseWorldPos - _effectedObject.position); // get dir

float angle = Vector2.SignedAngle(_original, direction); // angle between OG dir and new dir
_effectedObject.rotation = Quaternion.Euler(0, 0, _originalRotation.eulerAngles.z + angle); //apply rotation```
fleet venture
#
    var mousePosition = _mainCamera.ScreenToWorldPoint(Input.mousePosition);
    _effectedObject.rotation = Quaternion.Euler(0, 0, _originalRotation.eulerAngles.z + Vector2.SignedAngle(_original - transform.parent.position, mousePosition - transform.parent.position));
   ``` thats the same as this right?
rocky canyon
#

something like this feels like what i think ur trying to do.. but im not 💯 on that.. tryitandsee

fleet venture
#

ye it is i think

#

i still dont think it will work

rocky canyon
#

no its not the same

fleet venture
#

nvm it does

#

even if its not the same my solution does work so thats interesting

rocky canyon
#

you’re subtracting from the parent's position for both _original and mousePosition, which implies that you're treating those positions as relative to the parent.

fleet venture
rocky canyon
#

If _original is in world coordinates, the code you wrote converts everything to be relative to the parent position before calculating the angle..

rocky canyon
#

lol

#

if thats the case the subtraction makes sense

fleet venture
#

ye it seems to work well

twilit stirrup
#

Boiz, i need help, i got some code that disables a game object and then enables another game object, but when i do this mid animation, when i then switch back, it holds the item in the position and rotation from where the animtion left off, is there another way to disable a object or restart the animation somehow?

rugged beacon
#

i have this prefab with a preplaced table and multiple chair points in the image, im trying to execute this script for random chairs stuff after this prefab is generated onto the game. the chair gen script called by Start() dont know if this problem. no error.
here the script code if that helps:

    [SerializeField] private List<GameObject> singleChairs = new List<GameObject>();
    [SerializeField] private List<GameObject> longChairs = new List<GameObject>();
    // Start is called once before the first execution of Update after the MonoBehaviour is created
    void Start()
    {
        List<GameObject> chairsPoint = getChildren(this.transform);
        List<GameObject> pointChildren = new List<GameObject>();
        foreach(GameObject point in chairsPoint)
        {
            if(point.transform.childCount > 0)
            {
                if(Utility.UnseededRng(0,100) < 50)
                {
                    pointChildren = getChildren(point.transform);
                    foreach(GameObject chair in pointChildren)
                    {
                        Instantiate(singleChairs[Utility.UnseededRng(0, singleChairs.Count)]);
                    }
                } else {
                    Instantiate(longChairs[Utility.UnseededRng(0, longChairs.Count)]);
                }
            } else {
                Instantiate(singleChairs[Utility.UnseededRng(0, singleChairs.Count)]);
            }
        }

    }

    private List<GameObject> getChildren(Transform transform)
    {
        List<GameObject> children = new();
        foreach(Transform child in transform)
        {
            children.Add(child.gameObject);
        }
        return children;
    } ```
grand snow
rugged beacon
#

yea i forgor to set the position fr

#

got it

rocky canyon
#

you'll probably need to do something similar

grand snow
rugged beacon
#

i thought thats better

rocky canyon
#

Disable();

ResetStuff();
ThenReEnable();

rugged beacon
#

performance wise

grand snow
rocky canyon
#

its always going to have a position and rotation when it spawns..
ur not changing anything performance-wise by setting those values..
thats why they come as parameters of the instantiation method

twilit stirrup
grand snow
# rugged beacon performance wise

its more work to allocate a list, grow it and find and add a transforms children vs them just being configured already as serialized vars

rugged beacon
#

make sense

rocky canyon
#

its always better to use a collection thats pre-allocated correct?

twilit stirrup
rocky canyon
#

say 10-20+ indices more than what u expect to have

#

that way ur never changing it

#

<insert question mark>

grand snow
#

Here the problem is the lists are temporary so they will get GC'd later.
Its also ALWAYS better to set the start capacity for a list upon creation (then you avoid re allocation to grow the list to fit the stuff you want)

twilit stirrup
rocky canyon
rocky canyon
twilit stirrup
olive galleon
hexed terrace
#

google -> unity gitignore -> the first result is what you want

grand snow
#

just use this instead and ignore whatever he said

#

download and rename/replace existing .gitignore

eternal needle
#

When you create the repo, you can also just choose the option to use the unity gitignore. Assuming this is the same as linked above

rocky canyon
#

don't tell people to ignore others..

grand snow
#

bit late for that isnt it 😆

eternal needle
#

in which case its valid

rocky canyon
#

ohh.. if thats the case.. i retract my statement

grand snow
#

and they probably made the repo locally first but good to learn how to update the gitignore yourself.

#

Yea i just mean its best to not try to copy something like that from a video (i dont know what brackeys said in his videos i dont watch em really)
Better to know how to get a good git ignore yourself

rugged beacon
#

whats with brackey

hexed terrace
rocky canyon
#

for (1) he's been deprecated..

rugged beacon
#

i seen majority advise me to go watch him, geniune question

rocky canyon
#

no support.. unless ur using Gadot

rocky canyon
#

brackeys starts people out on a really bad path

hexed terrace
grand snow
#

I remember learning from quill18creates like 10+ years ago now 😐

rocky canyon
#

quill is tenfold better than brackeys

#

brackeys was for entertainment..

#

its not horrible.. u can still learn from him..
but you'll have to back-track and refactor ur code once u realize some of the silly things he does

eternal needle
# rugged beacon whats with brackey

theres a lot wrong. if you search for what i wrote about him in the past you can see more messages but TLDR is
his videos worked ONLY for the purpose of the demonstration. Information was wrong or misleading. It's quick and popular meaning lots of newbies will watch it and like/comment. you can seemingly setup a feature quickly, but this feature cant be extended upon because the code is usually shit

rocky canyon
eternal needle
#

the same of what i said goes for a lot of content creators, ideally you should use videos to find out what exists or what method people might use to do XYZ. Then go implement it yourself

rocky canyon
#

thats all.. my alternative brackeys list

#

i couldnt agree with bawsi more..

#

nothing wrong with using unity tutorials to expose urself to the material..

#

to see whats out there.. and see some common work-flows

#

then as SOON as u feel able.. branch off.. and learn ur own.. (at that point u know what u want.. and what u want to do)

#

no reason to not go hands-on.. and learn specifics from Documentation, the manual, Unity Sources, stackoverflow, the discussions etc

rugged beacon
#

i havent stick with one channel, im not really picky just trying one vid doing similiar thing i wanted fr

rocky canyon
#

with just a few videos he made it spread like wild-fire

#

and now we have posts like this lmao

#

and bad lerps.. i forgot about that one

eternal needle
# rocky canyon https://www.youtube.com/@LlamAcademy/videos this guy is decent

i found some of his stuff a bit questionable honestly. not here to say people shouldnt watch him, but it was a hassle for me to sit through his videos. I watched a bit of his AI series. You couldnt make changes to suit your own system or you wouldn't be able to follow along. Also i felt a lot of stuff wouldnt be suitable for an actual game, like for example using navmesh agent movement then toggling a rb purely to deal with knockback.

rugged beacon
#

bad practices i can forgive but dang, straight up wrong info ?

rocky canyon
#

ohh 💯 thats why i used the descriptor of "decent" 😅

rocky canyon
#

but ppl come in here atleast once a day.. w/ that 1 bad line of code..

#

and its instant recognition.. "you're following brackeys aren't you"

rocky canyon
# eternal needle i found some of his stuff a bit questionable honestly. not here to say people sh...

lot of the younger crowd tend to like his format.. i personally have only watched 1 or 2 videos of his..
but they seem decent.. "no obnoxious keyboard banging" .. "no long monologes or irrelevant B-roll",
no extra Utilities to download to follow along, No "Studies" that leave you on a cliffhanger (sebastian)
usually straight to the point.. and his mathing seems to math correctly most times.. but i see what ur saying

rugged beacon
#

what about coding train ? i thought higly of him when im looking for complex stuff

rocky canyon
#

lmao.

rugged beacon
#

fr

rocky canyon
eternal needle
rocky canyon
rocky canyon
#

but i can see it being pretty informative to beginners

#

lol tutorial overload 😅

rugged beacon
#

dont think i can rember these names when i looking for that one function for tutorial fr

rocky canyon
#

the SO comment

rocky canyon
rugged beacon
#

most stuff im looking for are procedural generation stuff with code review, they seem scarce so i havent been picky at all

rocky canyon
#

never hurts to have too many resources

#

Sebastian Lague is really good w/ that procedural stuff

#

but he does those "studies"

rugged beacon
#

yea i watch that one 3d

rocky canyon
#

they're really not tutorials..

rugged beacon
#

but yea im doing 2d tilemap

eternal needle
rocky canyon
#

Unity Documentation is where its at!

rugged beacon
#

document from what i understand is where you go when you dont understand some built in function?
but stuff like generated stuff, algorithim, how to implement it,.. shouldnt be there ?

rocky canyon
#

yea. ur correct.. methods you'll use will be documented.

#

but you'll have to rabbit-hole ur way there.. for stuff like that

eternal needle
gleaming wagon
#

Hello, I was wondering if somebody has any idea on how to make a TMP text that can interact with colliders. Like in MiSide where the text falls and collides with stuff after being displayed. Any ideas?

#

Here is a better example:

rocky canyon
gleaming wagon
fickle plume
#

There's 3D TMP as well

gleaming wagon
#

Its not the text I am struggling with its the effect

fickle plume
#

TMP creator has extensive YouTube tutorials, from before asset was bought

rocky canyon
#

but knowing theres a 3D element for text.. should fuel ur search

gleaming wagon
# rocky canyon

Alright thanks, still this solution works for whole sentences not individual letters or even words.

#

Unless I were to make a mesh for each letter

rocky canyon
#

you may need to..

#

can't say for sure.. but you'll figure that out as u go

#

🍀 good luck 🙂

gleaming wagon
#

Alright thanks

rocky canyon
twilit stirrup
rocky canyon
#

Prefab -> Empty letter w/ rigidbody and box collider
Spawn Letter -> Change Letter -> Space Letter -> Repeat

twilit stirrup
rocky canyon
#

awesome!! glad we can help (them moreso than me) lol

gleaming wagon
twilit stirrup
rocky canyon
# gleaming wagon Oh wow

i could probably add a bit of an irregular shape as the collider to have them do more things when they fall

#

right now its just boring box

gleaming wagon
rocky canyon
#

i'll more than happy share the code that does that ^ but not sure if its helpful

rocky canyon
gleaming wagon
#

Oh so the prefab is just the mesh for each letter and we write the text after

rocky canyon
#

with a box collider and a rigidbody..
when i spawn it.. i take the first letter of the string and set that
then we spawn the next one..

gleaming wagon
#

ahh

rocky canyon
#

and se thtat

rocky canyon
#

the only thing i want to note... is right now its just using the transform of w/e SpawnText.cs is attached to..

gleaming wagon
#

Alright thanks, I will lyk if I get it to work

rocky canyon
#

u can change that how-ever u want. or even use custom positions

#

and letterspacing is just how wide the char is for the tmp

#

i tried testing w/ a mesh-collider so each letter had the actual edges of the letter.. but its not like a normal
mesh where i can drag in the same mesh that the mesh-filter uses.. not sure exactly how TMP does the meshing...
that'd be cool to have each letter w/ its own mesh.. so what i did is hacky.. since its only using boxes/squares
i'll try reading up on it myself when i get free-time to maybe figure out how it works

gleaming wagon
#

Okay I got it to work! Not working with the dialogue system rn but the text is colliding I just gotta implement it now. Thanks!!

gleaming wagon
rocky canyon
#

nice

grand snow
#

I presume miside actually just does some non physics animation to move the characters as you can modify the mesh per character

naive pawn
grand snow
#

I presumed it was a ray cast down and an anim 🤔 let me watch the vid again

naive pawn
#

oh that's true they don't move horizontally that much in the vids. i haven't played so im not too sure myself

#

ill try finding clips where there's more objects around the text

grand snow
#

i've not played just watched some gameplay. But its probably what I would do for a fun effect.
You can already modify the mesh on creation to do the text fade in effect easily and pretty sure you can change the verticies of characters so should be doable

red igloo
#

I don't really like how the player can easily pick up the object and jump around. I don't want to freeze the objects constraints. I just want it so the object isn't easily flipped/tossed around. I played with the mass and its not what im looking for.

https://paste.ofcode.org/d7HTXrV7zNx349aqjmN79V

https://streamable.com/0hrbwr

Watch "ShootBallGame - Level 0 - Windows, Mac, Linux - Unity 2022.3.26f1_ DX11 2025-02-13 18-13-53" on Streamable.

▶ Play video
wintry quarry
#

because you're directly assigning velocity, it will be able to overcome any mass

#

If you want it to behave realistically you need to switch to moving via forces

#

or manually reduce the velocity you assign based on the mass of any object you're holding

nimble cliff
#

if we place a Resources folder inside an Editor folder, does the Resources folder will be only available in the editor ( and not at runtime / build ) ?

brittle isle
#

I'm beginning to wonder how to include secondary entrances and exits from one scene into the other for the Unity platformer project.

grand snow
cosmic quail
grand snow
nimble cliff
#

I will just rename it _Resources 😄

#

ho no .. I think _ on folder hide them or something 😄

#

lets go for Data

wintry quarry
#

Color uses values 0-1

#

not 0-255

#

if you want to use 0-255 use Color32

vapid ledge
#

damn that was simple ty

#

have no idea why it worked with most of my other uses though

naive pawn
wintry quarry
#

you did something different

polar acorn
#

No, you didn't

#

Color has always been 0-1, in every version of Unity

vapid ledge
#

thanks for the help

random sorrel
#

Hello. I have added a First Person Camera Controller from Starter assets. ESC key is bound to show or hide cursor. But even when hit ESC key to release cursor, camera still traces position of cursor, which is undesirable. I have found that the highlighted parameter controls such behavior, but it does not get deactivated when I hit ESC key. How do I actually force de-activate it (and then re-activate it once player clicks screen)?

wintry quarry
random sorrel
#

I think, after user presses ESC application does necessarily loose focus, it still stays foreground

OnApplicationFocus is called when the application loses or gains focus. Alt-tabbing or Cmd-tabbing can take focus away from the Unity application to another desktop application. This causes the GameObjects to receive an OnApplicationFocus call with the argument set to false. When the user switches back to the Unity application, the GameObjects receive an OnApplicationFocus call with the argument set to true.

wintry quarry
# random sorrel I think, after user presses ESC application does necessarily loose focus, it sti...

Note: If the Editor is in Play mode, OnApplicationFocus is called when the Game view loses or gains focus. If an external application (meaning an application other than Unity) has focus, and you click a different Editor tab, ::OnApplicationFocus is called twice in one frame. The first time, OnApplicationFocus is called with hasFocus set to true because the Game view regains focus when Unity regains focus. The second time, OnApplicationFocus is called with hasFocus set to false because the Game view loses focus to the Editor tab that was clicked.

random sorrel
#

chaotic

rocky canyon
# random sorrel Hello. I have added a First Person Camera Controller from Starter assets. ESC ke...

usually i'll go in and strip out all the cursor lock stuff and make it my own Manager of sorts that all scripts can access (simple singleton)..

that way all scripts are doing thru that 1 master script and not getting all the stuff all complicated..
you get two or three assets that all have cursor functionallity and it gets kinda crazy..
in some cases it becomes like a state machine

  • Cursor Locked and Hidden (Moveable) (character controls as normal)
  • Cursor Unlocked and Visible (Not-Moveable) (character is locked, is navigating menus or something)
#

MasterMouse 🖱️ lol

#

I didn't even know about the Cursor.lockState = CursorLockMode.Confined; until the other day.. took 4 years to find it 😄

earnest wind
#

im cooked

#

i honestly dont understand what ive done wrong anymore

#

when changing a slider value, it changes the color for eveything

#

give me a second i will upload how it works

wintry quarry
earnest wind
#

let me show how it works

wintry quarry
#

That would be helpful.

#

But "it worked before and doesn't now" doesn't really preclude anything

earnest wind
earnest wind
#

ok

#

Thread

rocky canyon
#

cool name

sterile radish
#

why is unity giving me an nre even though ive referenced the object im trying to change?

polar acorn
#

What is SettingsUI line 13

sterile radish
polar acorn
#

Try logging both and find out which

sterile radish
#

okay ive logged both and its saying the gamemanager is null but im unsure as to how

polar acorn
#

Well, where do you set GameManager.instance?

sterile radish
#

in the awake method because ive made it a singleton

    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        UpdateUI();
    }
polar acorn
sterile radish
#

OnEnable (for its own object)

polar acorn
#

So, this script is executing before GameManager.

#

By default, the order scripts are executed in is essentially random. You can set the script execution order, but the usual better way to do it is to just redesign the code so there aren't race conditions. Like moving this text setting to Start instead

alpine gyro
#

I wanted to rotate a prefab by 180 and than save it...
ChatGPT told me there is an override but either I am very stupid or its chatgpt?
[sorry to crush into this conversation]

polar acorn
#

Are you actually editing a prefab?

polar acorn
#

Or an instance of a prefab in the scene? Or an object that isn't a prefab at all?

sterile radish
polar acorn
# sterile radish ohh okay, i didn't know that thanks for the help!

Script execution order will basically pick a script, run its Awake, then run it's OnEnable, then move on to the next script in the line. When it hits the end, it goes back to the front of the line then does everyone's Start functions. Awake and OnEnable are basically at the same "priority", so the order is only for when they're both in the same script

rocky canyon
# rocky canyon

if ur editing a prefab within the prefab [Prefab Mode] there is no Override.. b/c ur actually changing the OG prefab
if ur editing an instance of a prefab within the scene there is an override.. b/c ur editing a version of the OG so applying Overrides -> overrides the OG w/ the new values

alpine gyro
#

Looks like im to stupid?!

rocky canyon
#

thats the prefab the OG.

#

there is no override there.. (ur changing the OG)..
ud only see override if u drag it into the scene and Change that version

polar acorn
rocky canyon
#

its got some VC clutter

polar acorn
#

Ah, is that what it is?

rocky canyon
#

im thinking.. with Check-in and Added

polar acorn
#

Yeah, there would be an overrides dropdown where it has that "check-in" button if you were editing an instance of the prefab

alpine gyro
#

added does not do anything and check-in is version control

polar acorn
#

Yeah, those are unrelated, I've just never seen them before

alpine gyro
#

so at least Its not my fault 😄

rocky canyon
polar acorn
#

So I wasn't sure if it was a custom inspector

rocky canyon
#

no. ours look the same.. if i select the prefab from the project window..

#

same as urs

#

think of the prefabs like this:
prefabs in your project window -> the "Original Versions" of all the Files (Like the Library of all the parts your game has)
your hierarchy -> copies of the "Original Versions" (Copies of the parts you've chosen to load from project into the current scene)

alpine gyro
rocky canyon
#

👍 exactly

alpine gyro
#

so but my problem was i wanted to turn the object by 180* and than save it. Looks like this is the only change you can make without getting that revert/apply :d

earnest wind
#

@polar acorn and @wintry quarry ....
I just playtested everything and i found the problem, it only happens when i Duplicate (a function i made), and then i change the colors or positions, its as it has linked somehow...
https://pastebin.com/TSLNQqYx
If you could see any ways that i did something wrong then please help me 😭
this is how component data works, its on every script, and when duplicating is just instantiates a object from this list (2nd image)

rocky canyon
#

if u want it to matter then u'd nest a gameobject 1 level down.. and rotate that instead..

alpine gyro
#

yeah but i wanted to avoid that

#

than i rather add some stupid "rotation offset" to the code X_x 😄