#💻┃code-beginner
1 messages · Page 602 of 1
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
Ah no gifs.
no thats not what im looking for
no joints.. or anything else
since my game is at a side view
idk i tried joint and works
I will show you what im going for hold on
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
@rocky canyon
Watch "ShootBallGame - Level 0 - Windows, Mac, Linux - Unity 2022.3.26f1_ DX11 2025-02-12 19-03-17" on Streamable.
There’s 100 solutions to everything.
yessir
I was looking for something like this
how did you make this ?
ohh okay i see
thats pretty fun lookin lmao
like that pick-axe climber game
w/ the offset mass
It reminds me of Little Big Planet more.
I just but the object in the fixed joint thats it
thats what I was going for lmao
my fav game
so thats a fixed joint
just gotta refine it a bit
I had good times on it back in the day. You ever play the one with the whale and the boat?
I hate sony for killing sackboy and replacing it with a shitty white blue eyed robot
little big planet 1 was peak
lmao the way ur character leans backwards
i bought a ps3 just for it
PEAK
thats epic
*lean back * lean back *
the servers for both 1 and 2 are up with loads of players
custom servers on their discord
They don’t make children’s games like they used to.
i got news for you...
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...
To be announced
the old devs are making their own
blasphemy how dare you call LBP a children game lol
Better watch out how you talk about PEAK
any ways should I not use fixed joint?
one person is saying yes the other no
just like you see here this is EXACLY how I want it but I want the button to grab it E
Are you using the input system or just doing it the old fashioned way?
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
Can you be more specific? Cause like a mini game is just a simple game. Like how are you implementing mini games?
It's the same as creating a feature. you just build it and activate it when necessary . . .
old input system
also how do i get rid of a background
Pwease? lol.
should I use a ray cast to check if the object has the "Pull" tag? The objects that I want to pull are tagged Pull
Looking at the documentation it looks like you need to use the fixed joint. I think that’s what Nav used in their video. https://docs.unity3d.com/2020.1/Documentation/Manual/class-FixedJoint.html
I can’t give you any examples right now cause I’m on my phone but they seem simple to use. If you read up on its documentation or watch a youtube video you will be able to learn how to implement it.
Yeah that sounds good.
Thats what im doing im going to use fixed joint
should I cast it on all sides of the player?
u could.. or u could put it w/e side it needs to be on
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.
I might be missing something, but why Raycasting? why not simple colliders?
Oh yeah I know, I'm not sure where or what to look for. lol.
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
Okay, yeah, was just a little confused is all. lol. And yeah, that makes sense.
You won’t believe what I just found.
In this tutorial students will learn about the parabola formed by projectile motion and use physics calculations to start programming an automatic attacking tank. Next, students will complete the programming of the AI tank by adding Unity physics back on the shells and automatically controlling when the tank shoots through code.
Hmmm ?
Dude, I haven't been to high school in 32 years and not done that stuff since then. lol.
guys how do i add a memory game
This tutorial sounds like exactly what you’re looking for.
who
The purple guy.
Yeah I'm looking through it now, thank you. I wasn't sure on what to search for mainly. lol.
ok
I don’t know what you have in mind but all you have to do is come up with some random values and save it and if the player is able to input those same values then they win.
how i no clue how do that
https://www.youtube.com/watch?v=ZCWUJEVnd08
First google result.
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...
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 . . .
when I use fixed joint why can't my player move?
is that 3D
Also, there are tons of tutorials online for how to make this type of game. pick one and give it a try . . .
No idea, but memory games are pretty much all about the coding, the visuals are the easy part.
its not just starting with the memory game im getting it so you go throught it whlie playing
How much programming do you know?
i started like 2 days ago so like 0.0001
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.
Is there any point to profiling in the editor? My script runs like 4x faster in build
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
What is a patton bored?
You profile when you come across optimization problems, or when you want to test which solution saves time (faster) or uses less memory . . .
what they need to press like yellow,purple,green
I'm a unity and C# noob, but for example in C++ you never profile in debug builds, because they are slower
Maybe it's just my project, but it seems like running in the editor is always slower, making profiling results invalid
when I use a fixed joint why cant I move?
not sure.. is it anchored to anyhing static?
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
His ball moves by rotating I think so maybe it’s because the box is stopping its rotation.
My gut tells me no.
But maybe.
I don’t know.
It is slower because the editor is open to display the scene and inspector. Build will (should) always be faster, but you can still compare results, especially when attempting to eliminate gc allocs. Creating a build to run and constantly test that—and other perf issues—wastes a lot of time . . .
what box?
Watch "ShootBallGame - Level 0 - Windows, Mac, Linux - Unity 2022.3.26f1_ DX11 2025-02-12 19-44-49" on Streamable.
literally cannot move
put the ball into the connected RIgidbodySlot
it wont let me
why would I put the player in there?
I'm specifially measureing the time for a pathfinding method, at it goes from 10ms in the editor to ~3ms in build though
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
it wont let me put it in the slot
did you do anything on the rigidbody
of the player?
ya
nope
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 😦
That's good. I definitely would check for the speed in the editor and game. If you don't see an issue on the build, you're fine, but if you want to make it faster or produce less gc, you have a base speed of 10 ms to compare to . . .
oh thats weird
I believe there are some online websites that will display the IL instructions. I wouldn't be surprised if there was a method to do so from Unity . . .
why does the 2D one work but not this one??
maybe because I add it at runtime I didnt notice
it DIDNT at first if u watch
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
yoo @rocky canyon
b/c it gives an error
@red igloo, hello
why doesnt mine work?
are u trying to add the Player -> the same object the rigidbody is on?
what's up @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
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;
}
}
}
}```
^ see it takes a little hands-on
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
That's good. I definitely would check
ngl this mechanic is kinda smooth
raycast good too, i just got lazy and did a catch-all sphere xD
probably not the best if you got rigidbodies above yourhead..
BRO this is soo confusing why can't I move??
did you remove the fixed joint?
I even restarted unity to see if it worked
yes then I added it back still does not work
process of elimination, start disabling / enabling stuff to see
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 ^
it doesn't allow u to move with an empty joint..
it basically locks u onto the ground
what? so I should only enable it when I press e on the box?
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
alright I will just only enable it when I pull objects then
ya, i think its just a weird quirk of the physics engine
im back
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
mine doesnt but only because the original is not a rigidbody but cc
i think
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
ahh yeae thats y i tested with my 2d project b/c it uses rigidbody physics
idk i had fixed joint on moving objects b4 but didnt affect their movement but that was transform movement btw
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
nah yeah you dont wanna put your own rigidbody in the slot itself lol
teleport at its finest
thats how my Physics Pickup mechanic i showed off earlier works
🤫 dont tell anyone
it works pretty well even against walls and stuff
hey does anyone know how to fix "failed clustering job" when baking lights in unity? im using HDRP
so until it doesn't imma keep it lol
the FixedJoint does not have an enabled property so how would I enable/disable?
thanks
mate.
did you verify thats the issue tho
did you move object without it
without the fixed joint?
yes I can move the object around without fixed joint but when I add it back I can no longer move
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
or springJoint.spring = 0;
springJoint.damper = 0; might be able to set ur spring to 0
either way its better to add it via code
id try that anyway if ur locked while movement.. it may be a work-around
runtime addcomponent should work out tbh
imma open my 3d rigidbody project
this way you know exactly when something is picked up too. #💻┃code-beginner message
easy drop and pickup mechanic in a few extra lines
ya, adding and removing the entire component makes sense tbh
now im interested in why 2D joint has .enabled but 3D doesnt
Because Unity.
i mean.. ur not wrong lol
Can’t wait for 4D joints.
(╯°□°)╯︵ ┻━┻
Then 5D joints with multiversal time travel. I heard unreal has those.
2D kinematics have velocity and can move with it, Rigidbody3d cannot
yup that tracks
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
what exactly are we supposed to do with this image dude
You really have to go and learn the basics man.
how idk how too
you mean animated? if so i'd recommend a package like dotween or leantween
you aint reading what i said
easier to manage
thats why its called Learning
i want to make it like a menmory one not animted
public GameObject urThingUWantToDisable;
urThingUWantToDsiable.SetActive(false);```
like a memory one and not animated, what that even mean..
i want to make an memory minigame
you'll probably need a gamemanager.. keeping up with states..
i'd check the basics if i were you
you want to make a minigame when you can't even make the entire game
otherwise you won't be able to explain what your problem is
- Move has begun
- Move in progress
- Move Finished
then when MoveFinished -> disable the gameobject or UI/Image or w/e it is
yeah 🙂
what basic
unity and coding basics
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.
how? you need to understand basic concepts like state tracking, and references to store objects in variables to compare
videos yeah there is none
yeah
What do you mean?
cant tell if youre trolling or not at this point
my routine playlist drop: https://www.youtube.com/watch?v=_cCGBMmMOFw
yeah what? until you learn those explaining anything else will be useless
basics ^
idk what to say
i meant the edited
go learn the basics then come back
idk what to tell you . I don't got time to babysit. see ya
how there is none to learn when i dont have a video
Free tutorials, courses, and guided pathways for mastering real-time 3D development skills to make video games, VR, AR, and more.
plenty of videos there
You have Google yes?
Essentials -> Junior etc.
this
correct
ok
this will get you familiar with the basics
then check out https://learn.unity.com/project/beginner-gameplay-scripting after
Is this script good?
did you try it
yes it works
looks ok script wise
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
if you send an clientRPC it will move clients
unless you target a specific playerId
also #archived-networking
ok thanks ill give it a go again
cause normally you send a ServerRPC
ServerRPC is telling the server " I want to run this code"
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.
its vastly more diffcult to add networking mid-project / after the fact yes
from my experience it is hard but this has helped https://www.youtube.com/watch?v=3yuBOB3VrCk
❤ Watch my FREE Complete Multiplayer Course https://www.youtube.com/watch?v=YmUnXsOp_t0
🌍 Get my Complete Courses! ✅ https://unitycodemonkey.com/courses
👇 Click on Show More
🎮 Get my Steam Games https://unitycodemonkey.com/gamebundle
Quantum Console https://assetstore.unity.com/packages/tools/utilities/quantum-console-211046?aid=1101l96nj&pubre...
building for a planned multiplayer scenario is much easier
ehhh not the greatest
Well whatever doesn’t kill me will make me stronger. 🤷♂️
if you recommend something else id be very happy
the netcode documentation is surprisingly very good
the example projects need work, things like boss room are good but they are far too complex
If I had a nickel for every time someone told me not to use Code Monkey/Youtuber tutorials in a Discord I’d have a good chunk change.
well yeah there is a reason for that..
I just joined this one today though but the people in the Unity Developer Community Discord have told me that.
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
im trying for example from the host to press T for example which would affect the movement of a client giving a boost or smth and the same in reverse
so would serverRPC be better, or would i need both to send inputs both ways around
Yeah I noticed that except dev log videos, a lot of game dev videos want you to buy their course.
well Id use a network variable there so I'd use serverRPC to get server to change my value
how do I make slippery slopes? so when I go on it my ball rolls down
correct. They whore themselves out... I just make mine for fun when I can and just enjoy someone learning a new thing as I have
Probably just change the drag values on the Rigidbody when your on the slope. Or you can apply opposite force.
You'd probably need to raycast the normal of the surface you're on, and do some extra math there with it applying extra force down
physics materials can help here too
I forgot about those.
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
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.
I can appreciate a few like llamacademy
Jason Weimann was also good too
I learned a lot from him when i started
git-amend is someone I recently also enjoy some of their content
I bet the jokes were there in his team
we gonna send this to JSON
oh wimann ?
nahhh like actual Text json
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.
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
wouldnt it be easier to have preset UI images instead?
then just switch the sprite with whatever card you select
ohh gameplay in the Canvas 👀 . that oughta be fun
i stick with SpriteRenderers and World-space with ortho cam for gameplay
assigning the correct positions w/ recttransforms be a headache
nightmares.. 
switch canvases oh what a nightmare.. parenting
yea.. i felt the same
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
UI should be for displaying Information to the player..
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?
u instantly complicate things when u make UI/Canvas part of the gameplay loop
i see
Tsk tsk tsk
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?
multiple canvas sounds like hell
I mean it was making sense right up until now lol
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
A manager does deal with them
its is but sometimes necessary
you make a list with all the cards youre currently holding
and a list with all the empty slots on the board
There's a Game manager object/script that controls most things, such as the list that you just mentioned
theres pro's and con's to both solutions..
thats good then
as always 😭 theres not just 1 way lol
tbh the only reason why I use UI is because it scales with Screen
mmh im thinking about particles and stuff..
it'd be so much easier for visual stuff to be world-space
tried it once never again
lol
we got particles working before iirc
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
yea but i dont think he needs optimization tips right now
I mean that makes sense for high-cost stuff, but is it really that bad to do it for a small card game?
Yea
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
There's not gonna be much on it
particles on UI using splines as paths too IIRC #archived-code-general message
Like the max I'm looking at right now is like 10 cards and a few ui elements
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
you should be fine
unless youre someone trying to make a massive game optimization shouldnt be a problem
especially with 2D
Ok good, so is there a solution for my problem that doesn't require a complete restart and recode of the project?
your main concern should be making something that works (:
its also about the size of your textures
depends on what you got so far
there always is..
That's the goal lol
that grid cell code you showed look like an headache
sprites you can get much higher quality with meshes also get more shader benefits
Smol, very small and simple
heartstone is entirely done with meshes / sprite
but if you see original cards they are huge
we definitely do not need to be fussing over VRAM usage right now, lol
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
You appear to be mixing UI and non-UI objects here
yeah its more than fine
Yes, I do think I am
You'll want to have an image that displays the grid, rather than a sprite renderer
Now we're getting somewhere lol
the rest of your logic should be pretty darn similar
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
with this shouldnt be too hard
or primetween..
or secondtween...
With the rate this is taking I'll have animations in about a month at the earliest lol
are you using scriptable objects?
So display the grid as an image on the canvas and then get the position of the image?
Yes, all the cards are scriptable objects
And would generating the grid as different images work the same way more or less so I can just switch out the way I'm displaying it?
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!
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
Nice! Thank you!
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?
world canvas
ScreenSpace - Camera could also work iirc that was the initial purpose was so you can rotate it like a physical obj w cam
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.
how can i detect if a specific object touched specific object?
Notes: Collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached.
thanks!
do you have an example maybe ?
you can potentially use scriptable renderer feature or vfx graph. really need more info
...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.
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
Ideally the effect would be applied in shader instead for the objects. You can still adjust the x/y offset for this in the UI (use raw texture instead) based on the look dir to make it "move"
Fixed that one issue, turns out that I had the position updating in the wrong place.
Seems like this worked for the most part, thanks!
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
What components did you use here?
Is this a SpriteRenderer, or a UI image or something
SpriteRenderer on the character
and it's animated using animation clips + the animator
you have something weird going on - hard to say what exactly
can you show your camera inspector?
can anyone tell me how to make enemy ai in unity ?
your question is too vague for anyone to be able to help you
No, because "enemy ai" is extremely vague. It could mean anything from a Souls-like fighting character to a rapping robot that writes diss tracks.
"You just got skooled by LyricBattleBot3000. Try again"
plus making enemy ai is a whole job field, it's like asking a math teacher "can you teach me math"
In the context of a turn based RPG with separate exploration and battle segments, how would I handle the transition between exploration and battle.
in what sense?
A pretty common/simple approach is to use additive scene loading.
Have the exploration scene loaded at all times and when you enter a battle, additively load the battle scene. Then you can easily unload the battle scene and you'll be right where you left off in the exploration scene
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.
you just need to make sure you disable any scripts in the exploration scene related to movement etc when the battle is happening.
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
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.
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
any ideas? it's just the weirdest issue ever since the animation defaults to whatever the first one is and then distorts it
looks like some kind of weird scaling issue, that's all I can say
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.
Is there more details or a callstack?
That's literally all it gives me.
According to Google it is somehow related to Collaborate. Are you on an old version of Unity?
2020.3 LTS
Yeah, that's old. Open your package manager and remove the Unity Collaborate (or whatever it was called back then) package.
I've never used collaboration though so not sure how that happened. It also looks like I don't have any packages about collaborate.
The Version Control package is built in to all new Unity projects
used to be called unity-collab-proxy or something though
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
Yeah thanks I'll do that now.
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.
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#
C# is object oriented
But any programming is better than no programming
make a game that you want...?
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?
joy of magic numbers
also where you getting doubling from ?
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
Yes but in the documentation for max distance it is the extra distance an object can go relative to how long the spring joint was upon creation
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
Ohhh okay, I see what you mean now
i always assumed it was the max length
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
Ye if you can that would be great
Right now it feels rly robotic
ahh i was in 2d
2d only had .distance
https://docs.unity3d.com/ScriptReference/SpringJoint2D-distance.html
it was much easier, all i did to come back up / down was shifting distance
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
yeah 3d gets weird..
playing with connected anchor is better than spring amnt
if u know java, c# is basically the same thing
and dictionaries are hashmaps
thats all u have to know imo
(if u know java)
Ye I kind of got it working by modifying the connected anchor position, my issue now is that the player can turn corners and gain like way more speed than they are supposed to
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
you might if clamp velocity but depends.. let me know how that goes though
nothing you have shown explains this. You should attach a debugger to investigate furthur (or add debug logs)
How do i scale a parent without also scaling its children?
scale the children in the opposite direction or don't make them children of the object being scaled
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
Do you mean as scaling equally in X and Y?
yes
i do
and i got the code down except for getting like the mouse position relative to the diagnal thing
There’s a little chain icon
no no
Next to X and Y
this is a scaling im writing msyelf
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
Oh.. you might have to use .normalize if you want it to adapt the diagonal direction
it sounds easy but idk
Yea its x + y scale but normalised so its length is still 1
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```
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
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
its just an example of adding the scale change you wish to apply
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
any tips for making simple inventory system
- look up some tutorials
- check open source implementations
- write down your design ideas
- start implementing and improve it as you go
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
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>();
you cannot call GetComponent from a field initializer because the object doesn't fully exist at that point
ah, makes sense
public Rigidbody rb => GetComponent<Rigidbody>(); this could also work
here's another explanation: https://unity.huh.how/compiler-errors/cs0236
this is a bad idea because you are then calling GetComponent every single time you need to use the rb property
You probably wouldn't want to do that though and cache the value instead
yeah I was going to say that
but its the most similar to the code block here
it's a little wasteful as it will run the GetComponent every time you every interact with rb
in looks, sure. but in actual functionality it is quite different
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
If anything @west radish cs private Rigidbody rb; public Rigidbody Rb { get { if(rb) return rb; rb = GetComponent<Rigidbody>(); return rb; } }
honestly that would be better if you inverted the condition
private Rigidbody rb;
public Rigidbody Rb
{
get {
if(!rb)
rb = GetComponent<Rigidbody>();
return rb;
}
}
no braces surrounding the if statements 😔
what is this, python? 😏
It's implied and perfectly fine for a single statement
yeah, I know
honestly its fine to get the component in Start, if you know the object is definitely going to have the rigidbody then its an ideal location for it
that or you could drag it into the field via the inspector
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)
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
It's good if you aren't certain when it should be initialized or want it to be initialized if it isn't already (implies you're not certain when you'd want it .. repeat)
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.
Guess. you followed the general installation guide, right? https://docs.unity3d.com/hub/manual/InstallHub.html
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
Can you try to run them from terminal and see if you can get any logs?
I will paste the result (very long). One second.
use something like !code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/, https://scriptbin.xyz/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
most notably I get the message "Appimage is not defined"
https://paste.ofcode.org/NGwvFN9j3srpYW7fQgAhA
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.
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
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
Ok, I appreciate you taking your time to try anyhow.
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
It would rather not include the unity part and search for debian directly related issues.
Yeah, those look to be OS specific errors. Have you tried asking the Debian discord server?
"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?
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
It worked on windows on the same pc so yeah, maybe i'm missing something hub relies on. An error would be nice, though lol
You get an error 😄
through terminal
i'll see if fixing that one also resolves hub. It's another lead I suppose, thanks
Unrelated to Unity but the OS specifically
https://www.reddit.com/r/debian/comments/t8o65o/vaapi_hardware_accelerated_video_decode_broken_in/
tldr: VAAPI is the hardware accelerated video decoder
it's fine that unityhub is not an appimage then?
i guess that wouldnt affect editor since it's separate executable
Search online for a Debian discord server and they'll be able to give you better advices
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
I'm assuming there's supposed to be some code with this since this is the beginner coding channel
out of 4000 members nobody seems to be a unity dev. i guess debian is a less popular distro for developers. thanks anyhow
Where should I post this then
!code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/, https://scriptbin.xyz/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
Its fine here, just show your script
If it stays hovering a fixed distance above the ground then your collider is probably taller than your mesh. The collider is the only thing that matters when it comes to determining if it's on the ground or not
But then why it's not moving ?
Is it ever entering the state where it moves?
Well it should move when the player is close to him , but he doesn't for some reason
Okay, but is it actually executing that function
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.
turns out its not , i dont know how to fix that
no wait i was able to fix it
now its moving
the problem he isnt playing animations and is walking backwards
Sounds like you didn't properly commit your changes
Hopefully they are using github desktop (I hear some try to use the web interface to upload files 😐 )
i do that all the time for readme's and text files and whatnot😛
just gotta remember to pull it
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
wouldnt that just be Dot Product?
what kind of vectors are these?
direction vectors?
Vector 2
euler angles?
they are positions
float angle = Vector2.SignedAngle(_original, mousePosition);?
there is no such thing as an angle between two positions
You need a third position to act a s a pivot to rotate around
theres a direction
so is your third position 0?
i mean they pretty much are direction vectors at this point arent they?
bc its at 0 0 0
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
its 2D
and then to get the angle between them you use Vector3.SignedAngle
or Vector3.Angle
ah
// [like dis](#💻┃code-beginner message)
float angle = Vector2.SignedAngle(Vector2.right, direction);```
i got confused tho.. cuz i was thinking just direction?
to get the direction dont i only like have to subtract
ye
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
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));```
most likely..
got ur spaces confused i bet
ye i dont fully know what im doing
You're trying to rotate an object based on the angle between _original and mousePosition, but _original and mousePosition are positions, not directions.
im trying to get this rotation circle to work btw
so i need to subtract the object origin
right?
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```
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?
something like this feels like what i think ur trying to do.. but im not 💯 on that.. 
no its not the same
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.
uh because they are relative to the parent
If _original is in world coordinates, the code you wrote converts everything to be relative to the parent position before calculating the angle..
oh good..
lol
if thats the case the subtraction makes sense
ye it seems to work well
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?
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;
} ```
Im confused, you pick a chair and spawn it but dont set the parent and/or position?
Also you can simplify this to put the picked chair in a var and instantiate it at the end. Plus you should give your children list a start capacity.
this is a really common issue.. it happens with alot of things..
right off the top of my mind is the line-renderer
i have to manually reset all the positions before i re-enable them.. b/c they'll be in teh last position they were in for 1 frame..
you'll probably need to do something similar
You may as well have a serialized list for the points too instead of grabbing the children at runtime too
i thought thats better
Disable();
ResetStuff();
ThenReEnable();
performance wise
you have to think about garbage creation and when the data is already in the object you may as well set it up ahead of time.
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
ok thanks, il look into it.
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
make sense
its always better to use a collection thats pre-allocated correct?
I thought about doing something like it, maybe reseting the values or the positon, its more like, how im gonna do it.
say 10-20+ indices more than what u expect to have
that way ur never changing it
<insert question mark>
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)
💯 but you'll figure it out.
It will work out, thanks for responding tho :D
if u have a reference to the item.. and the position and rotation of "where it should be"...
you can just assign those values right before u enable it again
good.. just a sanity check ☑️ thanks
Ye, thought this might be the case, thanks :D
I followed the Brackeys tutorial and figured out it told me to add Library, Objects, etc... to the gitignore, should I keep them in the gitignore? Or what should keep/remove for gitignore?
google -> unity gitignore -> the first result is what you want
just use this instead and ignore whatever he said
download and rename/replace existing .gitignore
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
bit late for that isnt it 😆
think he was referring to brackeys
in which case its valid
ohh.. if thats the case.. i retract my statement
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
whats with brackey
That's what I assumed too, as what I said just takes you to the same link 😄
no bueno.. find someone else
for (1) he's been deprecated..
i seen majority advise me to go watch him, geniune question
no support.. unless ur using Gadot
take it from the experienced heads..
brackeys starts people out on a really bad path
It's becoming more and more poor advice to use Brackey's. He stopped doing Unity tutorials years ago, so they're becoming more and more out of date. He also taught bad practices
I remember learning from quill18creates like 10+ years ago now 😐
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
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
https://www.youtube.com/@LlamAcademy/videos this guy is decent
https://www.youtube.com/watch?v=9iCnjdXEfMA this playlist is bad-ass crash course
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
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
i havent stick with one channel, im not really picky just trying one vid doing similiar thing i wanted fr
if u follow brackeys.. for the love of all thats mighty..
do not multiply ur mouse inputs by Time.deltaTime
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
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.
bad practices i can forgive but dang, straight up wrong info ?
ohh 💯 thats why i used the descriptor of "decent" 😅
it could have been a simple accident.. we dont know.
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"
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
what about coding train ? i thought higly of him when im looking for complex stuff
lmao.
fr
Yea i didnt feel there were glaring math errors or like brackeys level misinformation. It was probably just a combination of I do not like his style plus me seeing the AI series combining navmeshagent and RB. There was also something about a gun system he created using SO which seemed like a PITA to use, so i almost wondered why he was showing it off in a video
couldn't have said it better
its pretty mediocre tbh
but i can see it being pretty informative to beginners
https://www.youtube.com/@gamesplusjames is a good one too @rugged beacon
lol tutorial overload 😅
dont think i can rember these names when i looking for that one function for tutorial fr
thats where i find they run off the rails..
those types of guys have a certain kind of audience..
when they go too deep i feel like they over-simplify it.. and leave out alot to be known
the SO comment
just bookmark them for later 😉
most stuff im looking for are procedural generation stuff with code review, they seem scarce so i havent been picky at all
never hurts to have too many resources
Sebastian Lague is really good w/ that procedural stuff
but he does those "studies"
yea i watch that one 3d
they're really not tutorials..
but yea im doing 2d tilemap
You dont need to remember any names. you could bookmark it or subscribe, but if you're just looking for a method then you should be on google. What i said above about using tutorials, it should give you a general guideline of what to do. Then its up to you to google and find the docs for what methods do the calculation you need
Unity Documentation is where its at!
Official Unity Resources:
Unity Learn - Unity's Learning Portal.
Unity Documentation - Comprehensive guides and manuals for Unity.
Unity Scripting Reference - Detailed API documentation for Unity scripting.
Unity Manual 2022.3 (LTS) - In-depth manual covering Unity features and workflows.
Unity YouTube - Official Unity YouTube channel for tutorials, showcases, and updates.
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 ?
yea. ur correct.. methods you'll use will be documented.
but you'll have to rabbit-hole ur way there.. for stuff like that
yea that stuff would be fine to follow along. i was referring more to like an inventory tutorial, where at the end of the day an inventory is just a collection of items. An item can be defined as literally anything
If you're talking about a specific algorithm, you can think of it like a math formula. there's generally one implementation for it
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?
Like this and after the text falls it can interact with the colliders kinda like particles would
Here is a better example:
regular collider
w/ world-space canvas
And using no canvas so 3d text would that work too? Also can I give it a rigidbody? I dont see a lot of documentation on the tmp effects
There's 3D TMP as well
yep that is what I am using
Its not the text I am struggling with its the effect
TMP creator has extensive YouTube tutorials, from before asset was bought
but knowing theres a 3D element for text.. should fuel ur search
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
you may need to..
can't say for sure.. but you'll figure that out as u go
🍀 good luck 🙂
Alright thanks
made something w/ simple loop
A kind sir, in the animation part of the discord helped me, he told me to add a frame in the idle animation where it changes the x rotation, so that it therefor goes back to that, even tho it might be stuck from the recoil or reload animation.
Prefab -> Empty letter w/ rigidbody and box collider
Spawn Letter -> Change Letter -> Space Letter -> Repeat
did it work?
Yes, it worked perfectly.
awesome!! glad we can help (them moreso than me) lol
Oh wow
lol, thanks for still taking your time to help me tho.
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
Wait I don't understand the prefab part. Also the spawn letter part. Do you mind sharing the script
i'll more than happy share the code that does that ^ but not sure if its helpful
the prefab is just an empty 3D TMP
Oh so the prefab is just the mesh for each letter and we write the text after
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..
ahh
and se thtat
a powerful website for storing and sharing text and code snippets. completely free and open source.
the only thing i want to note... is right now its just using the transform of w/e SpawnText.cs is attached to..
Alright thanks, I will lyk if I get it to work
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
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!!
Oh btw the box collider is enough, The video I sent from MiSide looks like a box collider too. Also I think giving each letter more complex colliders could impact the framerate too much
nice
np mate 🙂 🙏
I presume miside actually just does some non physics animation to move the characters as you can modify the mesh per character
it does collide with nearby objects and walls appropriately so i think it is physics
I presumed it was a ray cast down and an anim 🤔 let me watch the vid again
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
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
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.
Watch "ShootBallGame - Level 0 - Windows, Mac, Linux - Unity 2022.3.26f1_ DX11 2025-02-13 18-13-53" on Streamable.
how does your player move
rb.velocity = movement;```
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
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 ) ?
https://www.youtube.com/watch?v=TQSt0uwQJ_0
at 29s, you can see the 'g' in 'something' fall onto the edge of the table and then roll off
(just fyi)
🍪 Ouro Kronii:
https://youtube.com/c/OuroKroniiCh
🍪 Stream Source:
https://www.youtube.com/live/WAdHapgsy4M?si=X6eA80X7nOfMyH5j
🍪 Outro BGM: By CC Music (HI3 Moonhalo Piano Cover)
https://youtu.be/T-OvQPcH4G0?si=o6LSikvmYEQQDf0Q
------------------------------------------...
I'm beginning to wonder how to include secondary entrances and exits from one scene into the other for the Unity platformer project.
No it doesn't. Tried this once before
how about an editor folder in the resources folder?
Dang you are right
Don't think it matters either way. We delete stuff at build time to do this
I will just rename it _Resources 😄
ho no .. I think _ on folder hide them or something 😄
lets go for Data
damn that was simple ty
have no idea why it worked with most of my other uses though
anything >1 is treated as 1, perhaps you were using pure colors before?
simple - it didn't
you did something different
yeah this is probably it
thanks for the help
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)?
Most people aren't familiar off the cuff with the inner workings of the starter assets scripts
Probably you would use this: https://docs.unity3d.com/6000.0/Documentation/ScriptReference/MonoBehaviour.OnApplicationFocus.html
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.
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.
chaotic
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 😄
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
You are probably doing something like modifying the default material
nope, because it worked this whole time, but when trying to make it work with the undo/redo system it all went downhill
let me show how it works
That would be helpful.
But "it worked before and doesn't now" doesn't really preclude anything
it may take me some time to post everything so please stay here xD
Make a thread
cool name
why is unity giving me an nre even though ive referenced the object im trying to change?
What is SettingsUI line 13
clickCount.text = "You've clicked a total of " + GameManager.instance.clickCount + "times... WOW!!";
Then either clickCount or GameManager.instance is null
Try logging both and find out which
okay ive logged both and its saying the gamemanager is null but im unsure as to how
Well, where do you set GameManager.instance?
in the awake method because ive made it a singleton
private void Awake()
{
if (instance == null)
{
instance = this;
}
UpdateUI();
}
Okay, and what function is line 13 of SettingsUI in?
OnEnable (for its own object)
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
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]
Are you actually editing a prefab?
Or an instance of a prefab in the scene? Or an object that isn't a prefab at all?
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
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
Looks like im to stupid?!
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
That's a... weird lookin inspector
its got some VC clutter
Ah, is that what it is?
im thinking.. with Check-in and Added
Yeah, there would be an overrides dropdown where it has that "check-in" button if you were editing an instance of the prefab
added does not do anything and check-in is version control
Yeah, those are unrelated, I've just never seen them before
so at least Its not my fault 😄
So I wasn't sure if it was a custom inspector
no. ours look the same.. if i select the prefab from the project window..
same as urs
but if i select a prefab within the scene.. i now do.. b/c of -> #💻┃code-beginner message
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)
Ah you are 100% right. you only have it when you have an instance of the prefab in the hierachie
👍 exactly
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
@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)
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
fun fact, rotations and positions of prefabs are irrelevant
if u want it to matter then u'd nest a gameobject 1 level down.. and rotate that instead..