#💻┃code-beginner
1 messages · Page 743 of 1
hmph
screenshot me the code
but only the part where the camera controller is mentioned
certified unity moment
so it's an engine issue?
I can understand what the script does yet you get an issue
show me the movement script
never an engine issue in this moment
BTW mouse input should not be multiplied by deltaTime, as it's already returning the delta between frames
ohhhh
fuckass tutorial
indeed
we both are indeed stupid
some random called nav spawns in then gives a solution that makes sense
HOLY SHIT IT WORKS
yeah we both are dumb twin ❤️🩹
❤️
I didn't even scroll so wasn't sure the original problem but yeah just saw that one common mistake everyone does and had to point it out lol
still sigma
where did you learn how to code tho
js finished a small course and tryna get into more C#
a mix of places, mainly Microsoft learn site
another thing I didn't like about the tutorial was the fact that it wants me to use projectiles for bullets
Nothing wrong with that, depends on the style of the game / weapon
as in rigid body bullets? or raycasts?
rigidbody, I wanna use raycasts for now though I do want projectile weapons eventually
grenade launchers n shit
Raycast are good for Hitscan weapons , for projectiles you need to "simulate" the velocity and possible a drop yourself
rigid body bullets can be used to give the bullet travel speed and bullet drop easier than raycasts
but can be problematic in performance iirc
I'm not tryna do bullet drop stuff
this doesn't need to be hyper-realistic, I'm going for something like tf2
rb are fine if u pool them
With pooling this can be remedied a bit
raycastgoodtoo
you can remove gravity from rigid bodies
it's a toggle feature
this I've learned and will likely recycle for rocket launchers when I get to that point down the road
rigid body projectiles are REALLY great for weapons like bows
A big issue with rigidbody is if they are too fast they might not register even with continuous collisions
I'll deal with rbs later, I'm just tryna get hitscan right now
is this fixable 🤔
can we use lateupdate for it
Hey, guys! Is it possible to create crouching system without having humanoid at all, by animating the camera itself?
Like if you want to animate the camera to go up and down without having the humanoid rig
like you have just the camera itself, I was just wondering
Continous collision mode usually is fine. For more complex cases you can add extra ray check
Sure, crouching has nothing to do with being humanoid . . .
Yeah for sure. There are at least 5 easy ways to get that done keep us posted 
my unity is glitching
i started adding animations and now the ui is glitched
on the right hand side
fixed it
but i can't seem to get my animation to work
restart unity
already tried that once
Ctrl + s first (save)
then you are probably in hell D:

oh boy can't wait to struggle with this in the future
just fyi this is a code channel
yeah, i know but it was easier and no one helps you in #🏃┃animation i posted there like 1 day ago and no one helped
well crossposting is against server rules so stick to the proper channel
if someone has the answer they will answer it
alr mb
If you actually provide enough information in the question that someone could actually answer it, you'd have a better chance of getting answered.
that's the problem, this is my first time animating so i don't know how to explain it
Does MonoBehavior and NetworkBehavior the same except MonoBehavior is for single player?
That’s a NetworkTransform component
Oh yeah just in general NetworkBehaviors will include the transform data sync'd
as GOs can only exist with a transform anyway. Either case you're not usually RPCing the transform data
Can you elaborate on this because that doesn’t sound right at all
Not sure what to elaborate on. If you're using NetworkBehaviour you're using tied to using a NetworkGame objects
NetworkGame?
You specifically said transform data but i’m not sure what you mean by that
Thanks
So how would anti cheat work on multiplayer
NetworkBehaviours are usually instantiated upon these NetworkTransforms because otherwise you'll be adding a bunch of boilerplate to RPC every bit of your hierarchy's transform to the server and each client.
Which also have options on the network identity to not transmit that data, but in general if you're working with multiplayer you'll be using these specific gameobjects any time you want to provide positional/rotational data to the server
I’m making a top down 2d pixel art game and cinemachine’s dampening is causing minor jittering. Is there a way to fix this? I would like to have dampening still.
There's usually options for when the camera updated (fixed/update/smart*) which you can maybe resolve with but otherwise ask in #🎥┃cinemachine
Using System;
Class Program
{ static void Main(){ Console.WriteLine("hello world");}
Just learned thisss
NetworkBehavior has Network specific properties and functions.
it inherits from MB
https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@2.5/manual/components/core/networkbehaviour.html
didn’t even realize that’s a channel lol
so is it an exact copy except NetworkBehavior just has multiplayer functionality?
Pretty much
The only time you'd really use general monobehavior if you only want client sided scripts to run
Such as UI for instance
inherits means its still a MB yes.
all the network stuff is relative once the Network is started
eg isClient doesnt return anything accurate until you are connected etc.
right so what do multiplayer framework do?
but yeah you don't use networkbehaviors for literally everything, just things that need to check those properties, or receive those network event
if we have NetworkBehavior
I see
its like private and public
if everyting is public it can be a headache
idk what you mean by that
access modifiers have nothing to do with anything here
right- it was just an example.
so what do multiplayer frameworks like photon do again
sync computers or something
they are basically all the boilerplate code you would normally write yourself
i see
so like
they are shortcuts
computers are not syncd ever
thats not how it works
there's also lag compensation a lot of these libraries provide that is usually a pain to write
I see
you send RPCs usually to tell other computers what to "sync" in a way
but they are all running their own simulations and their own timings
they don't know about each other at all
so does it sync objects and physics?
things like NetworkVariables ease this for you and sync variables automagically
how does it link it together
server-client topology , they all know only about Server, they dont know anything about each other and only communicate through Server
so its up to you to sync and communicate to clients what to sync
server is what runs the actual game state which all clients abide by, by most mesh-network approaches
oh okay so do they all run via the server and other clients dont talk to other clients
thats what makes networking very difficult especially when lag plays into it
i understand
no they all run their own version of the game, the server is just there to Send RPCs. / Sync states
So I'm not sure what it is about my movement code that is causing the character to get stuck on a ledge like in the GIF
I understand it now
if client wants to Shoot , it sends RPC to server to tell I am Shooting this other object, then server finds out which client that is and it sends RPC to it for damage etc.
server could also say no, you weren't allowed to shoot to prevent speed hackers to manipulating it all
anti cheat for multiplayer games sounds like misery
yea ideally server always keeps the "state"
then your choice of sync it back to the server state or stay with your desync'd state
wdym sync
because it is, hence why even AAA struggle with it
often why third party tools are used
like what
Easy Anti-Cheat and such
dont those programs need like alot of access to your computer
well now there is a new trend to get into "SecureBoot" which is part of your CPU/Mobo and that is basically kernel level anti-cheats
lots of these don't work for other platforms like Linux
probably just the collider
its pretty common issue especially with capsule controllers
there isn't an exact fix and you need to get a bit creative on how to fix it
I figured that was part of it which is why I tried contracting the radius but I still have the same problem. So what's the solution
character controller has issues with it too
I want to do node pathfinding
Ok. What solutions have been done then?
i've seen some people somewhat "nudge" the controller off the ledge
or shrink the collider momentarily as you mentioned
Well, yeah, they're also capsules
Just do box collider ;)
I can see that being a solution once you find a way to detect a ledge, but I don't know how you would do that then return the collider to normal
a combinations of raycasts
and some maths
Ok. How does this work?
say you have 5 rays, one middle and 4 on the sites in a NSWE type of setup
then you can see if its 1 ray only hitting and "under" the middle and sides is a gap to fall you push that way
Where are they starting from and where are they pointing?
So I start from the very bottom of the capsule and point it where?
they all point down?
Oh I see where you're going with this
so if only 1 ray is hiting but not the others, then you kinda know you're on a ledge
ofc you gotta handle other situations (edge cases)
Hi there! I was advised to come here in hopes of resolving an upcoming Unity patch which will very likely break the english translation mod for the game Duel Masters Plays
This will very likely happen to DMP, once the unity update patch goes live tomorrow
I know absolutely nothing of coding. Translating the game simply (tediously) requires renaming text in a massive text cache file. I'd like to know what I have to learn in order to adequetely solve this potential issue by myself, since the mod is more or less abandoned
Discussing modding isn't really allowed here but if you have no coding experience it's not going to be easy. Most likely you'd have to learn how the mod works and dig deeply into Unity internals so it's a big hill to climb
Hello, guys! I have made animations for my camera in order to create crouching everything works fine when I am pressing C button its crouching and when from crouching pressing C it stands up, but the problem is I cannot move at all because I am using character controller to move and my animations I think doesn't letting me move at all. What could be the problem?
I am not using humanoid at all
only animating the camera
Hey guys, new here. Learning Network for gameobjects and have a small issue. if someone can help me out with it?
Post the issue to #1390346492019212368 and if someone knows they'll answer
oh okay. Thank you.
show the code you use to move the character
You'll need to debug it. We can't telepathically figure out your problem.
!code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
Yes bro. What's the best practice when using animations without a humanoid like which approach most devs use for movement when handling animations without humanoid rig?
I know its of course easier to animate and move with humanoid rig but without one things are getting more complicated
Animations are generally unrelated to movement. Unless you're trying to do root motion.
Don't you dare go hollow
is there a template file with a standard first person control script ready to go? cus im either really bad at following tutorials or the ones ive been trying are outdated
this is the code im running and i always get this error whenever i try and move the player
Most likely it's the "im either really bad at following tutorials" thing
Input code differs between the built-in Input Manager and the Input System, and changes are required.
This error tells you exactly what to do to fix it
this is my first time really using unity bro my bad
thank you
you should still actually make an effort to read your error messages though. the issue is explained in the message as well as what you need to change to fix it
i read it i just literally do not know anything about unity bro
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
it is, but you're still expected to at least put in some effort
i spent like an hour looking at tutorials i only came here as a last resort
could've also spent 30 seconds copy/pasting the error message into google and the top dozen or so results would tell you how to fix it. hell, google's bullshit AI overview even tells you
aint gotta act like im an idiot just because i dont know programming as well as you do or im not very observant in your eyes
nobody said anything about you being an idiot or not having knowledge. it's just being pointed out that the answer to your issue was literally in the error message and that putting in literally any amount of actual effort would have resolved it quickly
brother
what if I put a minus behind the vector3.forward in transform.Translate(Vector3.forward * Time.Deltatime * 20)
what would happen
damn what a strict server
can you not shitpost. ty
can't do anything
also if you think using a negative value is going to crash anything then you might want to revisit grade school math
it takes literally 5 seconds to try and and find out what it would do
i was joking? but whatever makes ya sleep at night.
shitposting is also not appreciated here
you should give #📖┃code-of-conduct a read
maybe when I feel like I'm gonna chat again
this isn't really a server for chit-chat, this is a help server
it would be negative
Hi
Is C# difficult to learn?
depends
It's different for everyone. Technically speaking, no, it's a really pleasant modern language
how much experience, if any, do you have with programming beforehand?
how apt are you with the process of breaking down problems into smaller tasks?
etc etc
If you are good at analyzing things, actually video games across history do the same kinda stuff over and over. Exceptions being novel breakthroughs like Motion Matching, GPU instancing, whatever.
experience = none.
compared to other languages, it's about middle of the road in terms of learning curve, imo
but programming as a whole kinda has a learning curve on its own
How many years it takes to master C#?
#💻┃unity-talk message perhaps give this a read
It depends my dude
infinite - you never really master something in this field
there's always more to learn
but you don't need to know everything to be experienced enough to make things
you don't need to know much to start - as you get better, as you learn more things, you can make more complex things
- Impossible to answer
- Don't set your goal at "Mastery"
My advice is to make a decision on what exactly you wanna build. Cuphead clone, PUBG clone, Civilization clone, Clash of Clans, whatever.
Then you start analyzing how that works, research how it works. And you come up with the 5-10 strategies / concepts needed
think about other skills, mastering art, math, carpentry, etc
you can never "complete" those subjects, there's always more you can do
but you don't need everything
same thing for programming
Yeah.
We can't give you specific answers if you don't have a specific goal
I thought I knew things then I started learning about value categories in c++ 🙁
ive been going through those for like a month lmao. though tbf it hasn't been continuous
++container.begin() is an lvalue and that is deeply unsettling
What is Unity?
depends on what you're asking exactly
it's a company, it's a software, it's an ecosystem, it's a community
You can do cool stuff in 3D or 2D. Basically whatever you want. That's it
i can only imagine creating an 3D game. huh
Is it free?
did you put any research into unity beforehand?
these are pretty simple questions, and i have a feeling you have more that would all be easily answered by some quick google searches
You could click on the link I sent, it's all answered there
I just wan't to learn new things from people, not from google.
people wrote stuff for google to give you
so we don't have to say the same things over and over again
Not any more 😭
fine
googling will save us all, and especially you, a lot of time
and it'll also give extra info that you can research further and learn more
using available resources effectively is a very crucial skill
easier than python
is it?
no, it depends
it depends but for me, its easy
and python was hard?
the first language you try is always the hardest
in python you have to mention every text's place
yeah, same here?
it doesn't have drag and drop system
c# + unity
yeah, that would be a comparison of unity vs [whatever engine you were using before], not c# vs python
Python is specifically annoying because it isn't strongly typed which makes managing large projects a nightmare.
How can I remove this? It always asks me everytime I open up my project
It just appeared up recently
Open the package manager, remove the deprecated package
theyre locked tho
only an unlock button is available
Then you'll need to remove or update whatever template package contains it
"Features", that's what they're called. Had to go check
Took me years to learn English 🙁 was born unable to speak it. But yes this is true, as you learn more and more about a language you can switch easier to others, principles generally remain same just the syntax may change
It says it's part of the Engineering feature so try removing that
Will anything go wrong if I store huge amounts of chunk data in a sqlite db so I can have both random read write access and chunk compression?
Could you please help me to solve this?
And what is the problem
It collides with the ray, but it doesn't work, a circle has to go after the square
Do you get your debug log
But when I remove "AttackRay.collider.gameObject == Player", it works tho
So that would mean that the thing the ray hits isn't the same object as Player
Unfortunately, Debug.Log isn't being shown, that's the problem
What is Player?
But I've set up a tag in Inspector to the square "Player"
An used tag
Not sure what tags have to do with anything
Tags aren't involved in this code at all
You set one on an object if the ray hits something, but what tags an object has currently are irrelevant
But what is Player here AttackRay.collider.gameObject == Player
Is it the name of the object?
Do you know what == means
Of course .-.
Beforehand I thought this was used for tags' names, now I'm being aware of the contradiction
So then you should be able to see what it's doing
I comprehend what it means
You're comparing AttackRay.collider.gameObject and Player.
Are they equal
So, I ask again, what is Player?
So it means it tries to equal collider's name with "Player"?
What do names have to do with it
Where are you getting names from that line
Idk bro I'm new
It's checking AttackRay.collider.gameObject, and Player
I had to use the name because a circle sees its own collider
If those are the same thing, it's true
Which was the reason for me to condition it
And responded
So, what is Player?
Include Layers and Exclude Layers can help. If your enemy would only need to detect the Player nearby.
I think using actual Collider components with OnTriggerEnter / OnTriggerExit is quicker than doing your own Raycasts or OverlapSphere etc
Checking gameObject == Player is probably not a great way to check if the collided object is a Player
Surely tags and layers work faster than, checking game object equality ... anyone know for sure ?
It might be, depending on what Player is
Nah, direct object equality is trivially fast. It's a reference type, it just compares two pointers
Granted, tags and layers are also trivially fast, but both involve dereferencing the pointer first, then comparing two pointers
(as long as you're using CompareTag so it doesn't need to do a string lookup)
It's also slower...
It doesn't need to be, but doing all the stuff to make it fast basically blows away any of the good reasons to use the language in the first place
The conveniences provided by the language come at a cost
Oddly enough the conveniences are what make me hate the language, i need my semicolons and wiggly brackets
Yeah of course, C or C++ if speed is important
By "Conveniences" I mean more like pip and virtual environments
C# is still faster no?
C# is faster than C? It cannot be
Ah yeah never messed with those
The only thing faster than C is machine code
C is the most raw language yeah exactly
Before assembly language / machine code
Python runs on C... interpreted
Ahh it's still faster c++ at least right?
C#, faster than C++? Why
Also no
Is it not? I was told it was quite a few times :/
You don't pick C# for speed
If speed is even on your list of requirements, you use C++. If it's at the top of the list, you use C.
Well no i know that c# is a higher level language (right? Cause I'm not even sure atp)
"Speed" means it is programmed to be fast. Hence the access the language gives you to things, limits the speed
Anyone know if shaders used in URP Decal Projectors can be dynamic? I'm trying to have decal projector that grows a water stain on the ceiling. I have a script that is adjusting the shader property to have the visual fade in over time, and I have debugged the value coming from the shader and can see that it is changing as I'd expect, but as soon as the instance of the projector is created, it is completely visible immediately instead of fading in over time. Even if I comment out the code that fade it in and just have the code in the start function that sets that value to 0, it's still there as though it's not being set. I've also selected the projector in the scene at run time to verify that I have set the instance of the material and not using the original.
Drag in the object you want to call the function on, not the text file containing the code.
Ohhh, Thank you so much!
👍
bro unity 6 screwed me. Check this out. I had this problem earlier creating a char variable to type in a letter in the editor. Try with any other version it works. This script is pulled from a previous version. Even adding a variable on an already created script with similar variables no longer allows me to do this
<@&502884371011731486> scam
!ban 1424374630206144575 scam
@hugolarsson0631 banned
Reason: scam
Duration: Permanent
Hello,
my progress bar is this weird oval shape, whenever I set the image type to filled.
How do I make it a rectangle?
Use a uniform scale, then change the size of the rect to resize the sprite
I am new. How do I use a uniform scale?
Rigidbody2D.velocity has been deprecated. Please use linearVelocity.
I want velocity not linearVelocity
I don't want to change it, how can I remove it so that it doesn't correct me.
There is no velocity any more
it's linearVelocity
why?
Because linearVelocity is more descriptive to what it actually means
but this is the same and is faster to write
It is the same, that's why you should use linearVelocity
It's shorter, but less correct.
.v would be shorter still
but less useful
ok thanks
You brought this up a couple days ago, did you make a bug report?
I made one but they weren't able to replicate it, haven't gotten around to uploading a full project where it happens
i sent in a report, nothin back yet
a big chunk of my code relies on getting those characters lol. tf unity
Assign it in code, you can change the value properly if there's a value already populated. You just cant remove the value and make it empty
Lol that works. weird how that works tho
How do I stop VSCode from showing the rosyln generated code when I search by references? it's a lot of noise to wade through when looking for a reference to something.
if i had to guess, i'd say that your isGrounded method is returning false. but you need to actually add some logs or something to verify
also, if you want a cast with 0 distance, why not just use an OverlapBox instead? your cast doesn't move so it isn't going to move into another collider
I had accidentally forgotten about implementing the distance, fixed it
Isn't working 🙁
and have you bothered actually checking if that is even the problem?
Of course, I'm trying, asking GPT, logging and checking if whether box's collider is normal or not
Okay
if you're logging then where are the logs
IsGrounded is false somewhy
Does that log ever print?
How can I make sure that box collider is right exactly in the intersection with the mask? Ray can be seen, so can be the box?
well that "True" log is certainly misleading. but does it actually print?
Sorry, I don't know, I only started learning Unity recently
I trust Debug.Log for booleans and etc.
Answering whether or not you get a log to print isn't something that requires Unity knowledge
so then how the fuck did you determine that isGrounded is returning false?
it is notable
wtf does that mean
Sounds like a translator is being used
dude I tried to put it in an update
it hadn't been affected at all tho
the same result
okay, that's irrelevant. i will ask again, is the log that only says "True" printing to the console. yes or no.
So, did the log print
No
Then you aren't calling this function anywhere
congrats, isGrounded isn't even being called then!
I tried to call it with isGrounded = true implemented in the fields of the class
which indicates either the Jump method isn't being called or the context.performed is false
it didn't work either
this makes no sense considering isGrounded is a method
I changed its shape
If you did that you'd get a compile error because you can't set a function to true
cuz I changed its method, changing it from the method to the actual boolean
instead of making random changes that make no sense, why not actually attempt to debug the way we've suggested so that you can actually figure out what the fuck is wrong here instead of throwing a bunch of shit at the wall and hoping something sticks
Send me the solution then instead of being toxic
We did and you kept changing random other things instead
So the goal posts keep moving further and further away
we have to figure out what the fuck is wrong first
I can't find it out mate
Bro I did it earlier
then cooperate
We said "log the value of this function to see if it's being called" and instead of answering it you changed the function to a bool for some reason?
these changes I mentioned were made earlier
I did it earlier as I say
No, we asked if it logged as it was when you shared it and then without giving us the answer you changed it again
I'm trying to get input key, but it fails
I didn't change anything there lad
So now the answer we had is irrelevant because the code is different now
then if your current code is the code you've sent a screenshot of most recently, and "True" is never being printed to the console, then i've already told you what is wrong #💻┃code-beginner message
Then how did you set a function to true
Because I did it earlier .-.
there is so much wrong here
Okay, so, _does this log print _
Noo, at all
This isn't even C#
So what could I do?
I'm using javascript on unity cloud
Then you're never calling the function.
Shall I try to change context.performed?
well try using logs to find out what the issue is
Okay
hiya, I want to start learning unity, Im probably going to start with the official unity tutorials but Ive heard that those are a bit too "guided" as in they just straight up tell me what to do instead of why to do something, should I just start with that and then simply try making small projects or should I look towards other tutorials instead?
!learn do the pathways on the learn site 👇
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
I've tried to call it in function without "context.performed" and it didn't work either
alright, if you're just going to ignore what is being told to you then i'm done attempting to help
Bro I just can't understand
You're telling me to log
Now you should see if yourJump function is ever called
I logged it with "debug.log"
show the new logs then
And I'm attempting to see if "context.performed" is the problem or it is situated elsewhere but in the actual boolean
Lemme
I don't think cloud code is used for this sort of thing. It seems to be something that runs entirely s ever side so I don't think there's any input it can read from
there are no new logs here. so you didn't bother trying to log like i suggested
Okay and is the log printing now
yes, obviously
They removed the context part of the if statement
So it's just calling Is grounded directly
There are 2 debug logs 😭
Yes to see if context performed was the problem
put one outside of the if statement so you can see if the method is even running at all
I'm removing that Debug.Log from Jump(context), right?
huh?
Which one of log shall I delete?
i didn't say anything at all about removing a log. i said add one
They told you to add a log
then go sleep and come back when you aren't making your lack of thought everyone else's problem
I haven't done well I have to solve this
Then wait until you're capable of reading answers before asking questions
Like this?
Yes. Does that print
does anyone know how i could show something like this in the inspector?
public class AStarPoint
{
public Vector3 position;
public List<AStarPoint> connections = new();
well there you go, that method isn't being called. see what you did different for that compared to your horizontal movement
not sure where this question should go. anyone using localization package, would preloading my dialogue string table for just the active locale bite me later down the road? how do you manage your localization tables for scalability?
ohhh.........
Then nothing is calling Jump
NAHHHHHHHHHH
make it serializable. though you'll have issues with serialization depth since the class contains a list of itself
well this is a problem, you are printing it true before it even checks... meaning everytime it's called it'll say true even though it might not be
yeah thats the part im struggling with
You'll need to add [System.Serializable] to your AStarPoint class
i tried that and it doesnt work because of the List<AStarPoint>
Okay, and what is actually calling that event?
What about it?
Player
The one I'm using for Move
it is itself an AStarPoint, so i guess keeping a list of other AStarPoints is causing problems
And Move, presumably, works?
Yess
So, what is the difference between Move and Jump
I mean in Move I just read the value of buttons for Vector2 and in Jump I type something

Bro I don't know
Tried to adhere to a tutorial
Yeah so since this is actually a reference thing serialization isn't going to work normally without some editor scripting.
You'd need SerializeReference and a custom inspector
Typically serialized fields are fully duplicated out
thanks
What is the difference in how you call Move and how you call Jump
That doesn't really answer my question. I'm asking how you're calling these functions.
Move is getting called. Jump is not.
So, what's the difference between how you're calling them
In Move I just read the value of the button, the bind which is related to the keyboard.
Jump is asking if button is read or not, so it has to be performed when I tap a button of bind
that information is not relevant to the question that was asked. you were asked how these methods are being called. presumably another component is doing it if there's nothing explicitly using them in this one
surely the tutorial showed how to set it up so that the methods are called when you perform your input, no?
I didn't particularly follow tutorial fully but at the beginning was writing by my own
And only later I started adhereing to that
The only thing I had noticed which I missed is that he created Jump bind, which I didn't
and you don't think that has anything to do with why the Jump method isn't being called?
So then what button are you pressing
W and S
and what exactly is connecting those buttons to the Jump method?
I mean it is already inserted in the new version
W and S
So, what's supposed to be making those buttons do "Jump"
i asked what connects those buttons to the method, not what those buttons are.
what, did you finally go and look at your input action map and see that you had a completely different button mapped to your Jump action?
SPACE 😭
Yeah, if you want to change the binding to something else, you have to actually change the binding
it worked after I tapped SPACE
It doesn't just read your mind to know what button you want
I WAS TAPPING W AND S BEFORE
now if only you had any idea what you were doing we could have guided you to that earlier
what else would jump be, unless it was a 2d game which i doubt was mentioned, and you'd need to change that yourself
It works....
now instead of trying to follow shitty "Do X in Y minutes" tutorials that aren't really teaching you anything and are just expecting you to blindly parrot what they are doing, consider going through some actual courses that teach you, like the pathways on the unity learn site
The next time I will try to describe whole process starting from the point what button I press to move the character
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
I'm learning through GPT and Documentaries right now
and things related to Inspector I learn through videos
You should use Unity Learn instead
I'm learning through GPT
well then i'm certainly not going to help you any further. if you want to learn from the bullshit machine and shitty tutorials then expect to never understand what you are doing
GPT is very helpful I think
you think wrong
It really, truly isn't
would not recommend chatgpt that much, spent 5 months learning c# with it and tbh i learnt more coding from my teacher that taught me the basics of java
not C# of course 😄 It cannot build up a plan in learning a programming language presumably
I learned C# from metanit
but you think it can build a learning plan for a game engine, which is arguably harder to learn than a programming language?
It helps me to distinguish different methods and their pros/cons
Not saying that
I mix it with Documentary
Documentary is at the top
of course using ai makes me feel smart cause i watch it be stupid, duh
if documentation is your number one resource, then why didn't you just learn how to use the input system from the course in its documentation and instead relied on a terrible tutorial that isn't really teaching you anything?
Bro I'm telling ya I accidentally have been pressing W and S instead of SPACE
That's why method hadn't been calling
yet you linked a photo to a video of code that was the same as what you had... #💻┃code-beginner message
yes because you knew nothing about the input system and didn't bother creating your desired bindings for the Jump action
the action was, yes. but not your desired bindings for that action
Good night guys
Because you wanted it to be on a different button
You apparently wanted it to be W instead of Space
Bro ya not telephatic wdym by I wanted it
so you knew it was set to space but you were pressing a completely different button on purpose?
I did it accidentally
Nah yall are tripping
bye
troll?
guys why inst my script working
HelloWorld("print")
you have to show it in context... this isn't helpful to anyone and we're not mind readers..
don't shit post . read the #📖┃code-of-conduct
better me telling you than a mod.
@errant bear if you have a proper coding question then ask it properly otherwise no need to add extra noise
👇
:thinking: Asking Questions
:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #🔎┃find-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.
-# For more posting guidelines, go to #🌱┃start-here
alr now can you tell me whats wrong with this
What does this have to do with Unity
poor attempt at trolling.. this isn't even c#
no i use a program to code in unity using python
and it uses ai to translate it into the cloest thing in c#
so why isnt this working
lol what
go back to learning the basics
can u just tell me whats wrong with this
it tells you whats wrong, its not defined
<@&502884371011731486>
HelloWorld isn't defined, you cannot call a function that isn't defined. Again this is a unity coding question so unless you have a unity c# coding question, we cannot help you
"and then you guys just do Helloworld("print")"
They're trolling, don't waste your energy
Can you stop spamming, thanks.
of
ok
ban me bruh idc i was here to ragebait but apparently nobody here knows python ball knowledge
!ban 858129864933244940 soamt
@sudaim7760 banned
Reason: soamt
Duration: Permanent
Huh weird auto correct lol
Does anyone know the reason for why I am getting these errors?
here is my code for the project I am working on. Its a simple dialogue system I was making
these newer unity versions are busted
I think they might have rushed these patched versions out the door and didn't fully decouple the broken 6.2 code from them
Dang and I just told my team to switch to this version two days ago 🙄
never commit to upgrade to the "latest" just cause
stick to LTS usually
especially if its a production project
Hopefull you made a git commit you can revert to before the upgrade ?
Yeah everything is on git and I haven't made the commit yet because of the issue of the dialogue system
I just turned off ** Error Pause** to let it run and see haha
ya its not like a simulation breaking error or anything afaik
its the Editor UI mostly
Also is there a better way to go about playing sfx? I've read on forums that using animation events are better than programming it in when clicked and vise versa.
I did the character sfx through programming after you click the button instead of an animation event.
depends what you're doing, if you need it to play at an exact time in the animation then yes animation event is usually the most accurate imo
if you need to play on click, then probably no point of animation event
Okay thanks, this isn't animation the characters flip ( gameobject's set to false ) at specific dialogue points(index). I'm not that experienced in creating a dialogue system between characters. Only just pop ups over items.
my only experience with dialogue was using something like ink
With animations would the button just activate the next animation???
ink???
As used to author Heaven's Vault, 80 Days and Sorcery!: produce interactive scripts by writing in pure-text with ink markup.
its open source
Inkle and yarn are good
ya heard good things on yarn too, I'm just cheap xD
i think its free or cheap. I used it in a project and had good results
Also i have been working on small mechanics outside of my project that I can save on my github and pull for other projects. I don't know why I haven't been doing that haha.
i do something like this but also turn them into .unitypackage so they're easy to plop inn
Check out OpenUPM too, then you can create stuff to install through the package manager so it's easier to manage the versions in your projects you use it in
what am I missing? shouldn't the bool isPaused be exposed here?
using UnityEngine;
using Rewired;
public class PauseLogic : MonoBehaviour
{
public int playerId = 0;
private Player player; // The Rewired Player
public bool isPaused = false;
}
Write a method for it
It needs to be either a method or a property. Fields cannot be set by UnityEvents
is it possible to execute commands into command prompt and get a return value back?
yes
what is the method name? I did some googling and cant find it.
well actually I kind of explained that poorly let me rephrase
Process class for starters, then you can Read output and shit like that. I gotta recall the exact steps in a different project cause its been a while, I've done it to run api servers and read the output
id love to hear why you want to do this
I am creating a multiplayer game where community servers can add mods including custom scripts. I cannot use c# for this as you wouldn't want server owners able to access your personal files while connected to your server(or do a lot of other things for that matter). So i have embeded the web assembly runtime into unity using wasmtime. This will allow users to write scripts for the game in like 10+ languages(anything that can compile to a wasm file) one of which is assembly script. But in order to compile it to wasm you have to create a project in node js and execute several commands to the cmd prompt to do so. I am trying to make an editor script so I can just create it with a button in the createassetmenu
the web assembly runtime sandboxes the scripts for you so they can only do what you implement
found it
I asked because I was unsure why you wanted this but editor only is safe
dont mind my uhh arguments but yeah you can also add arguments or whatever
Thanks for the example!
:thinking: Asking Questions
:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #🔎┃find-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.
-# For more posting guidelines, go to #🌱┃start-here
im still confused on how to get help?
did you read ALL the points, what are you confused on?
Does anyone know how to fix this issue with my sfx. I used an animation event to play the character's sounds but when it gets to the second one it just keeps on playing?
what is this code inside of , you need to provide more context
i read the points but since im very new to unity. I need helpful tips to manage discord codes and learning how to use unity itself to create simple wonderful things? Can you please help me understand all of this?
start here learn 👇
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
public void PlaySFX() //Animation Events
{
if (animator.GetInteger("Dialogue Point") == 0)
{
source.PlayOneShot(clips[0]);
}
if (animator.GetInteger("Dialogue Point") == 5)/*ERROR, Constantly spawning the voice line on top of each other forever*/
{
source.PlayOneShot(clips[1]);
}
}
public void zeroText()
{
dialogueArrayIndex = 0;
dialogueText.text = "";
gameObject.SetActive(false);
}
public void NextLine()
{
if (dialogueArrayIndex < dialogueArray.Length - 1)
{
dialogueArrayIndex++;
clickCount++;
dialogueText.text = "";
StartCoroutine(Typing());
animator.SetInteger("Dialogue Point", clickCount);
}
else
{
zeroText();
}
for (int i = 0; i != changePoints.Length - 1; i++)
{
if (dialogueArrayIndex == changePoints[i])
{
change = !change;
}
if (change == true)
{
profileImages[0].SetActive(false);
profileImages[1].SetActive(true);
nameText.text = name2;
}
else
{
profileImages[0].SetActive(true);
profileImages[1].SetActive(false);
nameText.text = name1;
}
}
}
thank you for pointing me into the right direction
put a log inside PlaySFX and see how many times it actually calls
I have this code on line 20 that has it, where it should be grabbing a gameObject from the other script (Towards the bottom for the other script) And I have ran mutilpe different test to see that the gameObject is not null as it does equal something. But I still run into this problem and I can't see where the problem lies. Can someone help me see if i'm stupid or not?
For got to send the error
your screenshot doesn't match the code you sent
283 times and still rising
Should be the playercash code
there is nothing on line 28
it's on Lane 20 in the code
yeah thats a lot so either you busted the Animation Event or something else is calling it once it calls it
Lane 28 on studio due to some spacing I have
line 20 still doesn't make sense.
Oh, it should Object = moneyHandler.Lockin within the FindTotalAmount()
you have to send the code with the namespaces
That's where the error is
that way the line matches the screenshot
Yeah
That is in the other script below it
But that is what's getting the object, from a collider
Are there any potential solutions for my error?
if you narrow it down to the cause?
right now it makes more sense
if (moneyHandler.Lockin == null)
again moneyHandler is null
is it assigned in the inspector?
https://paste.ofcode.org/88kn3wS9Xcnb8cgzJyy55r This is the other code sperate this time
Sorry, I keep looking at the wrong thing, It is not assigned....
Thank you for the help
I don't know why but it was the animation event inside of the animaton track. I just deleted it and programmed it to play the sfx at a specific clickCount. I would prefer to use the animation event because it worked for the first one i don't understand why it glitched out on the second one???
I put the PlaySFX() in my nextline function
{
if (dialogueArrayIndex < dialogueArray.Length - 1)
{
dialogueArrayIndex++;
clickCount++;
dialogueText.text = "";
StartCoroutine(Typing());
animator.SetInteger("Dialogue Point", clickCount);
PlaySFX();
}```
hard to know the cause without debugging further...
could be a editor bug maybe ? the latest versions have been weird lately I wouldn't be surprised if it was
could be really anything , maybe you're stopping it on the animation event or the animation is looping ?
How can I store objects of different types in the same list, particularly instances of System.Action, System.Action<T> and Func<T>?
a tuple would probably work I think
List<(float a, int b, bool c)>
both can store as Delegate type
Hm this could work potentially but would require a lot of manual coding later. Essentially Im using a library that provides me with 3 overloads to find a function in a script. I would like to store the results of all of them into the same list.
Action? action = instance.GetAction(functionName);
Action<T>? other = instance.GetAction<T>(functionName);
Func<TB,TResult> func = instance.GetFunction<TB, TResult>(functionName);
oh wow this works ```csharp
Action? action = instance.GetAction(functionName);
Action<T>? other = instance.GetAction<T>(functionName);
Func<TB,TResult> func = instance.GetFunction<TB, TResult>(functionName);
functions[functionName].Add(other);
functions[functionName].Add(action);
functions[functionName].Add(func);
thanks again @rich adder
it could be a potential code smell ngl
you lose a bit of type safety, might need to use is pattern and manually know params for each delagate
Ok can someone help me????
For some reason is the player reset / respawning now broken in my game. It was working before.
I was able to trace back the error to the player initialize method.
private void Initialize()
{
if (this._isSetup) return;
this._isSetup = true;
LoadPlayerModel();
LoadingscreenManager.Instance.Stop();
this._playerCameraHolder = Instantiate(this._playerCamera, this.transform.parent).GetComponent<PlayerCameraHolder>();
this._playerCameraHolder.SetCameraTarget(this.transform);
Debug.Log(this._playerCameraHolder.name);
}
When using the debugger I can see that the playerCameraHolder object gets successfully initialized and the method SetCameraTarget() is working too.
But once the last line of the Initialize method is run it just gets stuck and the camera doesent exist anymore and the loading screen is still running.
It looks like unity forgets that it had run the initialize code????
But once the last line of the Initialize method is run it just gets stuck and the camera doesent exist anymore and the loading screen is still running.
what do you mean by this?
are you getting some sort of error on the last line?
no thats my problem. I dont even know where to look anymore
I am going to be honest. I do not like this wasmtime api and may try to find alternative runtime bindings or make my own. On the flip side when you are trying to point a c# function to the wasm function you call Function.fromCallback, it has 130 overloads of <T T1 T2 TResult> so that means if I want to write wrapper function I also have to make 130 overloads because not one of them accept Delegate smh
This is the only things that I get in the console:
The first thing is a debug.Log from my player object.
The seccond is only once and is from the loading screen camera.
And the third is from the player camera that should have been initialized in the code above.
then answer the question in the message you just replied to
And I dont understand why I get the warning. The loadingscreen eventSystem should be disabled before the player camera gets instantiated
I'd start with investigation the loading screen. How does it work? How is it supposed to be hidden? Is there a possibility of 2 screens existing, so even if one is closed properly, there is still another one? Or maybe it gets reactivated again? You can confirm these things with logs or breakpoints.
No I checked there is only one loadingscreen and its deactivated when respawning the player. But it looks like that for some reason there are two event systems active when respawning. But I only have one event system and that is a child of the player camera so the old event system should have been destroyed.
Then it haven't been destroyed. Add logs/breakpoints where it should be destroyed. To see if it corresponds to your expectations
I already did that. I can even see it being destroyed in unity
Well, that contradicts what you said earlier(that there are 2 of them).
And I just checked. There is only one event system in the scene.
but it gives me the error that there are more than one event system in the scene o_O
Then you must be creating new ones.
trying to learn about state machines right now
for some reason im getting error CS0122 saying that my statemachine is inaccessible due to protection level. However im directly calling the statemachine, afaik
if you want me to put the code in blazebin i can, but everything is fairly small and straightforward, very confused on why im having this issue.
You need to read the error more closely, it will tell you precisely which thing you're trying to access that doesn't have the correct protection level
It's not your "statemachine"
I wrote some code in the EventSystem.cs from uity to print out every event system and its parent when I get that error now. And it only prints one.
@jaunty junco are you using additive scene loading?
Is event system your own class? I wouldn't be using that name, as it might conflict with the unity types.
yeah. but the problem appears when every scene is already loaded for multiple secconds
does each scene have its own event system
no its the unity class. I just wrote the code for debug purposes now
And more importantly confuse us
no there is only one event system
Then I don't understand what you mean by "wrote some code in EventSystem.cs". If it's unity's file, you can't do that.
you can. Unity gives full code access to things like UI components etc.
Do you mean that you modified the package source code?
yeah but only with debug.log
Im gonna delete it once I fix this
And it prints?
Yeah
Can you show that log in the console(with a callstack) as well as the source code?
yeah one sec. This is my scene structure when running the game. I marked the only eventSystem
source code for what. If I send everything it will be too much
try searching t:EventSystem in the hierarchy tab to see if you maybe added an EventSystem on something else by mistake
I wonder if there is a default one on the canvas...
Let's start with the log and it's stack trace.
nope ony one event system.
One is likely being made and put into don't destroy on load, and the other in the standard hierarchy
Ok I think I know where the error comes from now.
I call the initialize method in the Start and the OnNetworkSpawn()
You've yet to show the log you "added in the event system"...
No I already checked that.
its the middle one
ive messed with the inheritance for a while now and cant find the issue. Statemachine.Switchstate(state) is unavailible. Ive checked all 5 scripts and changed the inheritence, even removed the protected from the PlayerStateMachine but that still didnt fix it. Not asking you to help anymore, as i have to sleep for work tomorrow, but goddamn this shit frazzles my brain too much.
Great. BTW, you can see that in logs or during brrakpoints(by looking at the callstack).
nvm I already commented that out thats not the problem
At this point I'd recommend to post in #1390346492019212368 as this is not the correct channel.
But it doesent really have anything to do with networking. Its only on the client side...
If so, then you should be able to debug it with logs and breakpoints.
Identify the calls that should not be happening. Place a breakpoint/add logs. Check the callstacks, object/reference IDs.
Ive been doing that for the past 4 hours... I dont know what to do anymore thats why I aked here
Debugging flow is very simple:
- does something happening even though it shouldn't?
- if yes, add logs, breakpoints and see where it is called from and why.
- Does something not happen, even though it should?
- if yes, find the place where it should be called from and investigate why it doesn't.
And we can't help you, since we don't even understand these should happen/shouldnt happen things in you project.
You need to provide exact lines of code that do/don't get called and are related to the issue.
Normaly it should just spawn my player camera and set the player object as the target for cinemachine.
OK, so it should be called but it doesn't?
This gets executed. But for some reason gets imidiatly destroyed and I cant trace back from where and why
it gets called but it doesent stay
Add a log in on disable and on destroyed. And look at the callstack.
OMG I GOT IT THANK YOU SO MUCH
One of my team members made the player camera a singleton. And didnt do a propper cleanup on destroy. So it deleted the new camera everytime.
IM GONNA BEAT THIS FUCKER
THANK YOU SO MUCH
How to improve performances with +1000 navmeshagents
why its not show game over when character tuch colider but its only show game over when character jumo and tuch top side of cloider
Your first condition is "if grounded" .. when that is true, the else if doesn't happen.
i chnage x and z value like -9.5 and knowits wokring but player still not cloide but when he jump andtuch top part of object its colide like there ground exist
I've explicitly told you what the issue is. Why are you messing with gravity? 😄
why unity code work but not my
That won't work.
i was do that before read your reply what you saing is true thanks i undertsnad but why them my code work when i chnage settings
Well, CollisionEnter.. might not check the ground if your walking along it as it called it once. Then calls it again when you hit the obstacle
still not work
how do I refrence this in code?
I want to switch between objects when clicking a button
that mean unity teacher lie to me

Just to make sure my understanding of LateUpdate is absolutely correct, it's an event that only triggers after all scripts in the scene have completed their Update functions, correct? If so how can I accomplish something like this but for FixedUpdate?
Script execution order, but I'd recommend not to.
If you need something like that, there is probably an issue with your code architecture.
As in I would need to combine the tasks I want to keep from stepping on each other into a single script to make sure they always execute in the proper order?
Kind of. Doesnt have to be in one script, but you'll need some kind of orchestrator/manager script.
The idea is that I have a jump script and a move script, but want to project the gravity vector along a plane after both the move script and jump script have already calculated what vectors they want everything to go in
Honestly, I wouldn't split movement and jumping into 2 scripts. These seem to be extremely intertwined functionalities.
If you say so
And even more so if you also need to modify the gravity direction.
anyone using vs2026? the intellisense is broken and nothing works?
can someone confirm
this is what i get
I've seen one other person talk about VS2026, and they didn't mention any problems with intellisens - even saying this version is quite good and to check it out
oh nvm i had to reload the project. https://discussions.unity.com/t/unsupported-project-type-in-visual-studio/835533/7
ty
I don't think there's a problem to separate jump and move into two different scripts . . .
but why would you?
That would be composition based design. Our move and jump scripts for enemies are seperated
Hey guys. I'm having an issue with inputs and none of my solutions have worked to solve it. When I start the game, the first time you press pause using Esc(Player input map for pause is bound to esc and I) pause and resume (bound to Esc in the UI input map) both fire, so it appears to the player like nothing happened. It works fine 2nd press onwards or if you initiate pause via I.
I've got a game start initializer that runs a foreach loop to disable all the action maps and then the player map is enabled, and my debug log confirms the input map is set correctly. My input map switcher debugs confirm switching is happening when pause/ui open events happen and their states are correct at the time of the first pause being initiated.
I have call stacks showing both pause and resume are firing from the same input, despite only one action map being active. I've tried a coroutine in my pause state handler to delay the pause bool check in case it was just checking out of date states and it didn't solve it; I've double checked the documentation and confirmed all my inputs are set correctly, so I don't understand why despite the action map being set to player, the UI one is firing, and why it only affects the first attempt.
Any thoughts would be greatly appreciated.
first thought, just wait a frame
void Start()
{
StartCoroutine(EnableInputsNextFrame());
}
IEnumerator EnableInputsNextFrame()
{
yield return null;
playerMap.Enable();
}``` second thought has to do with the Event System and `Input System UI Input Module` component (as seen in image)
if so, it might be that, that is getting the rogue input (maybe try disabling the component during a quick test and see if it changes the outcome)
-# that's about all i know about the new input system, sorry.. just hopped on and seen the question.. figured i'd start my day by googling a bit.. and this is as much as i can come up with..
-# maybe check out [#🖱️┃input-system](/guild/489222168727519232/channel/763502300781477948/) for more specialized responses 🍀
aye, I tried the wait a frame idea- for whatever reason the first press of esc is firing for both inputs at the same time, so there's no waiting doesn't work, it's like until you've pressed a key, it doesn't matter what input map is "active" or how long you wait, it will register on all of them and only after that will it actually take notice of the map selection (as best I can think to explain it anyways)
I did try fiddle with the input system UI input module and the input action panel and it started firing off warnings about them having to be set a certain way or risk UI inputs not working, but even with ignoring those warnings it didn't change the 1 press 2 action maps fire, so I put it back to what it was.
Didn't know there was an input system channel (isn't on my list) so I'll pop over and check there, thanks o7
Are you using the new input system?
yeah
You could share your code and explain how you hooked it up to the inputs as a start
Can you show us your code setting up the inputs
Oh lol
The standard workaround is waiting a frame
Hlo seniors greetings from me I never used c# so can someone have any notes that can give me some basic grab so my brain can get motivated (all is well)
Umm reply when you are free seniors I can wait (all is well)
again, there are beginner courses pinned in this channel
We value specificity here - if you have a particular goal or type of video game you wanna make, please say so we can tell you the required steps regarding C#
Senior but there is no pin 📍 like I'm seeing
Got it senior
Srry for my stupidity I thought it is in chat
lack of knoweledge != stupidity
⭐ hi all, what are your thoughts on "equipping" a Rigidbody object? (like to the Player's right hand or left hand etc)
Currently I have avoided setting the transform / rotation every frame, by simply Destroy() the Kinematic Rigidbody and SetParent to the Player hand_right. Obviously that's not fantastic - actually ultimately would prefer dynamic RB too.
Would it be valuable to have a child GameObject that has the Rigidbody - and disable that? I wonder when re-enabling if it would trip up the Physics system. Or is "Rigidbody on child GameObject" a no-no 🤔
Maybe I should just leave the Kinematic Rigidbody on and set transform every frame? But that feels inefficient.
Thanks.
Once it's kinematic it will follow its parent object without you doing anything extra
Is your player Rigidbody based or something else?
This is not the case, where did you get that info?
the Player is a CC, but I have an RB version too.
Wait.
experience
this is the case, you have something else going on if this does not work that way
like for my old game with character controller i had "gravity" coming from animation root motion when i did not know what i was doing XD
U would likely have to stick to a kinematic RB in the case of weapon or similar
Kinematic RB does stick to its parent's transform
@wintry quarry @rich robin @hot wadi Wait ... No, no it does not guys.
Kinematic RB does not stick, idk what you're talking about 
it might only if the parent is a dynamic RB? I'm pretty sure it does 🤔
itemToTake.transform.SetParent(rightHand.transform);
Destroy(itemToTake.GetComponent<Rigidbody>());
itemToTake.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
Okay, sure yeah. Maybe only in that case.
Can confirm - without Destroy the Rigidbody it doesn't follow correctly
are you certain it's set to kinematic?
Yeah
yes you are trying to compare a bool and a Vector3 with ==
that's exactly what the error says btw
You are checking if m_playerInRange is equal to a position. A boolean is not the same thing as a Vector3
now you're trying to assign a Vector3 to a bool variable
You are setting m_playerInRange to a position. A boolean is not the same thing as a Vector3
only bool can go in a bool
you can't put Vector3 data in a bool variable
bool is only true/false
Pro tip: write out the goal of the code in comments step by step. Like
// Check if object is in range
// Assign object position to ...
// Whatever else
Then you might avoid, uh.. setting a true/false value equal to a transform.position
you copied something incorrectly then
but this persons code works and mine doesnt
As soon as possible, switch to "I actually know what this does"
Show the tutorial
you copied his code incorrectly
"I did it exactly like the tutorial so why does theirs work and mine doesn't" counter:
Number of times it wasn't exactly like the tutorial: 194
Number of times it was exactly like the tutorial: 5
Number of times the code literally did not exist: 1
2022-07-19 to 2025-10-07
OH GOD THERES A COUNTER
alright ill be back to fill in the rest of the 6
thanks yalls
Does it stay in the air or just jitter a bit?
@wintry quarry @rich robin It was a weird behaviour where it floats around seeming to react to the parent transform.
⭐ It's because of Interpolate
that a child Kinematic Rigidbody won’t reliably follow its parent when its Interpolate is set
https://discussions.unity.com/t/attach-a-kinematic-child-rigidbody-to-a-parent/916865/7
Thanks guys. I guess that makes sense, interpolate is never used for Kinematic RB anyway right? Since it's moved directly 🤔
Probably becuz physics updates happen in FixedUpdate() whereas animations are in LateUpdate()
When interpolation or extrapolation is enabled, the physics system takes control of the Rigidbody’s transform. For this reason, you should follow any direct (non-physics) change to the transform with a Physics.SyncTransforms call.
Unity Scripting API - it seems the root issue is that Interpolation yields control of the transform to the Physics System. Physics.SyncTransforms syncs things back up
yeah
well
it is used if you move the RB via MovePosition
but if you're moving it via moving its Transform parent then interpolation is just an impediment
I've never touched those settings so it's new to me too
I am just starting with unity and finished this flappy bird tutorial, he said to try and figure out how to make it so the bird doesnt score once you die, I use the same process that he did in the tutorial to reference another script but it is saying that the script cant be a logic script for whatever reason
heres the bird if thats of any help
I just need to reference the bird so I can have the pipe middle script check if the bird is alive
Your Bird is of the wrong type
You are trying to get a BirdScript and assign it to a LogicScript . . .
It has to be a BirdScr ^ yeah
oh
You defined your Bird variable as a LogicScript on line 5
The variable is whatever type you write
Thanks
that makse sense
They are only, the type that is defined
the funny red line is gone yay
You can’t put a string into an int variable, same for a LogicScript into a BirdScript
Programming forces u to pay attention to small details
Ignoring small details for long enough is how you end up with 30 runtime bugs 🤣 or unintended behaviors
For whatever reason I thought that logic script was the variable type for all scripts
You wrote that your Bird variable is a LogicScript type, but when using GetComponent you are attempting to get the BirdScript type . . .
If it helps, u should stop putting “Script” in the name to avoid confusion. Just write BirdController or LogicManager
How so?
Yeah I think ill do that
Because I started unity yesterday
Trying to mod silksong
but gotta learn unity first
Remember to always dig deeper into the engine to fully understand what’s really happening
modding discussion isnt allowed btw #📖┃code-of-conduct
oh sorry
Like a sort of management game?
A game where you ban people who talk about modding games 🗿
And for every one you let slip through the game itself becomes more modded which makes it more difficult
Your glasses fog up the longer you read the chat, then you can’t see at all
Papers Please ahh idea 😆
In this case the problem is that I can't guarantee that gravity is applied after both the jump script and move script have completed their operations for the physics update
Hey guys, just a quick question:
Does UGS (Unity Gaming Services) Analytics require user consent like a pop-up message asking them if I can collect a few basic info?
ConsentState state = EndUserConsent.GetConsentState();
state.AnalyticsIntent = ConsentStatus.Granted;
I saw it automatically sends data to analytics like that in addition to what I would try to collect (map, game mode, kills, match length, etc.)
Event gameEnded {
"batteryLoad": "",
"buildGUUID": "",
"clientVersion": "",
"collectInsertedTimestamp": "",
"eventDate": "",
"eventID": "",
"eventLevel": "",
"eventName": "",
"eventTimestamp": "",
"eventUUID": "",
"eventVersion": "",
"gaUserAcquisitionChannel": "",
"gaUserAgeGroup": "",
"gaUserCountry": "",
"gaUserGender": "",
"gaUserStartDate": "",
"gameBundleID": "",
"idfv": "",
"mainEventID": "",
"msSinceLastEvent": "",
"platform": "",
"projectID": "",
"sdkMethod": "",
"sessionEndState": "",
"sessionID": "",
"timezoneOffset": "",
"unityInstallationID": "",
"unityPlayerID": "",
"userCountry": "",
"userID": ""
}
Thanks in advance!
You can create a third Gravity script that has a reference for both the Move and Jump script with custom OnFixedUpdate methods (instead of using FixedUpdate). Inside of the Gravity script, call OnFixedUpdate for Move and Jump in the order you want, then apply/update gravity. Here's an example . . .
public class Move : MonoBehaviour
{
public void OnFixedUpdate() { }
}
public class Jump : MonoBehaviour
{
public void OnFixedUpdate() { }
}```
```cs
public class Gravity : MonoBehaviour
{
[SerializeField] private Move _move;
[SerializeField] private Jump _jump;
[SerializeField] private Vector3 _value;
[SerializeField] private float _scale = 1f;
private void Awake()
{
if (_move == null) _move = GetComponent<Move>();
if (_jump == null) _jump = GetComponent<Jump>();
}
private void FixedUpdate()
{
_move.OnFixedUpdate();
_jump.OnFixedUpdate();
// Apply gravity here. This is random code, BTW!
_value = Physics.gravity * (_scale * Time.fixedDeltaTime);
}
}```
hey so like how do you check if an object is colliding with another object continously? cuz stuff like OnCollisionEnter only checks for it once on the first collision iirc
whats the command to pull up the instructions to get visualstudio to autocomplete and highlight code properly?
OnCollisionStay
in this discord i mean there was a bot command
!ide



