#💻┃unity-talk
1 messages · Page 17 of 1
only this part is hard and im working on it for a couple of time
Hi. Is it normal that when I enable the terrain (no trees or anything), it takes more than 3.5 ms more to generate the frame...? Is there a way to reduce the terrain's impact on performance please?
so...i noticed one thing. while making the spline, i thought that the spline knots would make it such that the mid point of the duck would be present on the knot, instead, it's the head of the duck which is present on the knot. is there a way to somehow offset it?
Sounds normal. Nothing in this engine was intended to be streamed.
your pivot point on your sprite is likely off
oh yeah...it's off, it's its head
that is what is considered the "mid point" of your object. you need to adjust where the pivot is
oh...then what can I do to create a more performant terrain? Any suggestions? I don't really need up close detail as it is a flight simulator, so I need a huge terrain but I don't know how
I just leave them enabled at all times
If that doesn't fit in memory, you could bake them to meshes and stream the textures on that.
Not caring about the 3.5ms spike is also viable though 😅
Hate to say it but that's a single frame drop at worst. It's not something people will notice.
no no, I mean like it takes 3.5 ms constantly, not as a spike. Like it is reducing the performance a bit too much imo
What's the pixel error value?
5 is the pixel error value
it might also be that there are a lot of terrains
255 small terrains, I don't know where I read that it was better to have them separate into smaller parts
Oh that's definitely too many
how do I reduce the count but with them still being rendered far away?
You'd have to re-create bigger ones.
like this is the difference between terrain and not terrain
Is this 3.5ms in the editor?
hmm okay, how many should I have in total more or less? Or is there a way to make it so the further the terrain is, the bigger it is?
yes
oh okay. Thanks
last time I tried IL2CPP a lot of things didn't work tho, but I'll try. Thanks
also consider using the profiler for more accurate measuring of performance issues
The only thing that doesn't work is System.Reflection.Emit
i reset the pivot and saved it. then i delted the sprite renderer component from the gameobject and added it back again with the new sprite in question. it's did not change the pivot at all
I tried, but I honestly don't know what to look for for rendering profiling😅 (this is disabling the terrain, that's the down spike)
I do use System.Reflection, but I'm not sure if I use System.Reflection.Emit, I'll check, thanks
if i had to guess, then i'd say you either didn't actually save/apply the change, or you are editing a different file 🤷♂️
i saved it 
ctrl save, apply changes everything
😭
wdym "ctrl save"? did you click the save button in the sprite editor?
and no, i don't mean "press ctrl s"
The extra empty space doesn't affect the pivot right?
it might if you use autoslicing
when it was unedited before, the pivot was set at the duck's head, then i manually repositioned it to its stomach
So the pivot shown by the editor is the original pivot point it had automatically set?
no, i repositioned it
Repositioned it which time? I might have not said that right, but I mean the pivot point shown in the second image here, not the sprite editor.
Or did you reposition it once before to where it shows there?
when i opened the project, the sprite pivot was set at its head(in the scene and in the sprite editor), like in this pic.
then i went into sprite editor, and repositioned it to here
But it's still acting as though the pivot was set here
make sure your tools are on pivot mode rather than center mode
the head is in the center of the sprite, so if it's in center mode the gizmo will be placed there
this thing?
nope, in the scene view
there should be a box in the top left that says pivot or center
oh ya it worked thx

Does that fix the original issue as well?
the duck is staying in the path hehe
Now i have much more problems to fix.
how do I spawn a camera and write the world normals of everything that camera sees to a rendertexture? I've read about RenderWithShader and it apparently isnt supported in urp and I have no idea how else to achieve this.
hey is anyone else seeing this error message in the Event Browser of the Unity Analytics dashboard?
What do you need this for? Urp can optionally make a normals texture even when not using deferred
Otherwise you may want a custom pass to perform this job
I'm playing around with a rain system and I want to spawn rain impact vfx at the correct height using depth (which is easy to get) and at the right angle so it splashes differently depending on the angle it hits. therefore I need normals which are hard to get
But having normals in a texture would only help for screen space rain
if I spawn a camera looking straight down that captures the entire play area that gives me the normals for all the surfaces from the direction (which the rain will also fall from)
I dont need those normals updated. spawn cam, snapshot the normals, reuse
thats why I'm unsure about a custom pass cuz they run all the time (I think?)
Hmm right. I forget if or how we now do a render "now" for a camera with override materials.
How to change 3d pivot btw
either make the mesh a child of an empty object which you position as the new pivot or you modify the mesh in your 3d modeling software (ie Blender) to adjust the actual pivot
there are tools on the asset store that can do this for you
is the grayish circle to the right the pivot point?
Unity should natively allow this it would be very nice i was having hissue with the terrain generation when i was trying to generate structures i tried changing pivot in blender but i think some kind of precision error is coming in unity editor
Unity just uses the vertex coordinate data 
HA
I managed to figure out the animator component with no tutorials
gun animations work
I'm going up the world
now what do I do if I were to add a view model (assuming it's rigged) to the animations
if anyone has an answer, please ping me.
make sure you didn't check in anything you weren't supposed to
you did use the unity gitignore, right?
hi, my player has a reticle UI image, I'd like to make it bigger when it's on an interactable item, I've a good interacting system that works, it simply calls a SetInteractScale(); function when the raycast hits an interactable item and else{SetNormalScale();} here's the script that has those functions: https://paste.ofcode.org/3aiewaVavgf5yAbCndqFGQ8
the problem is that the reticle doesn't scale anymore
doenst scale anymore? so it has in the past?
yes
yesterday it was working, now that I just opened my project It doesn't work
IDK if this is the correct channel but....
I did add one which made me sure about the problem either comes from the script I've just sent(logic wrong) or it' s an issue with the UI image/ canvas in the setup, but I don't know about those..
you mentioned a raycast as well. debug that too
well there's no need
the raycast is for the player to interact with objects,I tried to interact and it works, and if the debug in the other script gets debugged, that means the first one calls it meaning it works lol
How to setup movement with animations?
a function/Script should only do one thing, so if i am moving jumping character using one script then setting animations in it too.
if i press jump, i do anim.setBool(jump,true)
whats the better way?
it gets confusing cuz its in middle of other code too
@viral hill please help me,I'm really stuck and confused...
what is gameJam guys ?
Make game in time limit
ooo i see and any rewards ?
1 million dollars
Ask whoever's running it
For the Unity game jam? No.
effectively 10k
Pro licenses feel like such a non-prize (unless you're an indie studio taking part).
the real question this year is, how many awards will code-monkey get?
Yeah, Pro isn't worth much these days if you qualify for Personal.
Still, it's something
Curious if the license is like 5 codes or one code with 5 seats (ie if you were a team of 2 you could have 2 years worth)
The good stuff from paid licenses is premium support and engine src access
licenses are all per-seat, there is no floating license
you can manually float it
Are they? Wouldn't know ive never paid for one
suppose they mean to give everyone in the jam-team a license, not just one of them
I think the idea is basically "If you made something cool enough to win this jam, here's the licenses to turn it into a full-fledge game"
Engine src access as in you get to read it or as in you get to edit it?
nobody gets edit-source access
even if you have source access, its not exactly easy to actually get even read access
Read for sure but I think you can modify and recompile the editor but I forget if that is something extra
Was asking cause what'd be the point in reading the code if you cant edit any of it
Oh it'd definitely be helpful
Its useful to see the src but if you have premium support you can get actual help with issues and bugs
premium support isn't that useful though, the only semi-useful support is by hiring one of the success consultants.
which also drains you bank account - fast
I tried to cover that with the bit in brackets
Yeah, not quite as useful if you're already a major studio, but if that's the case you've probably got better things to do than smurfing in a game jam
I don't know how quickly tickets get responses (only used it once) but they have the power to find work arounds with bugs and such
possibly, it just not something accessible to indie game studios that dont already have a massive hit
I'm pretty sure there is a level where you can get source access. The devs who made Inside did a talk about the development of it, and they mention having source access and having to change something to fix/ improve/ whatever (I forget, I saw it years ago)
Yeah, a few studios do
we have a source license, but we can't just download the source code
its perfect and hi guys
We had a presentation with unity to tell us about it but I never got to see the src 😢
imo unity is one of these engines where, when you make a game that needs engine changes, you should be using a different engine anyway.
Tbh thats true but I guess the option is there for the customers who want it
if ur needing something the engine doesn't handle i would assume ur in the realm of making ur game from teh ground up anyways
Yeah I'm in the process of developing one for my next project.
I'm happy I at least ran into Unity's limitations hard enough to know exactly what I need from an engine though 😅
go make your own SRP and and use DOTS for everything, that gives you more power than any engine otherwise available, from the raw technical capability... but its so much work that it will likely never pay off
SpawnEngine v0.1 *coming soon
but you can view it?
This is another approach I considered, but when I'm replacing most of the engine, what am I paying Unity for? A DX12 driver?
It's not like the editor is exactly ideal for me either
techincally i can request read-access if i can provide a valid reason
if the editor platform isnt useful to you, not much, some asset plumbing maybe, bunch of SDKs and integrations.
It's not non-useful but it does get in the way a lot
its certainly more painless to publish to consoles via unity than via godot
ohh, okay that makes sense..
and i bet w/ that license you get pretty immediate support
just a regular industry license
immeditate support comes from actually knowing people at unity that have something to say 🙂
technically, if you make adequate community content (via yt etc) you should get some form of more direct access.
but i doubt anyone who doesn't make millions in revenue will get any kind of real priority
imagine you'd get priority by your helpfulness on the unity-discord. that would be a novelty.
Just support yourself 
thats the best plan
be the expert yourself, i heard you can even get paid for that 😛
PatOnBack(deadline); 😉 I always treat myself after a technical challenge..
computer rec time comes only after a solid accomplishment (works for me)
Hello everyone 👋 Hope you're all having a marvelous day!
I've been adding and testing Script Templates for a day or so
I'm almost 99% certain it's using the Monobehaviour Script I have highlighted above..
but ❔ I've been wondering *is there's a way to change what file the Editor uses when you create a script via the AddComponent Inspector * button..
Shocked people actually make new scripts this way
But fair question, i also started working on making scripting templates recently and was curious how to mame them show up at the top with monobehaviour
been using my own templates for a while here lately..
Shocked people actually make new scripts this way
^ I don't very often.. but theres times when im working on a large object (w/ many pieces) and its times like those where I may use the AddComponent just so It'll have it attached automatically and I wont need to lose my place and go down thru the hiearchy to attach it..
yea, im more curious than anything.. ¯_(ツ)_/¯
I also noticed while working in the Script Templates that these two menu items are the same thing
[is there's a way to change](#💻┃unity-talk message) what file the Editor uses when you create a script via the AddComponent Inspector button.. but anywho if anyone knows ping or reply.. (its not super important.. i'll just keep it in mind)
Quite a few, oh do you know of any way to add scripts that i can use to inherit from like the Monobehaviour.
ie i have a script teamplate that inherits a class that doesnt exist in the unity library
if ur talkin about script templates.. the only things i can think of is having a hard-coded reference in ur template
where u have already added the base class to the project..
// DEPLOY
using UnityEngine;
public class #SCRIPTNAME# : SpawnCampBase
the other way would be a bit jank...
where you could do something like:
public class #SCRIPTNAME# : #BASECLASS#```
where you'd have an editor script that replaces the placeholders
```cs
string scriptName = "NewClass";
string baseClass = "SpawnCampBase";
template = template.Replace("#SCRIPTNAME#", scriptName)
.Replace("#BASECLASS#", baseClass);
Ah alrighty so what i had done was curious if there was a "proper" way, ty though.
🔗 https://github.com/SpawnCampGames/SpawnPocket/blob/main/PocketScripts/Editor/InheritanceScriptCreator.cs
-# edit: A text prompt to name the script during creation would make it even better.. just threw it together.. and currently it'd be a pain to immediately right-click to rename the filename and then go into the script to rename the class as well..
lol.. not sure its proper.. but it works 🍻
hi guyssss, is anyone going to unite in barcelona next week??
Can someone recommend me some good free water systems for URP?
**
Script needs to derive from MonoBehaviour
**
All it takes is 1 search...
are you talking about a water sim?
@dapper dove If you have questions, start by asking one, there's no need to "hi" in every channel.
i know
!ask
:thinking: Asking Questions
:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #🔎┃find-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.
-# For more posting guidelines, go to #🌱┃start-here
btw im german so if my english is a bit bad then uhh yeah
Anyone had an issue with the "Start Host" Button not doing anything in the NetWork manager?
You should ask in #1390346492019212368
Alrigth. Thanks!
In FPS games, the guns - are they usually multiple models or 1 model?
every game is different
And how would you normally go about animating it? Would you create a rig for it or animate each individual part (ie, magazine, grip, etc)
Mmmkay
I think in most cases people would rig/animate it the same way you do any other 3d model
but since they're mostly made of rigid parts you can probably get away with manual animation using separate renderers if you really want
What do you mean by seperate renderers?
not sure how to be more clear about that tbh
separate GameObjects
each with a MeshRenderer
yeah I don't see why not
and I assume the magazine would be seperate, since it has to be removed?
I love spying on this channel so if someone gets their problem fixed, I won't have to worry about asking for help in the future.
!collab
:loudspeaker: Collaborating and Job Posting
We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
• ** Collaboration & Jobs**
hi,I'm trying to set a GameObject active in a script but he stays Disabled, what might cause this?
I've checked my script several times but I can't understand what's the issue
what might cause this?
the code not running would cause that
A game like Escape From Tarkov, which has modular weapons, would that be modelled with each part seperate?
Said no German ever
what do you mean by that???
#1180170818983051344 to show off your work and get feedback
10 point deduction for posting outside #1180170818983051344 or #🏆┃daily-win
not bad
❤️
if you drag the compilation window around a bit faster it'll speed up the process
You're being too nice
you dont even have to spy.. it'll record and catalog every problem, every solution
thats exactly why we tell people that ask for help in DMs to ask here instead...
there's always someone that comes along with a similar problem
yeah I will pretend like y'all do threads
Well if said problems are in threads they do happen to be deleted after 30 days of inactivity
ahh thats true thats true..
exactly
but he's running....
I just look when im bored lmao
well not only have you not shown code, you've definitely not shown any proof that the specific line of code is running
you can actually get alot of inspiration from just browsing around.. 👍
what
please make a scripts folder, holy bloat
now show how you verified that the method is running
I forgot to make one but to be honest I don't like to be super organized, it's not that I don't like it but it doesn't change anything with me
the more you build your game the more stuff you have
make folders and stay organized or it'll become a where's waldo book
t: script has you covered
and that ig
Anyone knows what this is, i downgraded from a rtx 2060 to a gtx 960 as i broke my gpu fan, the game took like 12 hours to compile as if it was the first time now it gives me this and doesn't compile
some people work in the heat of passion..
scripts get all willy-nilly..
then on some of the calm days.. you can go in and reorganize 🤪
well the script contains a lot of interactions and when I enter playmode all the interactions work apart from the notes interactions , if you want I could you show a record, so you can be sure I'm not telling assumptions
Somehow i doubt you'll ever land a job in game development with this type of ideology :/
lots of shader errors 👀
ty so much,I didn't know about this
same thing works for Materials, etc
"i'm not telling assumptions"
and yet you're not actually verifying anything so yes, you are making assumptions again. and i'm done helping you.
Love that a folder would have had them covered from the start though
im just so freaking exausted, this thing breaks out of nowhere, the scenes randomly turned white and emissive, now this
sometimes, I make folders for everything, sometimes I don't but yea I mean everyone has his own way to work
and gpu is brokie
true true.. i just try not to critique peoples work-flows.. especially if they're solo
I got folders in folders when it comes to the script folder lol
ocd-ish when I organize lol
Gendering people to a "he/him" wow
what
Fair fair i normally dont care either but this just hurts to look at
im an organizational freak.. ironically
what matters in the end is if the player enjoyed the game, this would be only problematic if they enable version control for building with other people... or ask for help here
Well another problematic case is if players liked the game, got promised for future updates, game became a development hell and those updates never came
some developers might have horrible organizing and still update their games
it's about muscle memory sometimes when it comes to knowing where something is
man?? I'm sure about what I'm telling you, sorry if you think I don't care or simply don't want to find the answers/solutions to my problems, that might be my way to talk,I'm not used to talking with people, and when I tell you the script is running, it's because I'm sure, those might be assumptions from your point of view as you can't be sure, but it would be a waste of time sending you my whole project setup with everything in it., the only time I was wrong was with the animation clips that were swapped but it was really a dumb mistake from me,I didn't think the "close" animation clip would in fact be an open one,I'm sorry, I really appreciate your help and I try my best to make you able to help me.
everyone has their own workflow
imo ya'll just focusing on unnecessary evils.. its very rare you'll need to peep their project directory to troubleshoot something.. if they're not giving you all the pieces to help simply ask for relevant pieces.. or just let someone else 🫠
and all the "what-ifs"...
what do you mean
wild comment.. since its typically thoughtless slang..
"hey guys!" 👀 he just didn't... he... ?!
You said "but yea I mean everyone has his own way to work"
Just pointing out that not everyone is a he
is that incorrect to say in english?
or is that some sexidk what bullshit
English is probably not his first language
Yeah you'd use "their"
Fair point -w-
native speakers mess up their there they're too
when someone asks you how you have verified something you need to actually verify it and not just assume it's running because you think things are running. clearly the object is not getting enabled which means the mostly likely reason is that code is not running. so PROVE that it is running with empirical evidence. don't just do nothing and think it is running
yes my bad, english isn't my first language, everyone makes mistakes
ur fine mate.. lol
I commonly mess up the words in, on, and at
yup.. people are asking for verification for a reason... it'll likely cut out a big chunk of unnecessary problem solving @glass kraken
true
assumptions are the worst during game-dev
One i hate seeing messed up is "a" and "an" (mainly in spelling)
ah nah
they become muscle memory at this point
really annoying to mess them up
I hope we focus on unity talk and not languages ^^
if I have a script that opens 2 doors, if one door works well but the other doesn't, can I be sure the script is running? I've thought yes but maybe I'm too dumb and it's wrong
if only there was a simple way to print something out in the console letting you know it is..
alright, if you're just gonna fucking argue about actually verifying the code is running then i'm 100% done helping you
yea...
deep breathes bro
legit crashout
No
it's tedious yes but not that serious
One of them could be
Literally just put in a debug log. It should literally have been the first line of code you wrote
useless interjections like this are not needed.
That's all you need to do
mine or his?
no, but digi didn't you see? they know their code is running because reasons
confirming the script is running is simple as adding the debug to the Start() method..
I'm not arguing, I just want to learn, I've always thought if something works in a script, that means the script is running, maybe I'm wrong and If I'm, I'll opt for another way to ensure the script is running and I'll stop making assumptions,I've answered using my actual capabilities, the best thing I was able to do...
yours
Start() or Awake() or OnEnable() or even in the Update() to spam a little bit (it'd still let u know its running)
once the script is confirmed to be running. just move the Logs to the Methods your expecting to run
rinse and repeat
sure?
one of the scripts?
One of the instances. The one that is working is probably running
We don't have any info about any of the others
and regarding the logs, I've already some logs in my script
of the one thats being troublesome?
I think I'm gonna head back to my German lesson
so half of the script might be running while the other might not?
So you should probably say what you're logging, where you're logging them, and what they print
i would also like to know ☝️
Who knows? I can't see your screen
yes, but it's a global question, to understand, nvm anyway
there is a single Debug.Log call in that code and it is in an unrelated part of the code. so no, you are not doing any useful logging
if this log gets debugged, the rest of the script might be not running?(not arguing just trynna learn because I was almost sure about it)
And it's a question we literally can't answer without information
this isn't just a matter of "make sure the script is active". i specifically asked you to verify that specific fucking line of code that you are saying isn't working is running
If you get a log, everything in that function up to the point the log prints is running
ohhh okay, that changes what I've understood, I'm really sorry
it's literally what i've been saying this whole time.
welll yes exactly that what I thought
well, I'm really dumb,I'm sorry,I didn't understand it this way
really sorry man
if you have a system of code.. some code relying on other code
(perfect example being a raycast with a if/else chain)
dont just debug at the very end.. and then expect to know the reason its not working when it doesn't get called..
b/c theres abunch of other places that could be stopping it from making it to the end.. and you don't really know unless you're aware of what the code is doing.. and how far its gotten..
its best to log every step along the way.. this way you can Easily see where it stops...
you can then pinpoint your energy in troubleshooting why it stopped there..
- what condition failed
- what condition should be met but isn't
- what variables exist that aren't resulting in the outcome you assume will happen..
-> go to those variables and see why they are the way they are..
this is a pattern of behavior at this point. "verify this specific thing is running" "i don't want to because i feel like it is because something else is working so that must be too"
You know the only way to be sure something is running is by seeing it run, the best way is a Debug.Log("text here");
ooohhh.. yea.. thats more than just code problems.. 🫠
does a rendertexture of type RenderTextureFormat.Depth provide Linear01 depth values?
this could have been solved 4 times over by now w/ simple Debug.Logs();
-# jus sayin 👐
yes okay, from now on I'll debug everything
Fr got an if statement add a debug inside saying it passed, and add an else giving the values of that if to see why it didn't
if ur not having a problem.. theres no need.. thats just silly
Wdym i love outputting Debug.Log($"horizontal value: {HorizontalValue}"); every frame
hell, if it helps.. collapse those iches
just saw it now once again, I don't know why you're the only guy I'm not able to interact with correctly, It's absolutely my fault, I've always been the problem...
ya Allah what is this 😭
are you using visual studio? if so, can you send me in DMS that code colour pallete or whatever it's called (I think theme?)

are visual studio code extensions also available for visual studio?
some, im sure of..
alright ^^
✋ 😑 whos know?💀
Nope. Completely different applications

Anyone familiar with the Particles System able to help me... understand it? I'm trying to create a burst effect but for some reason it keeps varying the amount of particles actually made, well under the Count i put in. I assume I'm missing some setting somewhere that'd affect this? But I'm at a total loss
Max particles is 1000 by default. Could you be over it?
This is how you burst, removing the rate over time and setting a count.
If your count is less than the max particles, it won't go above.
Even with arbitrarily large numbers of Max, I'm still getting 0-2 particles with a count of 4. should I send a screenshot?
yeah, looks more or less like this. 1500 Max, Count of 4, all other settings identical
Are there settings that might restrict or not render some of the particles made? Like Shape restrictions or something?
Have you changed any of it? Try with with a fresh system and only change the emission to see?
fun fact, not sure ive thought about it. but you can save a layout and have the search bars populated n they get saved along w/ the layout file i guess.. ❔ neat-ish lol
I'm at a loss. I set Count to 1, set Duration and Lifetime to both .5, and let it loop- occasionally, there will be no visible particle made, but the little Particles box over the scene still maintains a constant count of existing particles as 1, so I have to conclude I'm just getting invisible particles sometimes and have no idea why. And this is from a fresh Particle System
Where are you putting these particles?
wdym by where?
I have found my issue and as is tradition I feel very stupid but now I just want to ask more so I understand. When I was first experimenting with the System, I put the texture of The Particle in the Shape section, because I didn't understand that Shape manages the... emission pattern? I don't really know, but it's not the particles' shape. I had left this texture there and removing it fixed it, but what exactly does a texture do in that section?
can some math wizard explain to me how I can convert a normalized directional vector into euler angles?
Hey so I have a shader graph that makes this flashlight beam and it’s brighter at the base than the tip but I want to flip that. Anyone know how by chance?
I can give a better picture of the graph parts if need be
one minus
Tried that
Just like deletes the shader
Put it between the divide and saturate nodes
Do it as literally the last thing
Between that and alpha?
For whichever one you want to invert
can u edit the uvs or are they used for smth else?
easiest way of doing it while also having a smaller shader graph would be a uv projection unwrap from the side
Forgive me for being stupid, but do you mean to flip everything z-wise?
I suppose but I’m not sure I wanna call up Miss blender quite yet, seeing as I have to use this shader again on different objects
Don’t get me wrong it’s a great option I’d just rather keep it procedural if there’s any chance
does the light shine towards local Z+ direction? like does the cone get bigger towards Z+?
in the picture u provided is the Z+ axis of the cone downwards?
Oh my god I’m making such a fool of myself (I’m a student, I’m quite stupid) uhm lemme get you a better picture?
and it isnt pivot at the bottom or at the top? doing this with object space positions is very dependant on the pivot
ur using z in the shader so the cone isnt oriented along y
Good holy moly you’re so right
can you select the cone, have the gizmo thingy be in local space and gimme a screenshot of that
What’s wrong w me
depending on how the mesh is oriented maybe nothing lol
alrighty simple fix. just use the y of the position node you've split
I wish it was that easy, it still looks wonky
Might call it a day and head to unity assets
nah you got this. whats it look like now?
Yep that was the issue, I’m gonna try a one minus now
you should just get rid of that one minus u already have
Or I should get rid of the one minus I already have
great idea!
Omg I have such great thoughts
as ur dealing with object space lets say the tip is at y = 3. dividing that by the length (3) gives you 1 so the light is strongest up there. right at pivot level y = 0 and diving that by 3 = 0 so no light
Aha, I love when math
love it when it works (its always maths fault never mine)
Stupid math, acts like it rules the world or something
Okay thank you so much, got it from here
very good :) have a good one
Nope
is there a setting I am missing or are some nodes in vfx graph impossible to find? I always copy paste the velocity from direction and speed node from an old graph into the new one cuz I cannot get this thing via the search
where is it
Started the Unity course Create with Code, and for Lesson 1.2 chapter 6 when the ridged bodies are added, the video shows the vehicle to continue in a straight line, but my vehicle hits the crate and starts swirling around in the air. Like it hits the crate and gets knocked off course and starts spiraling out of control. Ive double-triple checked thee code and everything is exactly the same.
did you increase the mass on the rigidbody like the instructions said?
Do kinematic rigidbodies pass through colliders
yes. kinematic bodies are not affected by outside forces, including collision related forces
idk what they did but the "Browse Channels" thing is basically unuseable - it keeps jittering and moving frantically when you scroll through
in the discord*
anyone else got that problem?
It might be something to do with formatting
yeah seems like it's related to some channels have long descriptions with multiple lines
Ah, well I did now increase the mass. But is there any reason why it still goes off course, unlike how the video shows. Not sure if that matters too much though.
its not flying around in the sky anymore, but doesnt go straight.
what did you set the mass to?
vehicle 100, and the crate 20. BUT seeing he has it set to 1000 and 20, I forgot a 0... man I didn't realize it made much a difference.
Does it make a difference if you use the ampersand & symbol instead of the word "and"? Looking at your first screenshot that seems to be the difference in your search and the node name - it also looks like "set" is not a part of the actual node name
I think ive gone crazy
for SOME REASON, randomly when i open my project ALL the UI elements get changed to have their positions set as (Nan, 0, 0). I have github version control and not a single file has ben changed since it was fine. this makes absolutely no sense, and I cannot continue to fix this every time
If I can't find a fix for this, I might honestly abandon the project
typing just velocity lists (presumably) all velocity stuff and its not there either
fun fact, you might have gotten a response nearly 3 hours ago when you posted that in #💻┃code-beginner if you had provided literally any context instead of a video where you're just wiggling your mouse for the first half of it
Me?
The mouse part are for indication
Xd
I think you wrong the msg
you aren't a toddler anymore, you can use your words
i didn't link any message. i linked the channel you originally posted that in (the one your message says it was forwarded from)
You didn't answer me, you answered and helped another user
After my msg, even there is no reply to me
After and before
i am aware of that. and again, that is because you provided no context and your video was mostly just you wiggling your mouse.
And they're telling you directly why
My context is that I'm making a crouching system, okay? I managed to perfect it (or so I thought) because I'm using Mathf.lerp to crouch and I made an object or ceiling detector above the head to avoid the classic bug of being trapped inside
so what's the issue? is it still getting stuck?
Now, thanks to that math glitch (purely my suspicions), my player is trying to crouch and is pretending to vibrate, since thanks to my detection he can't do that, but I want him to stay at the same crouching height
MY ENGLISH is a dog sh**
No but it's trying to get his normal height
you should seriously give a look at #🌱┃start-here so you know what to provide when asking for help rather than expecting everyone to play 20 questions with you until we get any information
Like changing constantly the crouch height (is 0.6f) to 0.8f 0.758395f
No but my problem is too specific (even tried the Google search)
It's shifting constantly
if it is so specific then it should be easy to determine what you need to provide and how to describe it
Without over passing the ceiling but still scaling
Ok, now to the point
You know how to help me? Or not?
The description is at the video too
*the visual happening
And with this description of words is right
i don't intend to play 20 questions to get more information out of you, so no i will not be helping. see #🌱┃start-here for what you need to include when asking for help
OHHH GOD
Thanks for nothing 👋
Soo why did you replied me if you not know?
Or not will?
I already provided you with the 100% of the info and more
well i hoped that you would get the hint to provide useful information. like, i don't know, maybe some fucking code?
but you don't want to do that so 🤷♂️
It's most a joke the case you don't understand what I'm talking
Yeah I know
So where did you post the code
But a thing you should know
I will, wait
You are comparing me like a 6 years old
So you didn't provide all the info and was waiting for someone to prompt it
That doesn't even know what's a d*MN var
ohhhhh brotherrrr
No, the script is the only thing I didn't sent
Which is basically the single most important thing to finding out why the code isn't doing something
What's a float variable?
: |
I told my possible suspect, the Mathf.lerp
What lerp
you didn't post code
How can I open the editor code
I really think your misunderstanding the point of his message
Just wait a moment, I need to do smth quickky
i've already blocked you, mate. you can stop trying to harass me with pings
I'm having dinner
how did you make the code if you dont know how to open the code editor...?
they're just throwing a tantrum like a toddler, they don't actually mean that
Why do people asking for free help out of the kindness of strangers see fit to make it as hard as possible to help them
fr
Like, the easier you make it to solve the problem, the more likely people are going to want to actually do it
has anyone experienced this problem before / have any ideas for this btw?
that's definitely not something that should be happening. could be an editor bug? what version are you using?
nan usually means division by zero. If it's just UI that's doing it, it's probably something to do with anchoring. Do you have scripts that change their anchored positions? There might be a time while stuff is loading that their width is 0 and that's long enough to break the positioning?
I think if your anchors are based on screen size, the screen loads in at a size of 0,0 before expanding out to fill the screen, so dividing by width somewhere could be causing a problem
I remember seeing this same problem before. I'm not sure how it was solved, but if you search this server for keywords I'm sure you'll come across another thread of someone with the same issue
no, and It isnt during gameplay, it just happens every once and a while when I open the editor itself
2022.3.25f1
i'd consider at least updating to the last patch for that version
but also are you using any UI related assets? I recall one asset i used a while back did some weird stuff when a scene was loaded. it was a michsky asset i think
so all I have is a UI camera with a canvas underneath, with a bunch of UI images on there, and they are all just sprites I made myself
okay so no asset then. try updating to 2022.3.62f3 then
im seeing people have had this problem before in this server, but I dont see any solutions found btw
Is there a different UI package version you can try testing with?
This is the crouch code (it's a screenshot bc Im not at PC right now)
That's why the bad quality
its a really shit screenshot
could you please show the code for the functions you're calling? those are pretty important
then post it later when you are
this is basically worthless
!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.
what?
why you all want my full code?
the rest has nothing to do with it
im showing the source core problem part
because its called! you are calling a function, and we need to seee the code of THAT FUNCTION
you all dont need it
what does ceilingcheck do
what does checkheavyobjectabovedo
what else is touching isCrouching
what else is touching canJump
we need the code for ceilingcheck() and other functions
like dude, THATS PART OF YOUR CODE WE NEED TO SEE IT
why should I put so much effort into getting info from someone, it's not even my problem
i swear this is ragebait
obviously you don't want it solved so why should I?
Even if not full code, you should share it properly as text(or rather code) and not as a screenshot.
what, your lack of ability to provide sufficient information and then blame us?
I don't understand. I just come here, explain the details, and show the problem, waiting to hear what's going on, and now they're asking for my personal information?
ok its a joke example
alright
You're the one needing help here, so if you wanna get it, you should comply with the community norms/rules.
LOOK
Surely you understand that a searchable, copyable text document is easier to work with than a goddamn picture
It's inconvenient. For example for people on mobile. Or for people that want to quote some code parts.
"explain the details" bud we had to basically interrogate you to even get your full code, like you cant come in here expecting us to read your mind and get mad when we dont
You want to make it convenient to help you. Otherwise no one is gonna do it for free.
The fact that I have to explain this demonstrates you literally do not care about courtesy or anyone else's experience and just want a code-slave
I'm not asking you to read minds, I'm just trying to understand how you handle things here. Can nothing be spontaneous?
Why make it hard to help you when you are the one who wants help
ok, can we go back to the issue?
thats uhh... thats why the rules are like... clearly stated in the channels labeled for rules and guidelines
No
Be mindful, if someone requests your code as text, don't send a screenshot!
At this point it doesn't matter, I'm not gonna be the one to work on it
whatever
nooooo, only the lines that land on prime numbers!
I'm done here
no one is stealing broken code
no one is stealing working code either
thats not an example
clearly you
your saying words but thats not what they mean
Maybe OpenAI
deepseek
Trust me, there's a lot of great open source code on the internet. No one will benefit from stealing code in a unity help discord...
hahaha good, i use it but only for making the structure while i have my had on another parts
RELAX, I know ❤️
you use it?
No
Even those who don't use AI benefit from the code to avoid tiring their fingers
doubt 🤔
sigh... there is nothing more I can do here, gentlemen, I had tried. I'm gonna hope my issue with the UI resolves itself with an update and wish you all the best of luck
spoken like a true hardworking individual
or toby fox
Yeah no idea what's up with it other than it's probably a division by zero related to the width but if it's not your code doing it, then I don't know how to fix it
ok so you all know what im talking about here right?
If you still want to get help, I recommend starting a thread in #1390346827005431951 including all the details of the issue and that the shared code.
Because in this channel I'm not even sure what the issue anymore and where it is written.
can you reiterate?
wha-... n-no..? what do you want me to reitterate, find a synonym for goodbye?
the problem 😮💨
I skimmed what you shared... there aren't a lot of reasons a canvas will become scaled to NaN, especially if you have no magic lerping code or plugin.
You could check it all in source code. When the issue happens, you should see it in the meta file changes. But my best guess is something (autosized to text, a canvas scaler, something is bugging)
My gut instinct, assuming you aren't messing with it or having a plugin mess with it - is a bug in your unity version.
Does anyone know a quicker way of transferring textures from blender to unity? I’m tired of applying every single layer
[Unity Help] Rubik's Cube Auto-Solving & Prefab Reparenting Warnings
"Hey everyone! I'm hitting two stubborn bugs on my Rubik's Cube project and I'm stuck 😩. All my relevant code is in the GitHub Gist linked below."
1. 👻 Critical Issue: Instant Auto-Solve
"The game instantly solves the cube and progresses levels as soon as it loads. I believe my CubeController.IsSolved() function is being called in an Update() loop before my LevelManager coroutine finishes the scramble. I can't find the source of the early check!"
2. ⚠️ Prefab Reparenting Warnings
"I also get 'Setting the parent of a transform which resides in a Prefab Asset is disabled...' when the level loads. This happens during initialization in CubeController.Start() and during the layer rotation in RotateLayerCoroutine when I'm temporarily parenting pieces. Is there a better, more robust way to handle temporary reparenting of prefab instances in Unity?"
GitHub Gist (All Code Included):
https://gist.github.com/taizeamaron-lab/b0f67b7eca6fb1b6a07190d4be3c8c9c
And I don't know cooding I'm working with AI's because nobody joining me on project unless I have something to show so, please help with this. I don't understand dev language either.
"Thanks in advance for any eyes on this!"
It might be time for a custom pipeline importer. What's your goal with the texture?
Like, trying to auto unpack it from an FBX, or auto create material if it finds the texture etc.
I also tend to use Better FBX Exporter which has some better texture export options. Not always better for rigged models though...
Like I have a whole node system
Do I have to just give up on that?
Ah bc the nodes don't export and you have to manually apply things to export the texture?
Exactly
Im trying to think how I handled it last time.. I think I just used glb instead... but its been a while. I do most of my texturing in substance or instamat now.
It might not hurt to ask in blender source discord too. I imagine this is an all FBX export issue...
Let me look into baking stuff
Baking a bit of a pain. But I do that a lot when excessively redoing topology
respectfully even if my code worked wonders anyone else that uses it is just plain dumb as my style is way out of whack
is it really that hard to believe that people are capable of creating things with their own hands and knowledge
a screen recording would be much preferred over any photo/video of a screen
Of course cause clearly to get working code, there must be some form of advanced inteligence (human) though this one isnt one of them.
my fuckups are built with my own two hands and my singular braincell 💪
i need someone to help a coder of mine? we are creating a hollow knight fan game, and i currently have two coders and neither really know what they are doing. we are using C#, any help is HEAVILY appreciated
If you have specific problems get them to ask (or you) in #💻┃code-beginner otherwise
!collab
:loudspeaker: Collaborating and Job Posting
We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
• ** Collaboration & Jobs**
oh
If you arent looking for another programmer but do need quite a bit of help you can also make a thread in #1390346827005431951
heyo people! could it be that the 6000.0.58f2 update to fix CVE-2025-59489 disabled loading libraries with DYLD_INSERT_LIBRARIES? Things like BepInEx just aren't working anymore on MacOS...any alternatives?
Sorry we dont help with modding here
aight, i'll just hope for an answer in the bepinex discord
Hey all, getting a weird collider issue. I have a fast moving car and a player with box colliders, and OnCollisionEnter is firing for a collision between the two when they're quite far apart. This screenshot shows the exact frame the two collided at, with the red line being the collision point. They're clearly not touching. Anyone know why this happens?
If the player walks into a stationary car the collisions work as expected, its only when touching this fast moving one
Where's the centre points for each parent gameobject
Are you using dynamic RBs with interpolation and continuous collision detection?
I was, setting both the player and car to Discrete seems to have fixed the issue 🙂
Why does that happen with continuous detection?
It predicts the movement of the object. It's likely that both were moving fast enough that they would actually collide by the next update. Collision is detected in fixed update, so it's not always in sync with the visuals.
Ahh I see
Discrete doesn't do that prediction, so it's less precise, detecting collision only after the fact. Which might result in objects visually intersecting. As well as miss detection entirely if they move past each other within one frame.
Is there any good middleground? I've got high speed cars hitting players in my game, so both precision (at least to the degree shown above) and not intersecting with the car are pretty important.
Continuous is the way to go. They only reason you got that inconsistency is probably due to pausing the game manually.
The ray cast position indicates that from physics perspective they were totally colliding.
It's visibly an issue, that's how I caught on in the first place. You're noticeably far from the car when the collision happens
What do you mean? The colliders themselves were like 2.5 units apart
Then I'd make sure that you're using interpolation on the rb and that it is not broken.
No. That's the collider gizmos outside the physics system. Physics system has an internal state for each rb. You can't see it. You only see the last state applied to transforms.
I see, so I should have both Interpolation on and Continuous Dynamic?
Or speculative, I'm not actually sure the difference
Why would it be broken?
Speculative is cheaper, but it's not precise
Due to moving or rotating the object in a physics incompatible way.
With both the cars and the player on Interpolate and Continuous Dynamic it's still got the issue of hitting quite far away
Then perhaps interpolation is broken.
🫠
Honestly Discrete works pretty well, good enough for my purposes
Occasionally the player glitches into the car slightly but it's not common
Better than being hit from 2.5 units away haha
If they move fast enough, they might not collide at all.
Often happens with bullets missing moving targets.
The cars are pretty big, I assume that wouldn't happen due to their collider size
Despite them physically going through.
Guys, I have a question, I am new to animating and game designing in general so would it be better to rig animations which use multiple objects (Example: Object 1 grabbing Object 2) in blender or in actual Unity?
My current way of approaching this was doing animations in blender exporting them in different animations and then adjusting them to be executed properly in Unity.
I just wanna know what way I should do.
can anyone help me out with exporting a blender model into unity
: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
Can we use macro graph with changing object variables per instance? The first object that I put the macro graph on is flashing when I flash other objects with the macro graph even though they have independent object variables. Visual Scripting
Nevermind, somehow a duplicate of my logic appeared with different grammar usage inside of the script machine
Using the new input system can you like set it up for a joystick you got from the asset store
Export as fbx, ensure scale is properly done in blender, import to unity as fbx
!collab
:loudspeaker: Collaborating and Job Posting
We do not accept job or collab posts on Discord.
Please, use Discussions to promote yourself as job-seeking, advertise commercial job offers, or look for non-commercial projects to participate in:
• ** Collaboration & Jobs**
Anyone know how lenient the licensing is on Philippe St. Amand’s Kinematic Character Controller is? On the Unity Asset Store it’s standard licensing but him working with Unity officially now and I found what seems to be similar stuff on his github under Unity Technologies
Curious because I’ve altered his implementation a bit for my preferences and i’d like to put it into my little prototyping package directly
I figure vibe wise it’s a non issue but it would be nice to have official approval
Best bet, find his contacts, email him
Honestly fair
is there a way to change unity documentation page to dark mode? using dark reader makes it look weird at best.
Maybe there's a custom CSS somewhere
This, for one: https://github.com/SmorcIRL/Unity-Documentation-Dark-Theme
this sounds dumb, but like...is there a documentation on how to read the unity documentation

There's three parts to it:
Manual
Has randomly organized articles on different engine systems, just use a search engine
DuckDuckGo: !unitym
Scripting documentation
Provides code documentation for the entire scripting API, divided by class. Has a ton of usage examples too.
DuckDuckGo: !uscript
Package documentation
Utter chaos, I don't even know where they are half the time. Quality is highly mixed
The part about package documentation is so accurate, I have been trying to learn Netcode for GameObjects with basically only the documentation so far and it's so incomplete
Ooof yea that happens to me sometimes too, usually i just go to #💻┃code-beginner and ask the peeps there for some more clarity
I somewhat would disagree but mostly because it's much more well structured than other Unity docs lmao
i don't see UnityEngine.Splines
Yeah, that's a package 🙂
it's a package
(open the package manager and click on the documentation link for the package)
ah shiiiiiii
i am back at the start all over again
what is t supposed to be in splines and how do i even get an instance of it onto the variable
!unity splines will get you there, eventually 😄
It's well structured in some aspects, but compared to something like the physics documentation where you can find every possible method and tool etc
t in a spline is just a float from 0-1 that is how far along the spline's length you are
The component is a SplineContainer - splines themselves are not components, but data. For performance reasons.
You could think of it like a percentage progress
i do get that it's a percentage progress, what i don't get is how i can get to access it.
like... float t = Splines.gett or smth
trying to find out what the tangent at a particular knot is to apply flip animation
The only problem really I've had with package docs is just having a shit ton of methods thrown at you with zero description at all (I'm looking at you textmeshpro)
My best guess would be to use GetNearestPoint (which gives the nearest point on the spline to a world point), use the world point of your object's transform, take the t value from that, and use that t value in EvaluateTangent
You need to sample the spline at t.
Keep in mind, GetNearestPoint is unbelievably slow

And not thread safe 
Is there an alternative?
Manually sampling at intervals, caching and then an optimized lookup into that cache
nearest point search is precise, and you may not need that precision
Typically a spline is converted into a chain of poly-line segments to become useful at runtime.
I think from @pure igloo 's situation (with context from a different question in #💻┃code-beginner earlier which I still remember) we can be sure that the object will be located on the spline (since it will be moving back and forth along the spline)
Does that change anything?
make me understand this then. what the hell is GetPositionTangentNormal even. is it a field, a sub-struct or smth else and how do i even access it
Eh, doesn't look like what you want
if Splines is just a an array...why is it even in this
It’s a data object used in some other method
You would still want EvaluateTangent instead I think
doesn't matter, i am trying to understand how to read the documentation
it's a struct
These are calculated values returned by some method somewhere
that implements IJobParallelFor
apparently, the thing i sent implements the same interface
where is the documentation for sample at t? I've been looking through the page but can't find it
how about not starting in the middle, understand the package architecture and design first
well, it's literally shown on that page as in SplineUtility
wait was that in response to me? I'm on the SplineUtility page but I don't see it under Methods
then you need to look harder
https://docs.unity3d.com/Packages/com.unity.splines@2.8/api/UnityEngine.Splines.SplineUtility.html I'm doing a control f for sample and it says no matches
the method is not called sample
what is it called then? the only info I got was this message
Evaluate, it's the method that's used on the quickstart page at the top level of the docs
I found Evaluate now, (under SplineContainer not SplineUtility), but I don't see how it can be used as an alternative for GetNearestPoint
It's in both, and as the Quick Start says, use the one in SplineUtility.
It's not an alternative, it manually evaluates the spline once, there's no more to it than that
You're right there is one under SplineUtility that I now can't believe I missed, thank you
guys i am so lost, what am i supposed to do even. i don't understand anything
But I still don't think it does what I was proposing to use GetNearestPoint for
(i.e. get the t value of the object along a spline)
You were animating something along a spline, right? So you'd do Evaluate(float t) while t animates.
@pure igloo how are you animating the object along the spline? Do you have a script for it?
using UnityEditor.ShaderGraph.Internal;
using UnityEditorInternal.VersionControl;
using UnityEngine;
using UnityEngine.Splines;
public class DamnDeseDucks : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
public GameObject Duck;
public SplineAnimate Spline;
void Start()
{
Spline.Completed += onComplete;
}
// Update is called once per frame
void Update()
{
float tangent = SplineUtility.EvaluateTangent<T>(Spline, t);
Debug.Log($"{tangent}");
}
void onComplete()
{
Destroy(Duck);
}
}
this script is attached to the duck
the thing that's supposed to be moving
(To clarify I'm not the one asking the original question lol, I'm trying to help)
What part of that makes the duck move though?
move to #💻┃code-beginner
True
Does using transform.parent automatically try to keep world position?
Because when I use it to parent UI to a canvas at runtime after the object was instantiated in the scene, the rotation and scale is massive and all off + the z value
So I'd assume yes
Yes, setting a transform's parent through that property will maintain the world transformation.
OK so I need to use transform.SetParent(parent, false) to stop the behaviour then
Thank you!
When I play the scene and click in Game window, cursor disappears. I remember I could bring it back maybe by clicking right click. But not able to do so now:
I have to switch to some other app to bring it back.
Escape will unlock the cursor
Ah
This is something special for play mode in editor only btw. In a build pressing Esc wont affect the cursor lock/hide state unless you add that.
you
Yeh but i am not a one man army
I actually cant
Even my laptop is outdated and laggy
And i am a beginner
But you are the one, who should start and learn and come here when you run into a problem. If you got issues with your laptop, there is nothign anyone here can do about it
Yeh but i make several time worlds but my assets got corrupt each and every time
Anyways you are right although that will take a long time
I will start with s 2d game then 3d
Going to learn animation first
Its more about the complexity of your mecahnics you want to include than 3d or 2d. You can have a jumping box in 3d which is still fun. Just take whatever mechanic you like to test around. the first games are just prototypes to learn and work towards a bigger project later
Anyone know when a new starter bundle will come in the asset store? How longs the current been there
you mean like the fps starter pack?
Sometimes progress looks like rocks floating in space 🚀🪨
wow moderators is gold plated
anyone can help me on this?
#🌐┃web message
I want to learn how to communicate to website with Unity
Hey hru
What if we all went to one continent
Actually he is 16 and he is my brother i will teach him a lesson when I meet him
I mean asset bundle that’s usually on the market place where u pay like 20usd. Usually the bundle is there a while
It’s got assets from multiple different creators
Starter Bundle is a very vague name to ask about. If it's one from Unity, a new one will come when the current 'Start Assets' are too out of date it's not worth updating and creating a new one is the better idea. If it's not from Unity, then... same reason and/or whenever whoever feels like it.
You can see when an asset was first published on the store. Click 'Releases' and look at the date under 'Original'
Can someone help me, I cant download build support on linux. I cant get any components in the hub, so I went to the website. When I clicked download, it game me the macos version, heres the link it gave me: https://download.unity3d.com/download_unity/c1416845ad01/MacEditorTargetInstaller/UnitySetup-Android-Support-for-Editor-2023.1.22f1.pkg
fellas lemme show you this gem of a mistake XD
i have no idea why it works but it works so well
hi can someone help me :3
im a new user on unity
and im trying to make a jump button
idk whats wrong i did everything correctly added the UI script rigidbody and components
wouldn't you multiply the speed value by 0.01f instead of Time.deltaTime, since that's your change in time between callbacks, instead of the delay between frames
im not too sure lmao
well, the reason you multiply most things by Time.deltaTime is because it's the difference in time between the last time it was called and this time
here, you're calling it every 0.01 seconds, which isn't Time.deltaTime, it's just that - 0.01
if you yield return null instead, then you'd wanna multiply by delta time
im guessing because theres almost no delay between frames Time.deltaTime is essentially acting like 0.01
it's not
it's still the time between frames
but what you're doing there is not tied to the frames
it's tied to your own loop, which gets called every 0.01 seconds
you probably want to yield return null, which waits for the next frame, instead of yield return new WaitForSeconds(0.01f)
oh i see
but i still dont understand how this is working so well considering that last perameter is for the max distance value and not the speed
the last parameter is a speed, it's the maximum speed that it can go
it's the change in your position
oh thanks for the clarification
but you still wanna change it to either yield return null or multiply it by 0.01 instead
Lol
send the script and inspector here
I dare you try and run this on low framerate
cant wait till everything teleports XD (too late tho i gave up and rewrote the entire thing)
i mean tbf what you've got is just a very rudimentary tween
a tween?
yeah, it's an object that can animate a value over time
I'll send via dms
there are a lot of libraries you can use for them
and my todo list has extended by 1
my favourite tweening library is primetween, but there are a bunch of others you can use
Are these the things the bullet hell games use to have the experience fly into you?
tweens are used for a lot of things
what a coincidence that was exactly why i was writing this code
i'm having this stupid bug when i'm setting up a humanoid ragdoll and trying to make it stable, every body part follows the rules i set but the chest just falls trough the map
every setting is the same as the rest of the body parts
which could include that
Intreseting was curious cause i happen to also be making a bullet hell and animating the experience but i for the life of me couldn't find out how to make it bob first (i didnt try very hard though)
like back up a bit and then move towards you?
Yeah
make it bob?
well guess what tweening libraries have that too, it's just a back in easing
Oh nice
so with prime tween you'd do something like
Tween.Position(transform, player.transform.position, duration: whatever, ease: InBack)
would Vector2.MoveTowards(transform, player.transform.position, -1*speed) also work?
well it'd be a lot more cumbersome but sure
a tween you can just call once and forget
definitely gonna be using tweens now
and you can give it an easing, which can make it more interesting than just linear movement
Can someone help me fix my jump button? Here is my inspector for the jump button UI and the code.
using UnityEngine;
[RequireComponent(typeof(Rigidbody), typeof (BoxCollider))]
public class PlayerController : MonoBehaviour
{
[SerializeField] private Rigidbody _rigidbody;
[SerializeField] private FixedJoystick _joystick;
[SerializeField] private float _moveSpeed;
[SerializeField] private float _turnSpeed = 10f;
[SerializeField] private float _jumpForce = 10f;
private void FixedUpdate()
{
Vector3 direction = new Vector3(_joystick.Horizontal, 0, _joystick.Vertical);
if (direction.magnitude >= 0.1f)
{
Quaternion targetRotation = Quaternion.LookRotation(direction);
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * _turnSpeed);
}
_rigidbody.velocity = new Vector3(direction.x * _moveSpeed, _rigidbody.velocity.y, direction.z * _moveSpeed);
}
public void Jump()
{
if (IsGrounded())
{
_rigidbody.AddForce(Vector3.up * _jumpForce, ForceMode.Impulse);
}
}
private bool IsGrounded()
{
return Physics.SphereCast(transform.position, 0.5f, Vector3.down, out RaycastHit hit, 0.5f);
}
}
!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.
also #💻┃code-beginner
(see https://easings.net/)
oooh another magic site that makes everything so much easier
anybody had issue with disappearing options? can't seem to find any fix for that
this website is technically meant for css, but easings like that are pretty much universal
I was told to send it here 🙏
i just need help getting it to jump 🙏
More code related as the UI binding is fine
well, from what I can see here. You need to use debug.logs in your code to check
check what the problem is
and how do I do that?
hi im having trouble tracking the position of my dolly carts position on the track im trying to track it so i can change the cameras priority when it reaches the end of the spline
well what could it be?
idk honestly.
the greater than or equal operator is >=, not =>
well why would it not work? there aren't that many options really
what are my options?
that's what i'm tring to get you to figure out
still gives an error at .m_pos
i'm not just gonna give you the solution straight up, that doesn't teach you much does it
why do I have the feeling that the solution is simple 😭
wait am I suppose to link the jump button to the player?
i'm trying to get you to learn how to troubleshoot problems like this
but no its all in 1 script
im trying my absolute best 🫡
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
is it a problem with my script?
i already said, i'm trying to get you to troubleshoot it - the problem could be in many spots and we need to identify where it is
then either that field doesn't exist, isn't accessible, isn't the right type, isn't a field, etc...
you gotta read the error to figure out what the issue actaully is
and how to I identify exactly?
this is the error it shows me
well you need to figure out where it goes wrong, where what you expect to happen doesn't
so the field doesn't exist. what are you trying to access? perhaps check the autocomplete suggestions for the correct spelling or capitalization, if that's wrong
im not getting any errors when I run so it isnt in the script ig so I def connected something wrong
Do you know the rubber duck method of debugging?
well what are the potential points of failure, points where it could stop the function from running
no...?
Ok so I can CLICK the button
but the button doesnt output anything
okay, do you know what Debug.Log() does?
no?
okay, what do you think it does from the name?
man I code in python not c# 😭
is it like print()
yeah
w alr
what do you usually use print for?
yeah, you can do the same thing here
alr w
Simple. It's called that because you could sit down and talk to a rubber duck and figure out your problem (Although you don't need to).
Basically, go through your code line by line and read out what the line is doing. Not what you want it to do, but what the line itself does. At some point you will realise that what you just described the line doing is not what you want the line to do, and you've found the problem.
It's one of the best ways to deal with a logic error, as in your code runs fine, but doesn't do the right thing.
spelling seems fine im trying to access the dolly itself
alr thx good to know 👍 🤗
wait is it the linearvelocity?
the error is on m_pos, not on dolly. that part is fine
it's m_pos that doesn't exist
One more note is that instead of manually reading the line and thinking about what it does, you can use Debug.Log() to output the actual value changes after that specific line, with those tools you can usually find the source of logic errors (Debug.Log just makes it easier)
I will test that out
we're trying to figure out where the problem is, you need to see when the jump function stops (or if it even gets run at all)
is there a different syntax i need to use cause everwhere ive looked uses the same wording
and yeah going through docs, that field just simply does not exist. what are you trying to access exactly?
can you show what you're looking at that says that
What is m_pos meant to actually refer to? Since you're using >=1 I'll assume it's a number, but anything with position would most likely be a vector no? And I don't think it's like x_pos since there's no m component of position?
@unreal jewel I managed to add Debug.log to some parts
using UnityEngine;
[RequireComponent(typeof(Rigidbody), typeof (BoxCollider))]
public class PlayerController : MonoBehaviour
{
[SerializeField] private Rigidbody _rigidbody;
[SerializeField] private FixedJoystick _joystick;
[SerializeField] private float _moveSpeed;
[SerializeField] private float _turnSpeed = 10f;
[SerializeField] private float _jumpForce = 10f;
private void FixedUpdate()
{
Vector3 direction = new Vector3(_joystick.Horizontal, 0, _joystick.Vertical);
if (direction.magnitude >= 0.1f)
{
Quaternion targetRotation = Quaternion.LookRotation(direction);
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * _turnSpeed);
}
_rigidbody.linearVelocity = new Vector3(direction.x * _moveSpeed, _rigidbody.linearVelocity.y, direction.z * _moveSpeed);
}
public void Jump()
{
Debug.Log("Jump function got called.");
if (IsGrounded())
{
Debug.Log("IsGrounded() happend. outputing Jump Force.");
_rigidbody.AddForce(Vector3.up * _jumpForce, ForceMode.Impulse);
}
else
{
Debug.Log("IsGrounded() failed. Player is hopefully in the air.");
}
}
private bool IsGrounded()
{
bool grounded = Physics.SphereCast(transform.position, 0.5f, Vector3.down, out RaycastHit hit, 0.5f);
Debug.Log("Grounded Check Result: " + grounded);
return grounded;
}
}
m_ is a prefix for members in some conventions.
Are you looking for CinemachineDollyCart.m_Position?
@tawdry tulip !code
what
!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.
it needs to be at the start of the message
well and at what point does it stop logging?
damn, for scunthorpe reasons or what?
nah, just how the bot was implemented
it'll probably check for wordboundaries anyways so no scunthorpe problem
i think so i was refrencing off of a unity forum post but i think that may have been incomplete codeim just trying to find where along the spline the dolly cart is'
📃 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.
wait how
using UnityEngine;
[RequireComponent(typeof(Rigidbody), typeof (BoxCollider))]
public class PlayerController : MonoBehaviour
{
[SerializeField] private Rigidbody _rigidbody;
[SerializeField] private FixedJoystick _joystick;
[SerializeField] private float _moveSpeed;
[SerializeField] private float _turnSpeed = 10f;
[SerializeField] private float _jumpForce = 10f;
private void FixedUpdate()
{
Vector3 direction = new Vector3(_joystick.Horizontal, 0, _joystick.Vertical);
if (direction.magnitude >= 0.1f)
{
Quaternion targetRotation = Quaternion.LookRotation(direction);
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * _turnSpeed);
}
_rigidbody.linearVelocity = new Vector3(direction.x * _moveSpeed, _rigidbody.linearVelocity.y, direction.z * _moveSpeed);
}
public void Jump()
{
Debug.Log("Jump function got called.");
if (IsGrounded())
{
Debug.Log("IsGrounded() happend. outputing Jump Force.");
_rigidbody.AddForce(Vector3.up * _jumpForce, ForceMode.Impulse);
}
else
{
Debug.Log("IsGrounded() failed. Player is hopefully in the air.");
}
}
private bool IsGrounded()
{
bool grounded = Physics.SphereCast(transform.position, 0.5f, Vector3.down, out RaycastHit hit, 0.5f);
Debug.Log("Grounded Check Result: " + grounded);
return grounded;
}
}
oo there
use the services/links
I think .PositionUnits is what you're looking for have a look here https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/api/Unity.Cinemachine.CinemachineSplineDolly.html#properties
well what point does it get to?
This code block is really big, use one of https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/ to avoid filling up the chat ideally
A tool for sharing your source code with the world!
a powerful website for storing and sharing text and code snippets. completely free and open source.
it checks if the button was pressed, then if it actually jumps or not, then checks if its grounded
are you trying to fish me 🤔
that's not what i asked
!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.
im confused wait what 😭
oh
At the top of the message @tawdry tulip
im not using online interpreters 😭 im using vsc 😭
i asked at what point does it stop logging
don't think so.
oh
these aren't online interpeters
these are not websites to write/run code, they are websites to share code
it stops logging when A it stops working and B if the if condition arent met
I'm guessing you're writing Debug.Log("Some message"), but you can use Debug.Log(variable) to print the value of a variable also. Then check values for isGrounded etc.
so when you can't jump, you press the button and there's no "Jump function got called" log?
(what was the original question)
(idk im getting more confused)
IDK WHATS THE PROBLEM 😭 the deadline is tmr and im trying to figure this out for 3 hours im crashing out AHHHHH
how long have you been stuck on this problem?
really? PositionUnits gives position along spline which seemed to be what they were asking for, it's the same thing as m_Position from the other component as well
hours :<
im new to c# and unity
did you read it. it gives units
usually I use pygame
Bro I might be blind