#💻┃code-beginner
1 messages · Page 358 of 1
Yup, dt = delta time. But this is off topic. Not unity
didnt know
hey hey I already sent something in code general for help, mind if I send it here too?
oh dammit im dumb
!ide
If your IDE is not autocompleting code
or underlining errors, please configure it.
Select one:
• Visual Studio (Installed via Unity Hub)
• Visual Studio (Installed manually)
• VS Code
• JetBrains Rider
• Other/None
Room list is not called, does anyone know why?
https://gdl.space/edapozugox.cpp
I don't see a method called room list so which one do you mean?
hey guys I was trying to create a game in which my player is controlled by my mouse pointer and whenever I touch my enemy(who walks around randomly) I restart the level.... but the player can collect energy for taking the player to a mode in which it can destroy the enemy's.
but while I was trying to make the Energy spawn randomly once more after bieng collected once the script is giving me an error for the spawnPosition of the Energy..... Please Help.
Here is the code
please hellpp
what error? The only error I see is a missing ) on your Start method, which your IDE is also telling you about
no
well that is easy to fix, move your initialization of spawnPos to the Start method
yes, because you are doing it wrong. I said move the initialization not the declaration
exactly what I said
what are the initialization and the declaration
post you code correctly and I will show you
how
!code
📃 Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
📃 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.
Ok.
public Vector3 spawnPos = new Vector3(Random.Range(-9, -4), Random.Range(9, 4), 0);
Declaration
public Vector3 spawnPos;
Initialization
spawnPos = new Vector3(Random.Range(-9, -4), Random.Range(9, 4), 0);
yes
this is basic C# knowledge, you should know this
where did you learn all of it
by reading the documentation
of unity?
no, C#
can anyone help me in this please, I have setup all the things correctly but the play games auto sign in isn't working, it doesn't even print "sing in failed" in the build but it prints it in editor
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine;
using UnityEngine.UI;
public class PlaySignIn : MonoBehaviour
{
[SerializeField] private Text gmailText;
void Start()
{
PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
}
internal void ProcessAuthentication(SignInStatus status)
{
if (status == SignInStatus.Success)
{
gmailText.text = PlayGamesPlatform.Instance.GetUserId();
}
else
{
gmailText.text = "Sign-in Failed";
}
}
}
I have correctly setup the package resources ids all correctly, as I was following a tut, I copied all the step as it is, still doesn't work for no reason
is ProcessAuthentication even being called?
yes ofc that's why it prints "Sign-in Failed" on the text but only while playing in editor
hey @languid spire my code does not show any errors but the new game object does not spawn
can you help plese
but you said it's not doing that in a build so my question still stands
could there be any problem while building game ?
ofc
maybe it doesn't get called
but why that happen on building ? like scripts don't change behaviours on building
oh yes they can, script execution order being the favourite problem
where are you calling spawnObject ?
Can someone explain me why it is not spawning?
doesnt instantiate do thar
myabe I should put it on the bottom, so it gets the time it want ?
Instantiate is within spawnObject so that would be difficult
so.. how do you do it then
well you have to call spawnObject from somewhere otherwise it will not run
oh ok I understood
I think you really need to spend some time on !learn. Especially the junior programmer pathway
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
my dependency folder only have a "editor" folder no "android" folder
it must have that
is there any way I can manually do corrects for it ?
like adding it externally ?
maybe check testGameObject() is getting called, check if you have refrenced the objects like "text" "spawnObject", and the isspawned is not already true
I was talking about this
https://docs.unity3d.com/Manual/class-MonoManager.html
already did that
but I am talking about the dependency manager
Did you make a development build and check the player log ?
I will obviously
but I am asking bout the folder "android" where we can find some kind of file( I don't remember correctly) but with that we get a option to enable auto resolver
Everytime I check the android and hit apply it load the domain and once compilation is completed, it instantly reloads again and uncheck that ;-; ?
sry for the ping
{
[SerializeField] private float speed = 5f;
private Rigidbody2D rigidbody2D;
void Start()
{
rigidbody2D = GetComponent<Rigidbody2D>();
}
void FixedUpdate()
{
float moveInput = Input.GetAxisRaw("Horizontal");
rigidbody2D.velocity = new Vector2(moveInput * speed, rigidbody2D.velocity.y);
}
}
why my player dosent walk horizontal?
any errors in the console? do you have any constraints on the rigidbody?
that's just the standard dll import inspector
so if isn't checked for android it doesn't matter ?
what u mean?
Please log rigidbody2D.velocity
i mean exactly what i asked, do you have any errors in your console or have you constrained anything on the rigidbody
you have it set to only be in the Editor so it wont be included in a build
oh ok
If you are only building for Android and running in Editor, set it to Any Platform
ok
it still reverts it
unity is high xD
the mouvement feels bad the physics material is 0.6 bouciness and 1 friction this is the code any fix i can add
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
public class PlayerMouvement : MonoBehaviour
{
private float horizontal;
private float speed = 5f;
private float jumpingPower = 12.5f;
private bool grounded;
[SerializeField] private Rigidbody2D rb;
[SerializeField] private LayerMask groundLayer;
void Start()
{
print("hello unity");
}
// Update is called once per frame
void Update()
{
horizontal = Input.GetAxisRaw("Horizontal");
if (Input.GetButtonDown("Jump") && grounded)
{
rb.velocity = new Vector2(rb.velocity.x, jumpingPower);
}
if (Input.GetButtonUp("Jump") && rb.velocity.y > 0f)
{
rb.velocity = new Vector2(rb.velocity.x, rb.velocity.y * 0.5f);
}
}
private void FixedUpdate()
{
grounded = Physics2D.CircleCast(rb.position, 0.4f, Vector2.down, 0.05f, groundLayer);
rb.velocity = new Vector2(horizontal * speed, rb.velocity.y);
}
}
What is bad about it?
How do I make my players head and arm follow where I look? if I make them a child of the camera my arms glitch out.
the controll feel stiff and when stop it just stop it doeast like keep rolling a bit it's not like a ball mouvement
That's because you have friction to 1
how much should it be
Try different values but start from 0
I think high friction is fine for a rolling ball. Otherwise it would slip
if i do 0 the ball will not roll
Your problem is that you are directly changing rb.velocity
AddForce would probably work better for what you want
hmm i will try
3D Random Map Generation Problem
hi guys
I have a question. How to capture if player will input other key than I want? I mean: Player must type: T but he types E and I need to capture if player input is not null
AnyKey
Okay thanks
it's probably a stupid question why is it not jumping
if (Input.GetButtonDown("Jump") && grounded)
{
rb.AddForce(new Vector2(rb.velocity.x, jumpingPower));
}
if (Input.GetButtonUp("Jump") && rb.velocity.y > 0f)
{
rb.AddForce(new Vector2(rb.velocity.x, rb.velocity.y * 0.5f));
}
at a guess grounded is false or jumpingPower is zero
when using AddForce for jumping you want to also use ForceMode2D.Impulse
ok
Hello everyone! I want to make dialogues in my game appear like this ⬇️
But I don't know how to name this method of dialogue display and therefore I can't find anything related to it... Any links to tutorials or advice on how to implement it will be appreciated!
Speech Balloons?
oh one other thing to note, is that you do not want to use the current velocity inside the AddForce call unless you want to increase the velocity by that amount
Yeah, speech bubbles or something like that will do, thanks! Do you know by any chance how I can make them always look towards the camera in a 3D game?
ok thanks and when i added ForceMode2D.impulse it worked
yes, use the TMP_Text 3D world object and just rotate it to always face the camera
Understood, thank you!
is there a reason why my mesh renderer isn't following my prefab
Is there a reason you expect it to? What's the setup?
This is a coding channel. If your question is related to code, please share the relevant context. Otherwise ask in the proper channel
!code
📃 Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
📃 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.
but also that component is attached to the child object not the root so if does any movement, then it moves the child not the root object
What is the issue though? That screenshot doesn't explain anything.
the link you posted then deleted was the correct way to share code
oh my god dude, just paste the link and leave it
yes. now go back and read my earlier message about what is causing your issue
also don't multiply mouse input by deltaTime. mouse input is already framerate independent so multiplying it by deltaTime is just going to force you to make your sensitivity variable about 100 times larger than it needs to be, it will also cause camera controls to be stuttery and framerate dependent again
it doesn't work
be more specific
fox itself is moving independent from the prefab and the transform vectors
is the component still attached to the child object and not the prefab root?
Hey, I have a weird issue, i defined a class and when i access it i have two instances duplicated for some reason
public static class Maps {
public static Map mapA = new Map("map a", 1, new ElementalEncounter[] {
new ElementalEncounter(Elementals.elementalA, 0.3f),
new ElementalEncounter(Elementals.elementalB, 0.7f),
});
public static Map[] versionAMaps = { mapA };
}
"mapName": "map a",
"elementalEncounters": [
{
"elemental": {
"idNum": 1,
"name": "a",
"type": 0,
"catchRate": 1.0
},
"encounterChance": 0.30000001192092896
},
{
"elemental": {
"idNum": 2,
"name": "b",
"type": 1,
"catchRate": 0.5
},
"encounterChance": 0.699999988079071
}
],
"requiredLevel": 1
}```
but when i load it i get
```private Map currentMap = Maps.mapA;
currentMap = {
"mapName": "map a",
"elementalEncounters": [
{
"elemental": {
"idNum": 1,
"name": "a",
"type": 0,
"catchRate": 1.0
},
"encounterChance": 0.30000001192092896
},
{
"elemental": {
"idNum": 1,
"name": "a",
"type": 1,
"catchRate": 1.0
},
"encounterChance": 0.699999988079071
}
],
"requiredLevel": 1
}```
yes
so then based on what i've told you and the fact that you are still experiencing this issue, what do you think you need to do?
show how you've set this up
does anybody have a good tutorial on how to import model s from blender to unity?
ive tried alot of them and i just dcant get it to work for me
check the documentation pinned in #🔀┃art-asset-workflow
this is a code channel
ok thanks
well i can clearly see that the component is still attached to this object when it should be attached to the root of the prefab. of course i didn't just want to see the mesh renderer, i don't know what gave you the idea that was all i needed to see
I'm assuming "FBX Exporter" is what I'm looking for right?
why don't you ask for help in that channel if you cannot figure it out from the documentation because this is a code channel where as your question belongs in the channel i linked you to
ok sorry
do not ping people into your questions #📖┃code-of-conduct
no one seems to help me here why is this erver created for
if you want help the consider reading #📖┃code-of-conduct #🔎┃find-a-channel and #854851968446365696 first
Did you actually ask a question? I scrolled back a bit, but only found you saying "hi".
Does it not enter your head that maybe no one online on a Sunday actually knows the answer to the question you are asking?
yes questions description, what i tried screenshot all of that
I did that but the transform compent moves away
again, show how you've set all of this up
also the question you asked then deleted is likely answered by the documentation for whatever asset you are using
yet people are are question anwering here
i deleted it
this is still a child object not the root object
Well, I can't see it anywhere. Can you link it?
yes, because they are not asking questions about one very specific asset that almost no one has experience with
Obviously no one would be able to help you if you delete your question.
is there a reason why the ElementalEncounter are both Elementals.elementalA (even though the second is B) when i access Maps.mapA?
public static class Maps {
public static Map mapA = new Map("map a", 1, new ElementalEncounter[] {
new ElementalEncounter(Elementals.elementalA, 0.3f),
new ElementalEncounter(Elementals.elementalB, 0.7f),
});
public static Map[] versionAMaps = { mapA };
}
remove the Fox component from FoxTransform. then consider looking into how to move using the rigidbody instead of the transform
who do I make it a rood object
you already have a root object. you don't "make" one. it's the object that all of your child objects are attached to
literally the "root" of your prefab (or what was, but now is not, a prefab)
its still there in unity talk chanel just deleted some screen shots
Might need to share some more context. Clarify your question, explain what ElementalEncounter is, and share the debug steps that you took.
i remind u just said we are busy on sunday we cant anwser your questions so go... what does that suppose to mean?
i am being polite to everyone here
I can't see it. I scrolled like 20 min back.
waht are u doing on sunday here then
buddy ill tell u
that is not what I said at all
You literally made that up. 60% is not true in that sentence
here is the code
https://codeshare.io/8Xqr0B
basically i have a map instance with list of possible elemetals (monsters) encounters
when i init the mapA i checked and saw that the elements assigned to the ElementalEncounter are different
but when the game ran and i access Maps.mapA for some reason both elements in the 2 ElementalEncounter are the same!
How are you confirming that?
debugged it and saw the value
im using a runner template of unity and im a beginner
Where did you debug it and what value did it print? I don't see any debugs in the code.
i added the values of the debug in the codeshare
HE EDITED THE COMMENT
oh, i just put a break point and saw the values
Where?
I saw it. He didn't said "go away'"
HE SAID ITS SUNDAY NO ONE IS GOING TO ANSWER THAT
Please stop
yeah. But not like "Go away, do smt else with your life" or smt
i dont understand your question, i debugged the code in vscode, i put a break point and saw the values on run time
AND HE SAID RUDELY " DOES IT NOT ENTER YOUR HEAD"
Where did you put the breakpoint?
I suggest to stop typing in capital letters
Seriously, I am just reading your question to try and help, but if you continue being rude, I will not. Please stop
Take a screenshot of what you see when it breaks.
Are you calling setactive from the object that is not active?
he was rude not me
Just take screenshots of what you see in the breakpoint. Commenting in the paste bin only brings more confusion
False, but ok. I guess you don't want help
Best of luck with everything. Bye
read it your self
Please stop spamming the chat and either discuss your actual issue or don't post at all
if you're going to act like a child, you're going to be treated like one.
cease.
so is it ok to be rude here then
i can gladly try to help you with your problem
thats what u are saying
but i cannot help you with whatever this is
Literally asked a question to help you and you ignore it to keep spamming
Are you calling setactive from the object that is not active?
also, i can assure you that steve's response was not particularly rude.
as you can see, when I accessed Maps.mapA the value of the element inside ElementalEncounter is suddenly the same
this isn't a "you just wait until you see what REAL rudeness is" threat; it's just...an observation
I think enough has been said, let's continue on the actual topic of this channel
Where is the breakpoint in the second screenshot?
indeed.
its a repeting function that check if it is time for new encounter
Is that in the same class as the second screenshot from before?
yes
no one changed the value of currentMap and no one changed the value of Maps.mapA
can I calle you ?
Okay. One possibility is that mapA is modified after the first breakpoint and before the second one.
what can I use component for in scripting? I tried [SerializeField] component m but I cant do anything with the m variable
DOES IT NOT ENTER YOUR HEAD THAT I WAS NOT BEING RUDE
How do you know that?
!mute 718044028754460723 1d Cool off and try again tomorrow
aly0794 was muted.
you want `, not |, btw
Ugh
because nothing access it
`Send inline code like this`
thank you i forgot
A field of type Component can store any component
This is probably not very useful.
yes
since you can only use it for things that every component can do
@wide wing Meanwhile you can check those UI tutorials I've pointed you to in the first place. Your question was about you being unable to figure out how UI asset works with scripting.
@raven kelp
how do I get a specific component out of it? Im trying to get an interface directly but since public interfaces dont show up in the editor I tried a generic component and it failed because uh idk
dumb
ah, okay, you're trying to do interfaces
The first option is to just cast it.
oh
the only place that use it is
private Map currentMap = Maps.mapA;
and the only use is
Elemental e = currentMap.GetEncounter();
and this is the function:
public Elemental GetEncounter()
{
List<Elemental> encounterPool = elementalEncounters
.SelectMany(e => Enumerable.Repeat(e.elemental, (int)(e.encounterChance * 100)))
.ToList();
int randomIndex = UnityEngine.Random.Range(0, encounterPool.Count);
return encounterPool[randomIndex];
}
ISomething something = (ISomething) theField;
(InterfaceName)m?
I think that throws an exception if it fails
If you're going to use interfaces heavily, I'd suggest checking this out:
I see that it's referenced in the versionAMaps array. It could be mofified via that reference.
I'd suggest making the fields private and exposing them via a methods or properties. Then you can debug whenever they're changed or accessed.
Don't use public fields.
This gives you a nicer interface. You can pick scene/asset objects that match the interface type.
nothing uses that field, but ill remove it for now just to see if it effects it
is this a unity package?
also, your IDE can find all references to a member by hitting shift+F12
very useful for figuring out who the heck is modifying a field
It's avilable on OpenUPM, which is basically a third-party source for unity packages
You can also just download it directly as a .unitypackage
told you
which are not .unitypackages
That wouldn't help if there are many places and you don't know which one actually is relevant.
great names, yeah 😕
hey dlich just double check if youre still helping me with my problem in #🔀┃art-asset-workflow ? or are you busy atm?
But yeah, you can see references.
yeah
Next time ping the person you're replying to.
- "unity package": installed through the Package Manager, doesn't go into your Assets
- .unitypackage: dragged into the editor, goes into your Assets
still happen
I use OpenUPM for quite a few packages. There is a small CLI program for adding the packages to your project's manifest file.
(it just puts the package into a list for you, basically)
Is making everything serializable a good idea when making a game? At the moment I'm making an interface for a physics controller, so I can quickly swap out the controller scripts if I need to move an object differently. The main controller needs the interface reference so it can use any script
If I’m going to use new input system, will my character be able to rotate using keyboard input as well?
Another possible cause, though a bit skeptical, is that you're assigning it in the field initializer and the static field is also initialized in the initializer. Honestly, this whole setup is a bit fishy.
haha maybe, im new to c#
btw i added readonly to the mapA and it still happened.. so i guess nothing changes it
this is so bizzare...
i come from 10 years of js/ts. the reference handling here is so weird to me...
Yes
Thanks
You should serialize things that should be saved in scenes and prefabs.
is it ok if ill stream it for you for a sec?
Here's one advice: don't make things complicated. Only use code that you're 100% sure about. I have more than 5 years of experience with C#, but I'd never use a setup like you have, because I'm not sure in what order the things are initialized. Sure, logically thinking the static field should be initialized when it's accessed and if it wasn't it would just be null, but with unity serialization added to the mix, you never know.
Nah, sorry.
Here's what you should do to fix/debug the issue: make all the fields private(not readonly). Initialize them in constructors or Monobehaviour init methods, like Awake. Print everywhere you access or modify something to see the order of execution in the console.
i didnt think it was complicated ): i dont have a db here so i need to "create" the data and store it so i can use it, what else is there to do?
In game engines, you typically "create" data in the editor ui. Not via code. Unless it's something procedural.
hardcoding your data is a terrible idea in most cases.
and if possible, i dont wont just to fix it, i want to understand what happened there
public Component a; //Interface in editor
public ISomething j;
void Start()
{
j = a as ISomething ; //does nothing for some reason
//if I try "j = (ISomething) a" it throws a cast error
}
void FixedUpdate()
{
j.something(); //fails here
}```
nothing is accessing this field and manipulating it, i even set it to readonly and this issue still happens
Well, you'll need to debug it thoroughly to understand that. Maybe if you share the project I can look at it on my end.
that means whatever you stored in a cannot be assigned to ISomething
the "as" syntax silently produces a null if it doesn't work
In c#, casting using as can change the variable to null if casting failed. If you use direct casting with (Type), it will throw an exception if the cast fails.
The best way of checking a type is with pattern matching
Oh so its more of a failsafe. It failsafed and then my code failed
if (a is ISomething)
{
var something = (ISomething)a;
}
Then it's caught up finally
I can't figure out when is was introduced (when looking at its doc page), so it has to be pretty old
oh yeah, that's relatively new (and supported, yeah)
inetesting, but i cant do it for large amounts, only for some variables
i can define tens of objects and then create tens of maps using those objects
similar to
if (dict.TryGetValue(key, out var thingy))
aright ill push it and make it public
it works in 2021+, not sure about earlier versions
slowly we getting there 😭
I want me some file scoped namespaces
Just note that I'm going to sleep soon, so if you can't get it done in a few minutes, you should either wait for someone else to help you or for me to look at it tomorrow when I have time.
sending you in dm
I think I need to stop coding at 1am, my life would be much easier
A lot of modern features can be polyfilled using various libraries so this might also be possible
Though this isn't directly a type or method so maybe it doesn't
I want those.
I dont think a is ISomething. I don't know what I screwed up. Firstly, the interface is in the same gameObject as the controller script, so I dragged the interface directly into the serialized component. The interface I am referencing is also a monobehaviour. I tried
🤞 seriously. hate my code being so intented for using namespaces..
"the interface is in the same game object"?
oh, the component with the interface
Try using this library for example https://github.com/SimonCropp/Polyfill
You are probably just referencing the wrong thing.
interesting. Gonna check this out. Just wish we didn't have to use external libraries for something already part of .net
A in New Controller is my component variable. Weird Move is part of the interface class and also apart of the monobehaviour class
show me the definition for WeirdMove
that font lol
looks like a Japanese/Chinese/etc. font
now show me the code where you try to cast to the interface type
can interface even be a component ?
get a component out of an interface?
no, both ways are possible!
If you have an interface-typed variable, it can refer to anything implementing the interface
which could include a component
ah i shouldve done that at the start
Thats what gettype does
its weirdMove wtf
its bruh
and the console logs "No worky" ?
I replaced No worky with gettype
so yes it is in spirit, "No worky"
so weirdMove is not newMove.
wait
what just happened
my gettype print command is unreachable
show me your current code.
if (a is newMove j)
Hi I need help. I'm doing game where you have to type words by input but for no reason it stops working and game probably crashes and stop cathing input from a player
if (a is newMove j)
{
print("Excuse me");
}
else
{
print("No worky");
}
is the same you've sent
This is not appropriate if you want to assign it into a field.
And
print((a is newMove j) ? "Excuse me" : "No worky");
it creates a new local variable
if (a is newMove j) {
this.j = j;
}
you'd have to do this to assign it into the field
ok
That's because you're doing it wrong
no
"probably crashes"?
a crash makes the game completely quit
perhaps you mean it's freezing?
where it locks up and Windows eventually says that it's not responding
Unity is crashing during build for android gradle error what could go wrong tried googling tried few things but can't figure out
#📱┃mobile
also is it actually crashing as in completely closing unity, or is it just failing to build. because those are two completely different things
Failing to build
then you should say that instead of saying that it crashes. because, again, those are two completely different things and being as specific as possible when trying to get help is important to get the correct help. anyway, your question is not code related so delete it and repost in #📱┃mobile and provide as much detail as possible, including the details of the actual error
If I have a lot of data for the game (many monster stats, maps, items etc) where do I store it? Should I just dump it to a json or maybe sqlite file?
What is the common practice?
JSON is convenient for editing outside of Unity. The main problem is referencing that data.
you can use integer IDs, as long as you keep them consistent
And have like enum of the ids so it’s connected to the code?
For example I want to load a map and assign what monster will spawn there
I don't know is this goes in coding help, but I have 2 objects. I am setting the rotations of them to each other, but they have different base rotations. The 1st object at 0,0,0 rotation points left, the other objects points right at 0,0,0. How am I supposed to set the rotation of them to each other if they point different locations when they are exactly the same?
{
Debug.Log($"Room count: {roomItemsList.Count}");
Debug.Log("OnRoomListUpdate called.");
if (Time.time < nextUpdateTime)
{
return; // Skip updates if not yet time
}
nextUpdateTime = Time.time + timeBetweenUpdates;
UpdateRoomList(roomList);
}
void UpdateRoomList(List<RoomInfo> roomList)
{
for (int i = roomItemsList.Count - 1; i >= 0; i--)
{
RoomItem item = roomItemsList[i];
if (!roomList.Exists(room => room.Name == item.roomNameText.text))
{
roomItemsList.RemoveAt(i);
Destroy(item.gameObject);
}
}
// Add new room items
foreach (RoomInfo room in roomList)
{
if (!roomItemsList.Exists(item => item.roomNameText.text == room.Name))
{
RoomItem newRoom = Instantiate(roomItemPrefab, _content);
newRoom.SetRoomName(room.Name);
roomItemsList.Add(newRoom);
}
}
}```
pls i need help, the function `OnRoomListUpdate` is not called 🥲
or. is it really that bad to just have static class with the data?
You need to call that method from something outside of this code
ok thanks
an enum would make it a bit easier to select something in the inspector, but it wouldn't help if you needed to change an ID for some reason
the other option is to use ScriptableObjects
you can create new kinds of assets and reference them directly
yes this! i thought static class is similar
No problem. It's just that without some kind of way for your application to use that, it wont just pick it it up automatically, so you gotta have some other class or event or something say hey I want to explicitly call this and then it will do so based on whatever meets the criteria for the caller to use it
it's kind of the exact opposite :p
you can't possibly reference things from a static class in the inspector
that is not something you call yourself.
https://doc-api.photonengine.com/en/pun/current/class_photon_1_1_pun_1_1_mono_behaviour_pun_callbacks.html#a0a9ff2be14ffd6aebe603a83a94673cc
ask in the photon discord if you need help with it
oh you talk about the inspector, is it that important? i rather control it from the code anyway
So there's a problem, Photon doesn't call the function
again, ask in the photon discord if you need help with that
forgive my confusion with coding. how does the code know how to effect the correct items and assets in the project? Maybe Im trying to start too big.
Im trying to make the buttons in the yellow tab disable in the next section then the one next to it. Maybe Im starting too big?
how should I go about making it so that if any of the variables in {} are null, it doesn't skip a line? (without using a huge list of "if" conditions)
you probably want to configure things in the scene view, like setting which enemy you'll encounter if you walk onto a tile
Consider string.Join
Ive been trying to find tutorials on how to set code but it doesnt seem to match my requirements right
It can combine a bunch of objects together.
i have 1 scene and just loading a diffrent "settings" to it, otherwise ill have too many
You might do this...
for context, i want to avoid the "range:" line from appearing if range is null
oh wait, it won't be quite that easy
since each line has its own prefix it wants to display
I was going to suggest this
Yeah I'm guessing they would have to instead force an intitialization on each to just be a blank string/value so that it will output something, yeah?
List<string> entries = new();
entries.Add(itemData.AttackDamage);
entries.Add(itemData.AttackRange);
entries.Add(itemData.AttackSpeed);
string.Join("\n", entries.Where(entry => entry != "");
something like this
(you'd have to call ToString on those items, too, and that requires a null check for each...
you the man, let me try that
oh, ok, you got a better idea?
prefer !string.IsNullOrWhiteSpace(entry) over entry != "" since that will actually check for null as well
yeah, I wasn't sure what AttackDamage/etc. actually were
if they're getting ToString()'d then the empty comparison makes sense
but I suppose the IsNullOrWhitespace is still a better choice, since it also filters out anything that looks blank
So what would that look like?
i don't have a better suggestion right now
If you need to conditionally exclude entire lines, and the lines aren't empty when they should be excluded, then I'd just do an if statement for each one
Hi. I have a question: Which option is better? Through a loop in void Update, assign bool bools using Toggle or create a separate method for each Bools?
neither
public void Set(int i, bool val) {
Bools[i] = val;
}```
Just one method like this^
Oh, oh. Thanks
chat GPT suggested me this, and it seems to work lol
just letting you know, if ever it helps you in the future
A StringBuilder would be a bit more efficient, but that works
itemData.attcakRange sounds likes a float or int or long and never been null
I got this code from ChatGPT Im guessing I need to rename the code lines to match the name of the buttons?
agreed. the typing is not clear from these names
If you don't understand the code CGPT is spitting out, it's useless for you.
indeed
I would suggest making it so that each object can display itself
so that itemData.AttackDamage.ToString() spits out "Damage: 123"
so is AI worthless to help learn code with
sorry if these questions come across as "dont asks"
I think worthless gives it a bit too much credit. I would call it actively harmful
You need to know enough to tell when it is lying before it is not harmful
probably not entirely worthless but more of a guide if you know what youre doing already and need another perspective to then evaluate if its useless
Because otherwise you end up with stuff you copy over and use but have no idea how it truly works, which is then not going to help you whatsoever to try and fix/debug
!learn
yes, it is actively harmful
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
gpt is like a non-cute secretary
Don't look for tutorials that exactly fit your specific issue. Learn the basics and use tutorials for inspiration
"DevSec"
It's useful if you already have a somewhat good understanding of what you are needing information about. It's not good for "just give me code" but it can be useful for partial code explanations, or finding an obscure api that may or may not exist (but if it does exist then it solves whatever problem it was), or possible avenues for finding new coding patterns you didn't know before. It's basically a drunk rubber duck, so you can't always rely on its output
Phind is cool since it gives you links to actual sources + follow up questions.
I would agree with all that. And yeah, phind is the best one of all the gpt wrappers imo
it can at times offer better result than google in certain aspect, google after all makes money on showing you biased results
not to say
its not dangerous in the hands of newbies who think its a code generator rather than a searching tool
thanks. been hard to understand.
Does Unity pack image files into atlases automatically?
No, you have to turn on sprite atlasing
thanks
_affectedEntityRigidbody.AddForce(Vector2.left * _knockBackForce);
Is this the intended way or do I need to normalise something? Because this requires a huge force float to have a visible effect
AddForce applies a constant force by default.
If you give it Vector3.left every FixedUpdate, it pushes with 1 newton of force
this accelerates a 1kg object by 1 m/s every second
knockback is generally an instant thing
you probably want an impulse force
Will do! Thanks
handy image that explains the different force modes
One second of AddForce with ForceMode.Force is equivalent to calling it once with ForceMode.Impulse
Hm with Impulse I don't seem to get any movement whatsoever...
public void ApplyKnockBack()
{
_affectedEntityRigidbody.AddForce(Vector2.left * _knockBackForce, ForceMode2D.Impulse);
}
The rigidbody mass is 1
are you perhaps overriding velocity somewhere else?
or is _knockBackForce incredibly small
Ah yes the movement script uses the rigidbody too
So I must use the other mode then?
That will not change this issue
You need to stop setting velocity while you do the knockback
Can I add a second rigidbody as an easier solution
no
make simple bool.. if(knockingBack) don't apply the movement velocity. or better use simple State Machine with enum
that wouldn't make any sense
you'd have two velocities and positions for the same object
(re: this, not navarone's suggestion)
I see
Hi guys, I was wonderring you can help me answer what the time variable is in the function AnimationCurve.Evaluate(time). I looked it up in the unity documents but I still do not understand what it does.
it evalutes value at point on the curve
imagine its a timeline and you want to know where is the value at x time
if you pass In 1 , you get 1
ohhh ok I see. I think I understand it better. I was using the function with the time as a constant variable like 3 and so there was no increase in the value.
the time is often in the [0..1] range
but you can make a curve that covers any time range
It's much like how Lerp's third parameter is "t"
yeah if you want smoothness along you just add Time.deltaTime
I use this often for character controller accelerations
Got the force to work but this caused a new issue where the friction material causes the knockback force to never stop. Any ideas what I can do?
okk
why do you have no friction ?
To avoid sticking to platforms
thats easily to fix another way, imo this is the worst ways
you would cast in movement direction, and if is blocked then just dont apply movement in that dir
or you could at very least put Nofriction material while in air, I still think that material method is just brute forcing one problem to create others
wait another question, how do I set the max speed limit and how do I make it go with the animation curve.
the max speed would be the last keyframe of the curve
you could clamp i guess
yea but am adding the speed to the velocity making the acceleration go up forever:
time += Time.deltaTime;
speed = movementCurve.Evaluate(time);
rb.velocityX += speed * direction;```
you keep adding velocity instead of setting it
The animation curve does nothing but tell you your acceleration here
If you want a max velocity, then clamp the velocity
you won't change how you use the curve
how do I do that?
Mathf.Clamp
there's also Vector2.Clamp or Vector3.Clamp if you want to clamp the entire vector
but you're strictly looking at the X velocity here
so Mathf.Clamp is what you want!
is time on the X axis or the Y axis?
https://hastebin.skyra.pw/yetaciveco.csharp have this code to change an enemy's material from all black to its regular one if it enters a player's view collider, but when i bump directly into the enemy and then walk backwards it assumes it exited even though the enemy is still in the collider, how can i fix this
presumably some trigger collider did stop overlapping
and is there a way to inverse the axis?
so for example the time is on the Y axis
how can i change and customize the input of cinemachine like i would like the camera on the Y axis to move everytime along the mouse delta but the X axis to move with the mouse scroll kinda like a zoom
did you look at the settings on your vcam?
the render graph compatibility mode should be disabled here right? This is just enabled for current projects using it before they fully migrate to 6?
not sure if it would make sense to do so
help with enemy ai code?
not really a code question. but yes unless you have something in your project that needs that to work (such as an asset that does a scriptable render pass using the old api), it should be off
wdym ??? the only thing i think could change the input is the input provider that is only by using the ew input system and it manage only XY at the same time for the same input
how can i fix this?
meaning i cant just make and input for X and an input for Y
Thanks
so you see where you have an input action assigned for the XY Axis? that's the input
so you modify that input action
Did you make your class MonoBehavior and then removed it?
you would think so but the enemy is clearly in the collider (its radius is 15 units, this is not too good an image cause the guy is farther away but in the original image the enemy is right up in the player's face and still not being changed from black)
ahhh, fixed that thank you
yes but no, it manage with only 1 input both X and Y and i want separate input for X and Y
sure it may still be in that collider. but if you have another collider as a child of the object selected then that would affect it to
modify the input action
which object the player or enemy
like how ???
i need to change the scrip^t that manage it ??
like open your input action asset and change it
but it dont work
why would it not work
like i can only assign 1 input for both X and Y
incorrect
i need separat input for X and Y
oh i can do different input for X and Y on a single action input ???
why don't you have a look at the documentation pinned in #🖱️┃input-system to learn how to use it
specifically it says the character controller of the enemy (the cylinder outline) exited the trigger but like its not significantly bigger than the enemy itself so theres no way it couldve exited here
beceause it thought it wasnt on the input system side but cinemachine one
cinemachine input provider script say for the input assign it say XY axis so i tought with only one input it manage both X and Y axis
if any of the colliders stop overlapping and are able to produce an OnTriggerExit method then they will
and i've been saying you need to change the input action in your input action asset
but i made the collider tags be "invisible" (and thus not "enemy") and the collider layers be "collider" and disabled collision between colliders in the physics settings so wouldnt they not interact
i did that but now cinemachine use both mouse delta and mouse scrolling for X axis 😭 and the mouse scrolling isn't working well like i actually move when scrolling for like 2second
this is why i told you to read the documentation for the input system.
you need a vector2 composite so you can select the individual inputs for each axis
this is vector 2
so we're just going to ignore the "read the documentation" bit then, eh?
nah im gonna read it actually..
thanks anyway
show the objects in question
and keep in mind that OnTriggerXXX messages are sent to the rigidbody parent as well as the object the collider is actually attached to
this is the enemy prefab
wow that collider..
this is the player
why are you mixing Character Controller with rigidbody
very bad
whys that
they are seperate controllers?
CC works with OnTrigger methods anyway, and you can use OnCharcterHit method if you need something close to OnCollision, so no reason at all to use Rb
if you want rigidbody don't use cc
so is that why im getting the bug
yeah that CC is on the Enemy layer with the Enemy tag so it will produce an OnTriggerExit call
You can probably delete that diamond shaped collider too, that looks like an optimization nightmare
but only if that cc is outside the collider right
the issue happens when you collide with the enemy then back off from it. OnTriggerExit is being called when the player's collider exits the enemy CC
you would be much better off using physics queries for this behavior instead of relying on OnTrigger messages tbh
yeah its a mesh collider that snapped to the t pose of the idle animation but i wanted it to be more universal so i made it convex but its p weird
what kind of physics queries
overlapsphere
ill look into that
enemy ai help
yeah generally for entire bodies you dont have a mesh collider, you would use Capsules/boxes for example
makes sense
ah, the Michelin Man
cant beat banana man
damn, 82800 polygons?
wow free? that just might become my new test bunnman
We went too far with the downscaling last time 😦 We increased the poly count a bit so the model doesn't look horrible in game
lol
https://ko-fi.com/s/bd5b56fde6 i actually use this one
just a little less 😄
this guy looks like it would give me nightmares
probably his protruding eyeballs
@rich adder trying to wrangle this controller is intimidating
keep getting this error so i cant even start working on it lol
thats like some internal looking error, which line is that
maybe you didn't assign something? been a while since I've used it
i'd guess that the motor.CharacterController hasn't been assigned
called it
where do i assign it though
im using this package i found
or navarone graciously gifted me
i am aware of the KCC package and use it myself. did you not read the documentation that comes with it?
it should show you how to implement the ICharacterController interface and also assign it to the CharacterController property on the motor
i skimmed it, probably a fatal mistake
yep, definitely give that documentation a good read. but all you really need to do to fix that issue is assign your motor's CharacterController property to this in Start on your ICharacterController component
yeah, if i look at the property it appears to have never been set
yeah, you have to assign to it manually in code
Where can I learn to code for unity
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
start with the pathways so you learn editor first, then do programmer path
i wish. nah thats euphoria engine
ohh shucks
gta4 and others
took me 3 hours yesterday just to get this hop out of the water controller smoothly xD
If i could those euphoria style animations I'd be in a AAA
whats this error hinting at?
i think its b/c of the SO property window
its intermitten
probably didn't like the window got separated ?
Unity editor errors are weird
esp when you customize the layout too much
I don't know why my animations don't work..
yesterday in the inspector i had 4 nested classes and Unity editor took a shit spammed in errors on 2022
also..not sure im doing this right.. but i don't have a mono for my settings.. i just assign them via the project window..
seems to have always worked.. but im going back and revisiting and refactoring..
just trying to make sure it is a valid approach.. and a non-reason the error could exist
need more context,
- do they not work at all?
- is it a character / rig set up?
- is the rig set up correctly? (possibly using a humanoid avatar)
- does the character do anything when you play? like sink halfway into the ground..
- etc
i have the same issue when climbing ladders.. when u reach the top it just gives u a little boost up and foward..
works like crap.. so i finally just deleted the climbing mechanic 😄
i'll do something work-around-ish.. like disable controls and move the character to the top and hten re-enable
I was actually thinking of a way of resolving the ladder problem yesterday that I might try, If its success I'll be happy to share result 😛
It involves a few physics casts
I want to resolve 2 issues:
-my player should be able to climb ladder but be able to get off inside a space even if its crouch sized
-player should also be able to choose another ladder/climbable surface to grab onto
I don't know how to explain if you can only enter with anydesk
not really a scripting issue but I'm just wondering why when i put a circle collider 2d on this sprite the collider is going from front to back around the sprite rather than around the sprite like it should
the object is probably rotated
hit W to switch back to arrow gizmos
and make sure you're in pivot + local mode
thats cool, i dont need the crouch mechanic.. but if u come up w/ some clever idea let me know 👍
What is Player1 parented to?
ah, yeah
the player has been rotated
your blue axis (local +Z) matches the world +X axis (the red cone in the top right)
I don't think circle colliders respond to rotation at all
mine is bare- essential setup
well was like i said i deleted it.. wasn't happy with the unmount
yeah one of the parents is rotated 90 degrees
i didn't think that would effect how a circle collider would orientate on a sprite
one of Dapper-dino's old tutorials
2D physics is designed to work in the XY plane
yeah but a single ray its to little
oh alright, thanks
ya, its not the best.. but it worked for simple stuff
I learned the hardway through this water controller that multiple points are needed
i need to go re-visit a parkour system
i got a pretty good feeling ledge-climb mechanic going
for example when in water there is huge differences between being fully submerged and halfway or just feet
yea, vaulting is what i want to do. at the very minimum..
my big inspiration for this is Dying Light
can't beat TitanFall/Apex Legends 🤤
its good for arcade climb wall or wallride, but not so much more complex buildings like towers
apex legends was my controllers insipiration
assasins creed nailed it, but in fpv is harder
Apex is source engine
thats why it feels nice
they have the best Surf-like controllers , Source SDK was my fav
haha top speed bunny hop 🐇
ya, i havent even started thinkin about bunny hoppin
tho it would be awesome to add
yeah source2 or at least cs2 pretty much killed bunny hops
i think my controller is pretty solid on the movement..
with some camera headbob action and it will be awesome
are you using rigidbody or cc ?
CC 😩
cc is good
b/c i like to beat myself up
it just takes a bit more patience 😅
Trying to make an object stick to my player, but it's staying in place after it gets parented, not sure why.
faking physics aint easy when you know minim
@slender nymph you said you've used the KCC, do you know how to like disable the motor? can i just set enabled = false or would that break things?
are you setting position?
probably maintaining the offset
void OnGui()
{
Debug.Log("Drawing GUI");
if (!showConsole) { return; }
float y = 0f;
GUI.Box(new Rect(0, y, Screen.width, 30), "");
GUI.backgroundColor = new Color(0, 0, 0, 0);
input = GUI.TextField(new Rect(10f, y + 5f, Screen.width - 20f, 20f), input);
Debug.Log("GUI Drawn");
}```
Anybody know why my gui not drawing? if showconsole is true or false it doesnt debug anything
no this is my only code, also the object does have a dynamic rigidbody2d component
you put sliding yet?
thats why
Not sure how well rigidbody2d works when parented to another. Might need to use a joint instead
well if it's a moving platform, and I make that platform a parent of my player, my player will stay on the platform, but it doesn't work the other way around
and are you sure you parented to the rigidbody and not the parent or some other object without rb
yea, thats what that video is showcasing.. 3/4 view
Your method is not named correctly, the correct one is OnGUI. C# is case-sensitive, watch out for uppercase vs. lowercase characters!
Ohh thank you imma go fix my ide so no more of this stupid mistakes
oh yeah just noticed. neat!
when u slide it takes ur last input, locks it, and lerps it to zero.. until u jump/stand/ or something else
I will try this, ty Osmal
Ohh I see. I used a Coroutine before
yea, i wrote majority of this my first 6 months of learning..
not sure i even knew what a coroutine was back then
Update works fine, I just have a dedicated Routine because I also do a physics casts from the "legs" because it detects legs for my enemy so they can be tackled
Are you sure this code is even running? Add debugs to see. Likely a problem with the agent or the SetDestination. Check to see what this position even is.
i also still use broken lerps 😉
haha
look at all my zeros
yeah my old code had those all over the place until I watched my sliders always be 0.98888
zeros at heart ofc 😄
gotta love floats
ohh i had that issue to... i would add if > threshold -> snap to 1 or snap to 0
They get the target but can't seem to walk towards it?
so is the navmesh baked/
^ navmesh have lots of gizmos you can use to debug what ur navmesh is doing
Why not try the 'improvement' on this page https://unity.huh.how/lerp/wrong-lerp
yea, i need to.. just been procrastinating..
my recent projects i have adopted MoveTowards
Yes
i replaced almost all my lerps with those instead
or just use the coroutine method
Do i need to bake every frame?
https://gamedevbeginner.com/the-right-way-to-lerp-in-unity-with-examples/
this page also covers more lerp usecases
No. You bake the navmesh once.
this is bookmarkd in my 101 github page
has actual decent articles
yes i was just typing that same thing
really good source for Text style beginner stuff
the OG
catlikecoding wants to know ur location
catlike is great , catlike gets right down to the basics though which is good and bad
hes like Yea...Unity gravity is ok.. but lets make our own..
me looking at the buoyancy script 
or 11 or 12 even
This should work??!
have you inspected the gizmos as suggested
in playmode navmesh agent tells you exactly what its doing
^ it'll show u a little crosshair type thing where the navmesh is directed to go..
i dont have a navmesh in my project or i'd show u real quick
also no context to when this is supposed to run
Its in an OnstateUpdate
So always im using the Animator
and you debugged that is running with log ?
I dont see the typical red target when agent has a path
You have to turn that overlay on
oh lordy
hit ` to get the list of overlaps and turn on AI Navigation
Ah, there we go. Docking the menu to the side makes it show up much better.
Like that?
Yes when i rigth click and have Selected units, but not when its in range of the Test dummy
idk what that means
yes target is that green cube the red circle is on yes?
No... Its just an visual
If I make a collider a trigger can anything go through it?
where is Cube at
yes
thats the whole point of a trigger
I am having a problem where I can go through it but my enemy AI cant
and idk why
depends how the enemy is moving in the first place, first I'd check there
so the cube is the thing outside the navmesh ?
you should exclude any moving objects' layers from the bake
I dont know why it did
yes you shouldnt bake layers with moving objects
Oh, is there away i can bake without it leaving an spot?
yes exclude that layer from the baking
if theres something that moves that u need to account for you can use the Carve tick box
you can also untick "only carve while stationary"
didnt know about that one 👍
why arent they facing the correct way?
if (!paused)
{
if (facingleft)
{
Quaternion targetRotation = Quaternion.Euler(0f, 0f, 0f);
armature.transform.rotation = targetRotation;
ultCameraContainer.transform.rotation = Quaternion.identity;
ultCameraContainer.transform.localScale = new Vector3(-1, 1, 1);
cameraContainer.transform.rotation = Quaternion.identity;
}
else
{
Quaternion targetRotation = Quaternion.Euler(0f, 180f, 0f);
armature.transform.rotation = targetRotation;
ultCameraContainer.transform.rotation = Quaternion.identity;
ultCameraContainer.transform.localScale = Vector3.one;
cameraContainer.transform.rotation = Quaternion.identity;
}
}
very handy with moving objects and need realtime moving around them
im guessing this cuts down on the processing alot
ya exactly
yeah carving during motion is probably expensive side 😛
use with caution
But are they just really lazy or am i doing something wrong?
are they moving tho
at all
also that
just not going to target, you seem to have the wrong target
either that or ur moving the child while parent is elsewhere?
i hate that ^ gets me once a week
me when i try to duplicate an object but duplicated a child
lmao facts!
guys, when I walk forward, after a few seconds my character falls
Lock the rotation
Changing the stoping distance just made them really Physical agianst eachother. They dont move agianst the target att all...
But there is an arrow Coming from the Unit to the Enemy They just dont move
show the current setings your have
yes if its a rigidbody you need to use the Constraints on the rigidbody rotation
i resloved playerRigidbody.freezeRotation = true;
those are constraints yes
When I inherit this interface:
public interface ICommand
{
void Execute();
}```
its making me write the inherited method like this or I get errors:
public class FormationMoveOrder : ICommand
{
void ICommand.Execute()
{
}
}```
This is not what the documentation I'm following suggests is supposed to happen. Is the IDE correct anyway?
same exact thing
On what
@slender nymph do you know how to disable ground snapping? the walkthrough says to do this but it doesnt exist
yes, when you implement an interface, you are required to implement all of its members that do not have a default implementation
i would be interested to see this documentation
on my mouse scrolling input the mouse scroll is very laggy like i need to scroll for like 4s to make the input move by a Nano centimeter i cant understand a thing where this thing comes from, is there a way to modify the sensitivity or smth like that ???
The material im following suggests that the inherited method can be "void Execute" rather than "void ICommand.Execute"
oh right, it's gotta be public
holy smokes how did I not see that 😩
sounds like something wrong with your mouse tbh
tried different mouse already and still does the same thing
the walkthrough is a bit out of date. check the upgrade guide and userguide to see what may have changed. oh and the API reference
Ig ill figure it out tomorrow its getting late
then the code is probably wrong, idk you're not really being descriptive
it is an input on the ''new'' input system for cinemachine camera
you're talking about the Orbital camera or what
perhaps you need to change the sensitivity, then
and when i scroll like it doesnt activate the scrolling input everytime
ah there we go, thank you 😄
here is the input for the mouse controls for the cinemachine camera if it can help
like yk when you use your scroll wheel the value goes to 120 or smth like that right ???
but here it goes to 120 times to times when it want, but im actually scrolling like a mad man
do you know if its possible to disable snapping but keep probing? the probing is useful but the snapping less so for what i want to do
i don't know off the top of my head. there's an entire forum post for the asset though, you could try looking there
will have a look, thanks. it looks like a good asset for my needs but it needs a bit of refactoring lmao
well my code needs refactoring i mean
you can probably add the scale processor to the action and scale just the Y axis
to fit it, not too much though luckily
there's also the option of just inheriting from the CinemachineInputProvider and applying your own scaling when cinemachine gets the input. this is what i did to allow customizable mouse sensitivity in my project
this is all i did to add my own sensitivity to it:
public class InputProvider : CinemachineInputProvider
{
public override float GetAxisValue (int axis) => base.GetAxisValue(axis) * GameSettings.MouseSensitivity;
}
i get it but like i think the issue is from another source
like i made the scale processor thing and made my scroll value bigger but it dont make my scroll activte when the scroll is actually scrolling
like my issue is that the input dont detect when my mouse scroll is used like it should normally do
and i tried 2 different mouses and made the same issue
what did you actually set the scale for the Y axis to? and keep in mind that if you are using the scroll delta the values might be super small, you could always try printing them to see what they actually are
i didnt changed the scale i only added the input and assigned the input in my cinemachine input provider
you literally just said you tried the scale processor
oh this scale
i made it to 10 sintead of 1 then tried 100
made the movment slightly bigger but not really any changes
then print what the values actually are
anyone know why this might be happening? armature and the others are children of this object
how do i print it ??? like how do i get the value of the input ???
just print it in OnLook, you don't need to assign it in OnLook then print in Update
but that's literally how. all you need to do now is make sure that you have subscribed to the event somehow, such as with the PlayerInput component
i dont know how to assign the right input
😮💨
remember how i suggested you read the documentation on the input system and you said you would?
in the input header in the editor there is no assign for any input
why would there be one there?
to know which input i am printing ?
oh and the component will not magically grow new properties to assign in the inspector just because you thought about input when making that component
and sry for the documentation thing tbh i just checked what i needed for the input to be assigned differrntly between X and Y etc.. (but yeah that is not an excuse)
it should normally be assigned with playerInput component but it dont print anything
surely you bothered reading your screenshot, right?
yes ?
so then based on what you see in that screenshot, what do you think you forgot to do?
the "No Function" but when i click on it the only option i have is a string name
u drag in the gameobject w/ the script on it..
not the script from the project window
oh ok... sorry
Someone knows why my unity predictions stopped working? (even my extensions (like error lens) doesnt do anything):
try regen project files
#JustVSCodeThings
already did it :(
is your Visual Studio Editor package up to date?
how can I check it ?
look in the package manager
package manager..
try opening the script from solution explorer
looks like external tools says package version 2.0.22
WTF WHAT THE HELL HAPPENED ??!!? now it work normally without any lag ??? the only thing i changed was to add a print script and add the player input component 😭
why does the was lagging without the player Input ???
vscode can be finniky when recompiling and whatnot
sometimes u gotta tab back and forth from unity to vscode to str8n it out
that should be irrelevant 🤔
did you untick the automatically enable option on the input provider or something?
weird been using it nonstop on my mac no issues
it can't be removed 
thats because it might be part of another package
gotta unlock the Engineering package or whatever
nah the auto enable inpute of cinemachine is still to default
it doesn't break or anything.. just sometimes it wanna drag its feet
then perhaps it got fixed from you saving stuff. remove those other components and see what happens
oh yeah at times it doesn't load intellisense right away
i removed the player input component and the script and it works...... idk what to say tbh like that was the only changes i made
I did it, but the predictions still doesn't work

probably something else got saved that wasn't saved before 🤷♂️
well just removing that won't really do anything. did you regenerate project files again? and restart vs code?
Did you regenerate project files AFTER removing the vs code package? Did you ever restart your computer after installing the c# dev kit in vs code?
^ also try using the solution explorer and open script from there
huh i got my awnser but it is weird, actually i deactivated the Input component and deleted the print script and everything worked so presuming that deactivation of a component = salme a deleting it... i deleted the player input component and now it does the same bug as before
Like i dont get where the fix come from
well that doesn't seem right 🤔
i'd try and see if you can reproduce this behavior in an empty project and if you can reproduce it, then submit a bug report
yep, I regenerate the project files after removing it and I haven't restarted the computer, but the predictions and the extensions like "error lens" used to work fine, but idk what happened
i could try to (im gonna sleep now it nearly midnight in my time zone)
anyone know why this is possibly happening?
honestly, if you cannot get vs code to work, i'd recommend swapping over to a real IDE like Visual Studio or Rider
can someone help me? the jump height doesn't effect my player for some reason. code: https://pastebin.com/DH0Ga0gW
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
well, for starters u have a function called JumpAddForce() that your code never uses..
this person really needs to start paying attention to the code they are copying
i could see tht
You never answered why you have two addforce calls in your jump method
it may be past the point of no return.. but imo its better to get ur controller working first.. (without) any kind of animations.. and then add those once u have a working controller w/o problems..
You are also doing velocitychange in move..
And you could just... remove the part where you set gravity to true. The issue before was setting it false, the solution was to remove that, not change it to true