#💻┃code-beginner
1 messages · Page 423 of 1
Yep so .NET 5 is an entirely different branch. Unity uses .NET Framework 4.8, which is close in terms of features but has less. Most of the things introduced in modern .NET are syntax shortcuts, so you probably won't hit many errors anyway
_rb.velocity = new Vector3(_movementKeys.x * transform.right, _rb.velocity.y, _movementKeys.y * transform.forward);
you can pass the y velocity of the rigidbody as is if you want it unchanged
Ill try to look for more c# tutorials that are on the unity engine
are you sure this works? 'Cause you are multipling a Vector3 inside a new Vector3
let me test it
oh yeah right wait a sec
_rb.velocity = new Vector3(_movementKeys.x, _rb.velocity.y, _movementKeys.y);
try this one out instead
the problem here is that the player is not following the direction it is facing
something like this?
that's why i was stuck before
hmmm let me think
been a while since i wrote a movement code
No, that starts a coroutine and promptly stops it. I mean something like this
Coroutine c = StartCoroutine(Coro());
// ...
StopCoroutine(c);
you need to transform your input direction from local space to world space using transform.TransformDirection
Like this: Vector2 _LocalMovement = transform.TransformDirection(_movementKeys);?
sorry i cant help, the only movement codes i wrote are based on AddForce(); rather than modifying the velocity i dont have experience in this
you need to create a vector3 from the input first
i can save coroutines as variables?
I actually just had to do that today lol
Seems a little unintuitive, considering the words used. You'd think "local" would mean you move relative to the player, but that's not how it happens
dont worry, thanks for the help anyway
Yes
ok, will try
ok let me try something
wdym
do i call both in the take damage function?
sounds like you need to learn the difference between local and world coordinates
Maybe? Wherever you need to "reset" the timer. If there's a coroutine running, stop it. Then start a new one
thanks it worked
ok im gonna try the following and then report on the results:
Coroutine c;
void TakeDamageFunction()
{
StopCoroutine(c);
c = StartCoroutine(coroutineName);
}
ok i got a null error im gonna check if its null before i stop it
What is the goal of this?
If there is some sort of timed system that must happen then maybe Coroutines are not the best idea. Instead you might want to stick to Update and track timestamps
This works but it can be messy
IT WORKED tysm
Yes, use timestamps instead
When they take damage, set a timestamp for (for example) Timer.time + 5.0 to start healing 5 seconds into the future
You can have a long running Coroutine that checks every frame if the time passed, and if so it stops checking and starts healing every x seconds until the timestamp is in the future again
It's a lot easier than hassling with starting and ending Coroutines
thanks but i think im gonna stick with what ive done
Suit yourself
what did you mean when you said i had no intention of actually fixing it
about my error earlier
Does anybody know a good tutorial to start scripting with unity 2d?
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
I've already look into it, i want a video or a spreadsheet, not a course. on the site i also saw direct tasks that i didnt understand
if you're gonna be picky about the learning resources suggested, then you'll need to search for them yourself
Im not "picky" can you explain what is a "course" according to the site? Theres many types of "courses"
i see
how did you attach a link as text?
it's just a markdown link
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at <454b8adca03e44db8a0e3ace7093e9b8>:0)
UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at <454b8adca03e44db8a0e3ace7093e9b8>:0)
UnityEngine.Transform.get_position () (at <454b8adca03e44db8a0e3ace7093e9b8>:0)
CameraManager.Update () (at Assets/Scripts/CameraManager.cs:19)``` I had this error
what is line 19 of CameraManager.cs
Please share your !code from CameraManager.cs
📃 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.
Your code was last called there before Unity threw the exception according to your stacktrace
I had this
Okay, but what is the code? The code is important here
wait
using System.Collections.Generic;
using UnityEngine;
public class CameraManager : MonoBehaviour
{
public Transform target;
public float cameraSpeed;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.position = Vector3.Slerp(transform.position, new Vector3(target.position.x, target.position.y, transform.position.z), cameraSpeed);
}
}
target has been destroyed but you are still trying to use it
how can I fix that
Transfor has been destroyed as well but idk actually how to solve those kinda things
check if the object has been destroyed or don't destroy it
no it hasn't
the only object on that line that could have possibly been destroyed is target
{
if (target != null)
{
transform.position = Vector3.Slerp(transform.position, new Vector3(target.position.x, target.position.y, transform.position.z), cameraSpeed);
}
else
{
Debug.LogWarning("Target nesnesi atanmadı veya yok edildi!");
}
}``` ```void OnGroundCheck()
{
if (groundCheckPosition != null)
{
isGrounded = Physics2D.OverlapCircle(groundCheckPosition.position, groundCheckRadius, groundCheckLayer);
playerAnimator.SetBool("isGroundedAnim", isGrounded);
}
else
{
Debug.LogWarning("GroundCheckPosition nesnesi atanmadı veya yok edildi!");
}
}
I implemented those code lines but when the game started, my player was not in the scene
So did the log say that target is null?
I mean, did it print the warning in Update
yes
Do you get any errors in the console when that happens?
ı did not get any error but my player was not in the scene
Well, how is your player placed in the scene?
doesn't look related to the code you've shared at all
Yep, separate issue
suddenly disappeared
also don't crosspost. your issue regarding the destroyed object was already solved before you posted it to the other channel
What?
Do you have code that spawns the player or where does it come from
You havent show any relevant info about the player disappearing problem
I'll send all of the scripts
using System.Collections.Generic;
using UnityEngine;
public class DestroyME : MonoBehaviour
{
public int lifeTime;
// Start is called before the first frame update
void Start()
{
Destroy(gameObject, lifeTime);
}
// Update is called once per frame
void Update()
{
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class PlayerManager : MonoBehaviour
{
public float health;
public float bulletSpeed;
bool dead = false;
Transform muzzle;
public Transform bullet;
public Transform floatingText;
public Slider slider;
bool mouseIsNotOverUI;
// Start is called before the first frame update
void Start()
{
muzzle = transform.GetChild(1);
slider.maxValue = health;
slider.value = health;
}
// Update is called once per frame
void Update()
{
mouseIsNotOverUI = EventSystem.current.currentSelectedGameObject == null;
if(Input.GetMouseButtonDown(0) && mouseIsNotOverUI)
{
ShootBullet();
}
}
public void GetDamage(float damage)
{
Instantiate(floatingText, transform.position, Quaternion.identity).GetComponent<TextMesh>().text = damage.ToString();
if(health - damage >= 0)
{
health-=damage;
}
else
{
health=0;
}
slider.value = health;
AmIDead();
}
void AmIDead()
{
if(health<=0)
{
dead = true;
}
}
void ShootBullet()
{
Transform tempBullet;
tempBullet = Instantiate(bullet, muzzle.position, Quaternion.identity);
tempBullet.GetComponent<Rigidbody2D>().AddForce(muzzle.forward * bulletSpeed);
DataManager.Instance.ShotBullet++;
}
}```
Yeah left shift
Is there a way I could save a int within the game folder itself? I’ve noticed the most common save places are either in the Registry or appdata but can you do the root folder of the game by chance? I’m trying to save a int
- Put long code in a paste site !code
- Don't send DM's, it's against the rules and just kinda weird
- When the player 'disappears', did you try selecting it and seeing where it is in the scene? Or is it completely missing? If so, what should spawn the player to the scene?
📃 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.
depending on the build platform you can save data in Application.streamingAssetsPath
hi everyone,can u help me pls?```public void exp1(string Path)
{
Path2 = "Application.persistentDataPath" + Path;
DirectoryInfo di = new DirectoryInfo("Application.persistentDataPath" + Path); // Not working, only if Path= "" working
DirectoryInfo di = new DirectoryInfo(Path2); // Not working
DirectoryInfo di = new DirectoryInfo(System.IO.Path.Combine(Application.persistentDataPath, Path)); // Not working, only if Path= "" working
DirectoryInfo di = new DirectoryInfo("Application.persistentDataPath" + "/directoryname"); // Working but i dont need this type
}```
how cani fix that?
string Path2 i know
why are you passing Application.persistentDataPath as a string?
what should i do?
DirectoryInfo(System.IO.Path.Combine(Application.persistentDataPath, Path));
i used
does Path start with a / ?
yes
remove it
Also, reading the docs might be a good idea
[SerializeField] private Button otherBtt;
[SerializeField] private Button backBtt;
[SerializeField] private RectTransform sound;
[SerializeField] private RectTransform other;
[SerializeField] private GameObject soundPanel;
[SerializeField] private GameObject otherPanel;
[SerializeField] private AudioSource audioSource;
[SerializeField] private AudioClip button;
private void OnEnable()
{
soundBtt.onClick.AddListener(Sound);
otherBtt.onClick.AddListener(Other);
backBtt.onClick.AddListener(Back);
}
private void OnDisable()
{
soundBtt.onClick.RemoveListener(Sound);
otherBtt.onClick.RemoveListener(Other);
backBtt.onClick.RemoveListener(Back);
}
void Sound()
{
sound.sizeDelta = new Vector2(700, 100);
other.sizeDelta = new Vector2(400, 100);
audioSource.PlayOneShot(button);
otherPanel.SetActive(false);
soundPanel.SetActive(true);
}
void Other()
{
sound.sizeDelta = new Vector2(400, 100);
other.sizeDelta = new Vector2(700, 100);
audioSource.PlayOneShot(button);
otherPanel.SetActive(true);
soundPanel.SetActive(false);
}
void Back()
{
audioSource.PlayOneShot(button);
Screens.index = 1;
} ```
the audiosource.playoneshot is not working when I am calling it in normal voids but when I am calling it in Ienumerator it is working pretty fine....
Anybody knows the reason?
Hello,
In one of my function, I create buttons from a buttonprefab like this :
for (int i = 0; i < weaponsInShop.Length; i++)
{
GameObject button = Instantiate(buttonWeaponToSellPrefab, buttonWeaponToSellParent);
ItemWeaponButton buttonScript = button.GetComponent<ItemWeaponButton>();
buttonScript.WeaponImage.sprite = weaponsInShop[i].itemImage;
buttonScript.WeaponItem = weaponsInShop[i];
}
My ItemWeaponButton script is this :
public class ItemWeaponButton : MonoBehaviour
{
public Image WeaponImage;
public Weapon WeaponItem;
}
When I call my function, Unity send me this error : NullReferenceException: Object reference not set to an instance of an object
Why ?
Because one of the references you are trying to access is null. Narrowing it down to a specific line would help
I verify all in Unity and I give all reference
It can be from script or Unity ?
It should give you more information than you have provided.
There should be a stacktrace in the bottom section of console
It's the all error : NullReferenceException: Object reference not set to an instance of an object ShopWeaponManager.CreateWeaponsToSell (Weapon[] weapons) (at Assets/Code/Scripts/NPC/Shop/ShopWeaponManager.cs:57) ShopWeaponManager.OpenWeaponShop (Weapon[] weapons, System.String pnjName) (at Assets/Code/Scripts/NPC/Shop/ShopWeaponManager.cs:39) ShopWeaponTrigger.Update () (at Assets/Code/Scripts/NPC/Shop/ShopWeaponTrigger.cs:16)
What's line 57 in ShopWeaponManager?
buttonScript.WeaponImage.sprite = weaponsInShop[i].itemImage;
Something on that line is null. You can attach a debugger to inspect each value as the code executes
Okay I found, I forgot to give the reference of the Image of the button :/
Thanks to you !
Did you check that the methods are getting called? With Debug.Log for example
And make sure that you don't disable the object that has the AudioSource. That would stop the sound
i'm making an inventory system for a 3d unity project. right now i'm trying to add a drag and drop system to the items but it doesn't work.. I only have debug.logs right now and nothing shows up in the console
DragDrop - https://hst.sh/cufazifuva.cpp
ItemSlot - https://hst.sh/movubemodo.csharp
i've read forums talking about adding a StandaloneInputModule to the event system but because im using new InputSystem i need to use a InputSystemUIInputModule. I've added a canvas group to the item, made sure the canvas has a GraphicRaycaster. I also did an Event System debugger - https://hst.sh/musobofono.cpp and still nothing shows up in console. when i click on the item absolutely nothing happens
Hello im still new to this and everytime i try to make movement it says "ArgumentException: Input Axis horizontal is not setup."
The input axis name is case sensitive

You typed it wrong, it needs to be Horizontal.
does anyone know how i can make the orange object stay on top of the disc when it moves?
cuz its just staying in place when i move away
Good night (I personally have a night). I have a question: what function or method is needed to select a color in c\hannel mixer? I tried to write it (no errors came out, but it didn't work). How to do it?
It actually is working. It’s just that the layer that you have on the object simply isn’t corresponding to the color values you provided. Unity has a hidden mask on every object accessing the lower layer, so you’re changing the color that isn’t visible
Ok. Thanks
no its a physics object it spawns far away from the disc and when i run into it i want it to stay on top until it gets pushed away by another object
Hi,
I put my code on a github and put at the origin. But I don't see there is a conflict in my scene in Unity. So now, I have nothing in my scene and git say the error is here in my Scene.unity :
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 20009624128464991}
- {fileID: 747104955}
- {fileID: 5263420119110903920}
- {fileID: 122769077}
- {fileID: 629391847}
- {fileID: 298221142}
- {fileID: 985254350}
- {fileID: 1664262106}
- {fileID: 1859801690}
<<<<<<< Updated upstream
=======
- {fileID: 1429456250}
- {fileID: 2037507436}
>>>>>>> Stashed changes
What I need to do and how can I know what I need to change
scenes are biggest pain
figure out what you want to do with the new changes (modify the .scene file )
git errors look like ```<<<<<<< Updated upstream
- {fileID: 1429456250}
- {fileID: 2037507436}
Stashed changes
Yes but if I just delete one of this fileID, it's do nothing
I have the same error
The thing is I put the last update a week (yes, it was a bad idea) so I don't very know what I really changed precisely
it tells you what changed in the file
Yes but it's a lot of thing
Show it where are conflits really ?
If you dont know what you're doing to edit it manually, I'd probably just go to an old commit where it's working and take the file from there.
To actually edit it you need to remove the lines with arrows and the =====
Those lines are just to indicate where the conflicts are
If I delete all lines with the file ID, can I correct the conflicts ?
im currently building a shop ui and i have buttons that only become interactable if the requirement (money ) is met. however now i have the problem that it is only local to each button, meaning, should the player have 3 items in his shop for 300 cash, and he has 310 in his inventory, he can still buy all 3 because they only check once.
anyone knows how i can "fix" that?
Button script https://pastebin.com/crgwk9qQ
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.
Refer to the message above that one. Dont just randomly guess at what to do here.
I dont know what file IDs you want, and just deleting those lines alone wont remove the conflict warning
So. trying to do something here.
- Creating a boolean value that'll flip between true/false depending on whether or not a certain, already integrated count is met. This will then trigger a win screen when the player hits a simple spot.
Should I share what I have so far here?
Run the same checks everytime something is bought.
!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.
yes, but how do i do that across multiple buttons. i want when the player clicks button A, to also refresh on button B
Honestly I think you should have your shop more as 1 script rather than what it is currently. But even if you dont go that route, you still need a general "shop manager" so you can have a central place that is notified/notifies other buttons of when an item is bought and it needs updating.
Also you should ideally check how much they have after clicking the button, just as a sanity check.
Idk if this is the same everywhere, but this is not how you spell reduce
it doesent count how i do it
errors doesent come with wrong spelling
i dont used images
i used hatebin
my code is too long to send without nitro
is spotAngle just outerSpotAngle?
flashlightLight.innerSpotAngle = curMode.innerAngle;
flashlightLight.spotAngle = curMode.outerAngle;
That is against what the mods want here. If it is longer than a few lines, it needs to go in a paste site.
Doesn't matter what you find annoying
hi bro
yo
i have question
yup
yo my friend
Just ask
speak up
im new in unity .
whete can i learn unity
i don't need unity website . becuese unity website don't have video
pls give me some video for i learn . and its good for beginner
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
well there are tons of yt videos for this kind of stuff, what would you like to make? if you dont want unity tutorials.
What if there's too much?
hasnt got video
what would you like to make as a game?
fps, third person shooter, etc
what is fps
first person shooter
its ok
theres brackeys, though the tutorials are now a little old
you say to me ?
search a genre of game you would like to make on youtube and find a tutorial
did you read the big bold text it says "Large Code "
!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.
use hatebin
what kind of game do you maked
ill be real its better to learn with a goal in mind, just learning unity for the sake of it will be slower than wanting to make a game that you like and researching on each aspect for it
give me some video you learned
so what would you like to do in unity, what game would you like to make?
we need to know what you would like to make first
i like to learn . and get same line . and never give up
but i don't know . which video is good
i ask person of unity member
where they learned
i use them
you are not answering my question, what do you want to make
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
well we need to know what genre you would like
Learn to develop games using the Unity game engine in this complete course for beginners. This course will get you up and running with Unity. Free game assets included!
✏️ Course developed by Fahir from Awesome Tuts. Check out his channel: https://www.youtube.com/channel/UC5c-DuzPdH9iaWYdI0v0uzw
⭐️ Resources ⭐️
(To download assets you may have...
did you learn from this ?
yea
free room and shooter
i can give you a list of fps tutorials but it may not be what you like to make
thanks
yes give me
thank you
if you can help me help thanks guys
well do you know any programming
c#
java
anything
im just gonna give a rigidbody tutorial with movement, its very easy for beginners unlike character controller
i need to hurry up on my 300 slide C#, Raylib and Unity tutorial for beginners
personally i would recomend either brackeys, or dave development, i followed these tutorials when i was starting
https://www.youtube.com/watch?v=f473C43s8nE&t=1s&ab_channel=Dave%2FGameDevelopment
FIRST PERSON MOVEMENT in 10 MINUTES - Unity Tutorial
In this video I'm going to show you how to code full first person rigidbody movement. You can use this character controller as final movement for your game or build things like dashing, wallrunning or sliding on top of it.
If this tutorial has helped you in any way, I would really appreciate...
Let's see how to get an FPS Character Controller up and running in no time!
REGISTER with APPTUTTI: https://www.apptutti.com/partners/registration.php?utm_source=brackeys&utm_medium=social&utm_campaign=brackeyssponsor1
LEARN MORE: https://www.apptutti.com/corporate/?utm_source=brackeys&utm_medium=social&utm_campaign=brackeyssponsor1
● Ultimat...
thanks for helping @steep rose @eager spindle
👍
No
https://hastebin.com/share/qosuvixora.csharp
Got it. Here's the large code.
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
what is it do
what's the count here?
you said you wanted something to trigger when the count is met
There's collectibles you gather in the level.
oh I see it
do you already have a function for what you want to do when the count is met?
bro i don't learn any developing language
No
tldr in OnTriggerEnter check if the count is met, then add the function there
OnTriggerEnter increases your count
void SetCountText()
{
countText.text = "Count:" + count.ToString();
if(count >= 8)
{
winTextObject.SetActive(true);
}
}
ISo you're saying I should move the if statement to OnTriggerEnter, probably turning it into an elif, I think? Or putting it under the if statement in OnTriggerEnter.
before we continue do you understand where SetCountText is called from
Uh, inside Start(), and OnTriggerEnter()?
me ?
yep
so why would you need to move it to ontriggerenter?
where fo you learn . give me video 😂
also what's the problem here actually
already did
as a programmer you need to be able to research on how to do stuff yourself
does the winscreen not display?
This was what I was trying to do.
well yes but I dont understand what part you're stuck at
The winscreen displays, I'm just trying to change that from triggering from collecting all the points
To
Collect the collectibles
When player has moved back to the start, trigger the win message.
This is my actual assignment, with the winscreen being the feedback to the player.
you mean in this ?
https://www.youtube.com/watch?v=gB1F9G0JXOo
Learn to develop games using the Unity game engine in this complete course for beginners. This course will get you up and running with Unity. Free game assets included!
✏️ Course developed by Fahir from Awesome Tuts. Check out his channel: https://www.youtube.com/channel/UC5c-DuzPdH9iaWYdI0v0uzw
⭐️ Resources ⭐️
(To download assets you may have...
I've got the collection part done. I'm trying to handle the rest.
oh . this . sorry bro
thanks for help me
to clarify you want the player to walk back to the start while having 8 points in order to win?
Yes. There'll be collectibles spread throughout a maze, the player touches them, gets their score up to eight, and then they have to return back to get their winscreen.
me ?
nope
tldr his current code makes it such that he wins if he collects 8 points
he wants it such that collect 8 points and go back to the start to win
why doesnt he just check if he has 8 points and is in the trigger
have another trigger at the start. when player walks into trigger, check if player has 8 points. if so, win
what was that
Okay. So...make like a block or plane, that has isTrigger. But shouldn't it be in void update(), not void start()?
Oh. So it should like...
void SetCountText()
{
countText.text = "Count:" + count.ToString();
}
// This is where the pickup stuff goes.
private void OnTriggerEnter(Collider other)
{
if(other.gameObject.CompareTag("Pickup"))
{
other.gameObject.SetActive(false);
count = count + 1;
SetCountText();
}
elif(count >= 8 && other.gameObject.CompareTag("GameFinish"))
{
winTextObject.SetActive(true);
}
}
No idea if I have the right idea here.
(this is just a test) why is it printing as soon as i start and space does nothing
yes its in update
Because you have nothing inside either if statement
See the green underline at the end?
misplaced ;
oh its gotta be at the }
ok i fixed it kinda but why is it just doing it one time
where is this code placed in?
Doing what one time
update
printing
so when you press space key, it prints one time and never again?
Are you pressing space multiple times
yes and yes
Show your console after you've pressed it a few times
you can turn collapse off if you want, but having collapse on shows the number of times gets printed
yuh
how long of unity learn till yall think im ready for my own project?
i did and i still asked for help
you will learn on the way, trust me
Without knowing exactly what your end goal is, no one can really answer this. And it's unlikely you know exactly what features you want rn.
If you arent familiar with c# basics, then this will take a lot longer if you just try to start making stuff on your own for many reasons. Things will break, you'll have to learn how to debug. As you get better you'll remake systems that no longer fit your needs
or this 👆
You should be a bit more careful offering advice like this, if you dont have that much experience. From what I've seen you seem like a beginner too.
It isnt about asking for help, if someone tries to start a major project too early they're likely just gonna waste a shitton of time
I have years of coding experience, yet still abandoned my first project I worked on for months because it was too much/too bad
@eager spindle think I managed it with what I posted?
i understand c# basics like vector3 movement, if statements, variables, keycode stuff, prefabs and a little more i cant remember off the top of my head
i was wanting to do a fps but thats way out of my league
i think im going to wait till i know sound and anims
except for ifstatements and variables everything else you mentioned has nothing to do with c# per se, its unity specific
ig i should have said instantiate instead of prefabs
still not a c# thing lol

don't confuse Unity API for anything else but that
anyways i know enough c# to make something move
C# is the language they chose to interact with their engine
wait till you get into actual heavy logic parts, thats where you need raw C# knowledge. knowing the tools available for you like collections, and all that good stuff
c# basics is thrown around very loosely, just pointing out the unity api / and the native c# knowledge is diff
okay will do
tysm for your help
Up for a challenge @obsidian shoal , try to replicate John Conway's game of life in unity. Fairly simple, but will cause you to think about design and logical flow
i wouldint know where to start
well start by googling what it even is, hte wiki spells it out pretty simplistically
depends what you're doing, a simple game projects work well
logic heavy games can be simple things battleship, connect 4, tic tac toe
they are simple but complex enough for logic practice
I do find it crazy people jump into game dev without knowing what a for loop is
yupp. I'm just as guilty.
Gamedev is very inviting unlike traditional software development
took me a good month to even remember how to write one without IDE
Lmao
And yet, game dev is considerably more difficult than most 'normal' app dev
Depends
it can be for sure
On what you consider a normal app
Does anyone know any tutorial where weapon is separately attached to character and have to sync both animations together to make it look like one? It also has to use transform property whatsoever.
You can make some simple games using regular app development tools
i still find Trig scary af
yeah that was my first react project, but once i found webfront end/backend with c# i ditched js
(yay web assembly!)
I wish i could but I'm addicted to svelte
Christ I can make TicTacToe with nothing but DOS commands
old school
Funnily enough my first game was tic tac toe in python. Made on my phone. During a break when i was in an internship back in high school
I've got people on my (GitHub) team that have been modding/programming since 12
I wish i did that too
But hey better late than never
Crazy how much i love programming
When working on my own stuff it's equivalent or more entertaining than gaming
I used to use game maker , thought I'd never be programming, was too diffuclt lol
to be fair GML looks pythony, years later I'm in unity doing c# 😛
What do you mean "separately attached"? Like a weapon of 2 parts, nunchucks?
Also this isnt really a code question, you would simply make an animation in whatever tool you want. If the weapon itself has an animation, you just play it at the same time as the character
anyone else puts a Gameobject property in the interface or there a better way to ever get the gameobject ? 🤔
public interface IDamageable
{
GameObject Object { get; }
void Damage(float amount);
}```
in the implemented class i do public GameObject Object => gameObject;
what would be the point?
If i ever need to GetComponent on a Interface
but you can just use Component or MonoBehaviour
Im not really a fan of such interfaces in the first place. Are you actually applying this to many different classes? Because if it's just one, it defeats the point of an interface. And usually the logic for stuff that takes damage is always the same.
I already have animations.. yeah youre right. I'll ask in other channel or something lol
wdym by that?
Yeah multiple scripts implement this because they all handle the Damage differently, what would you use instead?
this still is useful for decoupling library-type assemblies
Probably means that you can store a reference to the component rather than the whole game object
I find an explicitly named and typed property on such an interface that makes it very clear it’s only supposed the be implemented with a coupled component/object of that type to be a good thing. It provides a lot of opportunities for communicating intent without coercion.
that makes sense.
I also don't use it often, usually look for the component directly
Ah I guess my point doesnt really apply then here. Though one thing to consider, if you're getting this interface (likely via some physics cast or message) then dont you already have a reference to the game object
thats true. I realized for physics queries you already have the collider, so if it hits the TryGet you already know thats the correct collider
like when I do cs if (collision.collider.TryGetComponent(out IDamageable damageable)) { damageable.Damage(damageAmount); //is damageable, look for specific thing w collision.collider.TryGetComponent(out SomeOtherComponent sm) }
whats happening
waddup
Not sure if itll apply to your case too, but in my game I pass more information like who the damage dealer was
If you dont end up using it, it's an easy refactor. If you end up needing to add it, it's somewhat a pain when many things already deal damage
Quick question, which way are you guys doing melee damage detection? Just a basic raycast from player body to target or from the weapon itself or weapon collision detection?
oh yeah I usually do that for my projects, especially when it has ragdoll so I know which direction shot came from and whatnot.
this one is for a simple spaceshooter sample project im uploading for upcoming unity leaderboard tut video 😛
Just making sure I don't upload something too trashh.
felt akward just having interaface with just 1 Damage method inside lol
I do a spherecast
or an overlap sometimes
depending on the type of melee ( i find raycasts too thin)
I barely have interfaces honestly. there definitely are reasons to use them (like anikki said) but if you're just making a basic game, it doesnt really matter imo
I'll try that one boxcast didnt seem to do it
tru I might be overcomplicating it here lol
they both function exactly the same, except their shape
Yes I said it wrong, boxcast was hitting everything the rounded shape seems better
Also no need to remove it for something simpler if it works. Like in my game I only have a characters that can be damaged. For awhile I thought to myself "what if I wanna shoot a chair and it breaks" then I realized I wont even have chairs, and it doesnt even fit in my theme. Worst case I can also just make the chair a character. If league of legends can make walls out of a shitton of minions I can make a chair a character
ty for answer
yeah ima keep it for this one, I already have 3 obstacle types would be a huge if statement otherwise to do the same thing, meteors, enemy ships, debrids etc.
Oh wow LoL did that? 😆
Yes, jarvan ult is a bunch of minions for example. People have found ways to "expose" them and hook it, stun it, damage it
Many other things are too
One thing I’ve found useful in smaller projects (<100k LOC) is to aim for having as few types as possible, ie only for the necessary categories with minimal state. In case of damage I’d aim for modeling all damage types with one data struct, immutable serialized config on the component and a ‚type‘-field (an enum for example) that lets you switch between the different specific behaviors for the various entities that implement the general concept. This helps a lot with noticing gameplay modeling that’s overly complicated, because it encourages you to look for the unifying principles behind your gameplay. As a side effect it makes persistent state easier to implement and maintain across future changes. You’d implement most of this system in one class and split classes more along concerns like input/presentation/logic/etc. than entity-damage subtype.
Hey so I tried to get a personal free license and it didn't appear on my licenses page
What should I do
Hi! So pretty much I've been working on optimizing my game recently. I've been trying to minimize my use of expensive operations such as .Find(""). But I was wondering, how much is an acceptable level of using .Find()? I know an exact number would be hard to do, but I've run into scenarios where I think it would be fine to leave it as it is (as I am not running into performance issues for now). An example would be the visual effects for an attack I have, I need to spawn in five visual objects and access a child transform of each of those visual effects. Would it be fine to use .Find when spawning in these visual effects to get the transforms that I require?
Not a code a question. #💻┃unity-talk
Soz
Find is never truly needed. If you spawn an object, instantiate returns the object so you already have a direct reference. If you need some child object or component you can always just store that as a reference on a script on the parent object
thats very helpful, thank you!
It’s acceptable during setup of a scene but it depends a lot on what you are doing. Typically you don’t ever need it but it’s a boon for keeping your editor workflow alive. Aim to use it very sparingly and only if you can explain exactly why the other approach (which always exists) is not desirable. As a beginner I’d advise you try to avoid it completely, because avoiding it teaches you a lot about how unity actually works.
Ahhh I see I see. Alright thank you! ^^
It is completely harmless but I always try to avoid doing this because i hate doing (xxx as Component) and unnecessary reference. I usually create a new whole MonoBehaviour if i need access it's object or component. Yeah you are good for me if you really really want it
Probably a better idea to expose the actual types/data or have another interface, but I sometimes do it out of laziness
That Random call will only occur once, when an instance of the class is constructed.
So it should work, and give you a random float for each component - but it will be same float forever after, since you never update it
btw -10,10 will give you an int not a float, add f suffix if you want to return a float and make max inclusive
so max will be 9
what the heck?!?!
jesus
no
you do not put Access modifiers inside methods
anyway, if its just that 1 float put the Random.Range directly in the new Vector3, no need for a float var unless you want readability ig
are the how to make a video game and the how to make a 2d game tutorial series of brackeys still viable (not outdated)? I have no prior experience with coding/game development
they function, are they good ? debatble. his code is not very expandable but they do work
thank you!
btw did you see what i wrote about the integer vs float part of Random.Range?
Thanks! which tutorials would be better in your opnion for a (almost) complete beginner?
yes
if you only add 10 and not 10f unity reads it as Int which gives you a max of 9 instead of 10
learn.unity
integers and max exclusive
Free tutorials, courses, and guided pathways for mastering real-time 3D development skills to make video games, VR, AR, and more.
Thanks! I'll take a look!
start with pathways then go from there
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
!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.
can i watch videos?
also i work 3d
Here's a nice interactive example https://playgameoflife.com/
about challenges can someone give me game ideas or a challenge as well
or does anyone know how to use mlagents with cloud computing
I've got most of this code working, but I'm trying to figure out how to get the text that says "You Win" to show up, since I think there's something wrong in the script itself.
void SetCountText()
{
countText.text = "Count:" + count.ToString();
}
// This is where the pickup stuff goes.
private void OnTriggerEnter(Collider other)
{
if(other.gameObject.CompareTag("Pickup"))
{
other.gameObject.SetActive(false);
count = count + 1;
SetCountText();
}
else if(count >= 8 && other.gameObject.CompareTag("GameFinish"))
{
winTextObject.SetActive(true);
}
}
}
With it being triggered by walking over a plane and hitting it, with the tag associated with it.
add a log to the part where it sets the win text to active and find out if it ever triggers
https://paste.ofcode.org/34nRdJ4s6vpLjqJAbRnaZF2 (EnemySpawner script)
so i made a wave system , it works perfect but the problem is , every wave is the exact same enemy which can get pretty boring but i want for lets says wave 4 to have a stronger and bigger enemy that spawns , i searched on yt and goggle but still nth so im a little bit stuck and im not sure how i can do that , if anyone can help that would be amazing and appreciated alot :D
you always instantiate the 0 enemy, you can first try randomizing the number for some variety
no no , it randomizes how the enemies spawn so like it can be the EnemyPerson that spawns first or the BigEnemyPerson that spawns first , it randomized and it spawns the first that is in the list
so the enemies are random? i thought you said they arent or am i understanding wrong
I'm not sure how to actually do that.
Put a Debug.Log("TEXT"); in the brackets where you activate the text and watch the console while playing
In this line?
else if(count >= 8 && other.gameObject.CompareTag("GameFinish"))
in the curly brackets of the else if
sorry im probably not explaining correctly , so lets say the first wave starts , it will be a combination of EnemyPerson and BigEnemyPerson that spawn in the enemiesToSpawn list gets the enemies from enemies list where are the enemies that i want to spawn in the wave , it takes them and puts them in enemiesToSpawn in a randomized index and if the enemyPerson is first in that line it puts it into the spawnedEnemies list and spawns it and the next enemy etc , the wave system is nice but the problem is even if im like at wave 10 it will still be the same two types of enemies and i kinda dont want that , i want for every wave to be something new like wave 4 to introduce a new enemy that is faster or stronger etc
hope i explained better
oh i see what you've done, spawn 1 then remove it from the list ok.
i think the best way to do it is have a list of Waves, and then each wave contain a list of the types of enemies it can spawn
so you can have wave 1 doing A, and wave 10 doing ABCDE of enemies
yeah is better, hopefully what i wrote above should be understandable
its understandable but how can i have a list of the waves with my current system? im a lil bit confused
create a new script which should just be an empty class thats Serializable i think if i remember right.
in that class you can have a List/Array of possible enemies you can spawn and anything else you want a Wave to contain really.
you then in this main script make a list of this new Wave class
Okay. It's not even coming up, so, I'm not even sure what the deal is there. It should be.
I would assume you never touch a Gameobject that is tagged GameFinish
i just saw this vid and i think it has what i want but not sure how to implement it with my system lol
yup thats what im talking about
and then in your script you would have a public List<Wave> Waves;
ahhh okay okay but how do i implement it with my current system since i have these
you loop through the enemies in the current wave and spawn them
okay i think the guy in the vid is something like mine , thanks for the help :D
yeah should be, the whole system is basically the same for most people
im a bit confused on this , how do i instantiate the first enemy in the list that needs to spawn?
when I change a sprite during runtime via code, after unloading and reloading the scene it reverts back to its original state
Is there some way to save this permanently?
Not without coding a save system
My scene view cam got weirdly tilted is there any way to correct it? Kinda not a code thing but idk where to put this question and it is a beginner thing so...
#💻┃unity-talk is for general questions. Click on the transform gizmos at the top right.
does anyone know how i can integrate the code from the left with the code from the right aka my code , im not sure on how to make it so it spawns the first enemy in the list of that said curr wave
- Get the enemy prefab from the current wave
- Pass it into the instantiate
Does anyone know why I might not be able to connect my Unity Cloud to my project?
how can i get the enemy prefab from the current wave?
currentWave.enemyPrefab
Assuming currentWave has an enemyPrefab field and it's assigned.
Or currentWave.GetEnemyPrefab()
currWave is just a public int
Well, you need to store the wave data somewhere.
https://paste.ofcode.org/zQRCC3L3ZRBK5WqukD7QV4 all the code is here if needed for the enemyspawner
I'd have a separate class for the wave data:
public class WaveData
{
[SerializeField] private GameObject enemyPrefab;
public GameObject GetEnemyPrefab()
{
return enemyPrefab;
}
}
Then have an array/list of these to define all my waves.
It feels like you have several approaches mixed up...
You need to decide what approach you wanna go with and remove the unnecessary code + refactor.
so basically if i want to go with the enemy that is first in the list should spawn i should let it how it is or how the guy does it
@teal viper Type or namespace definition, or end-of-file expected
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public float speed;
public float jump;
public Rigidbody2D rb;
public BoxCollider2D bc;
void Start()
{
rb = GetComponent<Rigidbody2D>();
bc = GetComponent<BoxCollider2D>();
}
void OnCollisionEnter2D(bc col)
{
private bool canJump = true
}
void OnCollisionExit2D(bc col)
{
private bool canJump = false
}
// Update is called once per frame
void Update()
{
transform.Translate(new Vector2(speed * Time.deltaTime, 0));
if (Input.GetKey(KeyCode.Space) && canJump == true) {
rb.velocity = new Vector2(rb.velocity.x, jump);
}
}
}```
Also I guess it didn't really explain it, I'm trying to detect if a collider is colliding
"Access modifiers" like public/private change how other code can see a class's members (it's fields and methods). It doesn't make sense to use them in front of a local variable declaration (the variables you define and use only within a method's body) because they can never be externally accessed.
So like
void OnCollisionEnter2D(bc col)
{
private bool canJump = true
}
will throw an error, because you cannot use private there.
A few lines are also missing semicolons.
In void OnCollisionEnter2D(bc col) you're also saying that the type of the col variable is bc which will throw another error, as bc is not a type - it's a class field variable. Both OnCollisionEnter2D() and OnCollisionExit2D() receive an argument of type Collision2D - so that's what you should type col with
If your IDE is properly configured for Unity, it should be highlighting these issues
I think you’d need the ; at the end of the true and false things
oh nvm someone already explained it oops
Alr Imma try both of ur guys's ideas
I'm a python dev, so I'm not really used to the semicolon thing
On the bright side, you can put the entire program on a single line
Lol
Tf is error CS0246?
I did, unless I somehow mispelled the tag.
No one has the error codes memorized. But that particular one is likely complaining about void OnCollisionEnter2D(bc col) because it doesn't know what the bc type is (because it's not a type)
No errors!
Yeah I changed that to collision2d
Alr moment of truth
Does it work?
IT WORKS!!!!
LESSGO
BRO THANK YOU SO MUCH
I THINK I AM OVERREACTING
WOOOOOOO
Ride the wave :)
Cheers! 🍻
although these physics are janky, I'm gonna fix that
Hey one last question
How do you lock the camera's y position?
Is your camera a child of your player or some such, and you're trying to prevent it from jumping up with the player?
Yea
Also btw I'm trying to make an impossible game ripoff
I think in that situation (and assuming that you're not using Cinemamachine), I would take the camera out of the player's hierarchy, and instead create a little CameraController script with a Transform target; field that you can drag the player game object into in the inspector, and have the camera match target's x coordinate in... I think LateUpdate() IIRC?
Alternately, I believe there's a "Position Constraint" component you could slap on the camera and configure it to freeze the y position
There IS a position constraint, but no freezing stuff
Oh nvm
I'm gonna try moving the camera at the same speed as the player, but just in a different script
A bit late, but when we say error details, we mean the whole message, including the file name, error line and callstack. If you don't know what part you need to share, take a screenshot of the whole thing instead.
Also, C# is not python, I suggest going through the Microsoft C# manual language specifications category to learn how C# is different from other languages.
i saw this at work and wanted to chime in. you can create a custom args class/struct with IDamageable and other (necessary) params. if you need a component, provide that instead of GameObject . . .
Hey everyone, can someone explain to me why my animation is very jittery when moving. I made a quick search online and I have found out that you can fix this issue by setting the interpolate enum from non to interpolate. That is what I did and it has become a bit better, but the issue still persist... Are there any solutions here?
Here is a video that shows what I mean:
!vs
If your IDE is not underlining errors in red or autocompleting code,
please configure it using the link below:
• Visual Studio (Installed via Unity Hub)
• Visual Studio (Installed manually)
Ohh I see, would something like this be the gist of it?
public class DamageEventArgs
{
public IDamageable Target { get; }
public float Amount { get; }
public Component Source { get; }
can someone help me why my visual studio code is not autocompleting i even looked at the tutorial bu still nothing
for example the OnCollis is wrote but no autocompleteion
but as you can see i see the folders in the left from unity assets
I am doing this to get all the directoryInfos in my games saves folder
IEnumerable<DirectoryInfo> dirInfos = new DirectoryInfo(Path.Combine(dataDirPath, "saves")).EnumerateDirectories();
dataDirPath is the persistentdatapath but this has a count of 0, but when i remove the path.combine and just include the dataDirPath it has a count of 1, (the 1 being the saves folder). There are 3 files in the saves folder.
you need snippets for those
also don't tag people into your question
oh ok sorry
first fix your project error you got there
screenshot it
yeah, exactly — i have smth similar. you can create an instance of the args and invoke an event that has the DamageEventArgs as a parameter . . .
ahh got it. that makes sense actually. Thanks for tip!
did you download the .NET SDK?
ok so shoud i just go to the site linked?
id try to define something more specific than Component for the source, but overall similar to what i have too. Because with just Component you cant really do much, you'd have to try casting to every type if you wanted to actually do logic based on it
i dont really know
you have the runtimes but not SDK so yes
yeah was thinking about that cause i think earlier someone mentioned Monobehavior as choice too. but yeah true about casting it
hey, can someone help me here, I don't think anyone has responded 😭 #💻┃code-beginner message
what version of the sdk shoud i donwload???
even monobehaviour is kinda useless. you could go with another interface (with similar reasons to the talk like 10 hours ago) if multiple things can be a damage source. Or just an actual specific component that is the true source of anything that did damage
stare at it in the scene view, does it jitter there? if not, its the camera thats the one jittering.
camera needs to update at the same rate that the movement does
ahh ok I get it. I checked how my character moves in the scene view and there are no jitters, and so that means it is the camera that is jittering. If it really is the updating issue, then how do I update the camera at the same rate as the movement?
are u using cinemachine? Theres tons of options for when it should update
no I have writen my own code for that, here ill show it to you:
private Vector3 offset = new Vector3(0f, 0f, -10f);
private Vector3 velocity = Vector3.zero;
public float smoothTime;
[SerializeField] private Transform target;
void FixedUpdate(){
Vector3 targetPosition = target.position + offset;
transform.position = Vector3.SmoothDamp(transform.position, targetPosition, ref velocity, smoothTime);
}```
im not entirely sure myself how people write cameras following rigidbodies properly, i just use cinemachine. im surprised interpolate didnt make this worse though, because interpolate will move the rb every frame to create a smoother look.
did you try placing the code in LateUpdate?
LateUpdate with interpolate should be ok, though not really sure what people do without interpolate on
ok, so it looks like I was wrong about how interpolate is making things better. I just put it to none and then everything works better... I don't understand how did it work better before xD
there are some tricks. you can create an empty child GameObject to the player and use that as the target (with your camera follow code in LateUpdate). it shouldn't jitter since the child GameObject is not moving using a rigidbody . . .
yea that is exactly what I did, except for the fact that I did not use LateUpdate in the script
thank you I adjusted some settings and its working thanks bro you're the best! I had it broken for 2 years lol
thanks!
if (slotPrefab == null)
{
Debug.LogError("slotPrefab is not assigned in InventoryUI.");
return;
}
if (parent == null)
{
Debug.LogError("Parent transform is not assigned.");
return;
}
var newSlot = Instantiate(slotPrefab, parent);
if (newSlot == null)
{
Debug.LogError("Failed to instantiate slotPrefab.");
return;
}
var slotUI = newSlot.GetComponent<SlotUI>();
if (slotUI == null)
{
Debug.LogError("SlotUI component not found on slotPrefab.");
return;
}
slotUI.SetSlot(slot);
var button = newSlot.GetComponent<Button>();
if (button == null)
{
Debug.LogError("Button component not found on slotPrefab.");
return;
}
button.onClick.AddListener(() => OnSlotClicked(slot, newSlot));```
I have this method and it should copy a prefab and paste it into a specified parent. I can see copies of these prefabs appearing in the hierarchy, but they are invisible. If I personally add a prefab to the hierarchy on the stage, it will be visible. Are there any errors in this method?
Prefab look like this
-# This is not the full code. If you need more information on this - please tell me.
is the prefab set to active (enabled) in your project?
also, the slotPrefab variable should be a SlotUI type. this avoids using GetComponent to grab a reference to it . . .
oh, i see. you get multiple components from newSlot (the prefab). you could have a script on the prefab with a reference tot he SlotUI and Button components. then the slotPrefab variable would be the type of the script, and you'd access the slot and button components with newSlot.SlotUI and newSlot.Button . . .
Alright, thank you, let me try
Like this?
you'd create a separate script that references the SlotUI and Button components
// Place this on the SlotPrefab GameObject
public class Slot : MonoBehaviour
{
[field: SerializeField] public SlotUI SlotUI { get; private set; } // Assign from the inspector
[field: SerializeField] public Button Button { get; private set; } // Assign from the inspector
}```
then in your code, you can access the components straight from the instantiated object . . .
```cs
[SerializeField] private Slot slotPrefab; // Change the type to the Slot component
// somewhere in your code . . .
var newSlot = Instantiate(slotPrefab, parent); // Returns a reference to the Slot component
var slotUI = newSlot.SlotUI; // Access the SlotUI reference (property from the Slot component)
var button = newSlot.Button; // Access the button reference (property from the Slot component)```
Oh, thank you!
test it and check for errors (written without an IDE) . . .
Is this a good place to post my PlayerMotor script? I added a debug and the isGrounded keeps returning false when it should definitely be true
use this when posting !code to help with errors . . .
📃 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.
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.
should be it
📃 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.
Is it working?
I am doing this to get all the directoryInfos in my games saves folder
IEnumerable<DirectoryInfo> dirInfos = new DirectoryInfo(Path.Combine(dataDirPath, "saves")).EnumerateDirectories();
dataDirPath is the persistentdatapath but this has a count of 0, but when i remove the path.combine and just include the dataDirPath it has a count of 1, (the 1 being the saves folder). There are 3 files in the saves folder, yet it doesnt return any directory infos?
are you looking for files or folder? i'm confused
im looking for the json files in the saves folder
cause DirectoryInfo returns well directories.
Just use FileInfo
IEnumerable<FileInfo> fileInfos = savesDir.EnumerateFiles();
foreach (var fileInfo in fileInfos)
{
Debug.Log(fileInfo.Name);
}```there is also
`FileSystemInfo` to get both since they derive from it
https://hatebin.com/ptzrqqplqf
Doesn't seems to work, and I have no ideas why
This is Slot.cs file if you wonder, the other part is InventoryUI.cs
hi . i was saw the video .
this video . learn 2d game . if i wanna make 3d game . is it ok ?
becuese he is learning C#
and C# is it same in 2D and 3D ?
visual studio is giving me green error lines under each break; and unity tells me there is unreachable code, why
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.
you do not put break; after a return
break; is a statement, it can never be executed if you return directly before it
yeah i get it now
on the basis of that information, impossible to tell
Alright; I have Grid Layout Group on my object
And I also have a script, that has Main Slot Rows variable, but it's on another object.
How can I get the value of Main Slot Rows and put it as Constraint Count value in Grid Layout Group?
you cannot, you have no control over the inspector of the class
!collab, after July 18th
They've taken the bot down.
Job postings are Forum only, not here and the forum is down until July 18th
C# is same in 2D and 3D. Some functions you use are different. But the concepts you learn are very similar
against tos, this will get suspended immediately
ok . thanks
bro i have another question and it's my last question
in the video . he using C#
is it for this game . or is he learn C#
sorry if i can't say my mean
c# is c#. it doesn't suddenly start working completely differently just because you're using unity
All the first game devs specialised in Computer Graphics in compsci, programming in C
There was no Unity
There was no Unreal
Only programming in C
This should be the attitude you have before working with game engines, understand that you won't always have access to them
lol, most of the time we had no OS only BIOS
Learn programming before you start
I wasn't around during that time but I wonder how devs developed for different platforms
really there were only 2 platforms, 8080 assembler or 6502 assembler
you mean i have to learn C# first and after that i go to learn unity ?
yep you'd learn things faster than way
it's not a strict requirement, but it is REALLY helpful
I went straight into unity after I got fed up with using Scratch to make games, I would not recommend that
yeah, learning to program with Unity if you are already a competent programmer in almost any language is much less painful
Are the names of the virtual axes, like the names in the Input Manager stored anywhere?
ProjectSettings->InputManager.asset. It's a scriptable object
when I first started out I didn't know what using was, what MonoBehaviour did, what's the difference between defining my variable in a class vs defining my variable in a function
it did not work out well for me
That does not surprise me. What so many people fail to realize is that you must first learn the concepts of programming, only then can you apply syntax to actually do something
I have an Item class and then several item type classes: Weapon, Armor, Spell, Scroll, ...
Weapon & Armor need a variable isEquipped
My Item class handles dragging, since all items need to be draggable
But then depending on the isEquipped variable (which is not in Item, but in Weapon and Armor) I need to do something different with the item when dropped
Is there any way to get this IsEquipped variable that is not in Item without having to create another class like Equippable?
For example, when selling an item, which is again possible for all Items, I don't want an equipped item to be sellable
Another example, when dragging an item on an EquipmentContainer, it needs to be equipped, unless it is already equipped
{
// Get our item
Item droppedItem = eventData.pointerDrag.GetComponent<Item>();
// Don't do anything if item is already equipped
if (droppedItem.isEquipped)
{
return;
}```
That sounds like isEquiped should be in an Interface which may or may not be inherited by your Item sub classes
I know what interfaces are and how they work, kinda, but never used one
How would that solve my issue?
Hi. So I have
Mathf.Pow(6.6743, -11);
to represent newton’s universal gravity constant. For some reason, that outputs “8.541544e-10”. As far as I can tell, that number is significantly higher. Why might this happen?
do you know scientific notation? this number is basically 0
it would allow you to add the isEquiped variable to some but not all item classes
Yes I know scientific notation very well. Gravity is a weak force. That’s the number used in real life.
then whats the problem? 6.6743^-11 is indeed 8.541544e-10
but why would I use an interface for that instead of just adding the variable to the class?
also doesn't solve my issue of Item not having the variable, or would I just put the interface on Item too, but then it's basically on all the classes that inherit it too?
because then you can cast to the Interface type for all item classes, if the result is not null then you know that isEquipable is implemented
I guess it’s just the exponent changing that’s weird. Also, when I put numbers into a calculator to determine orbital velocity, the normal -11 constant gives a drastically smaller number than the -10
how would I cast to the interface type?
like any other cast
so it's the same as casting Item to Weapon or Armor?
yes
im not sure what you mean, the "normal -11 constant gives a drastically smaller number than the -10". e-10 does not just directly mean exponent. it is 8.541544 x 10^-10
but id honestly be surprised if you get accurate calculations with such a small number
I don't think floats are precise enough for e-11
cool thx 🙂
floats are only precise enough for about 8 significant digits
imagine this
public class Weapon : Item, IEquipable
public class Axe : Item, IEquipable
public class Bottle : Item
...
List<Item> items
...
IEquipable iq = items[i] as IEquipable
if (iq != null) { // Do Equipable stuff here ?
Oh so the number is just not able to get down to e-11 essentially? And kinda freaks out when it tries to?
!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.
not really, but float math wont be at all accurate like this
not really meaning its not about it freaking out. its just about values that cant be represented
well those numbers are also so incredibly small that they are effectively 0. and due to floating point inaccuracy the values may not be able to be precisely represented so may appear as some slightly different value. they are still effectively 0 though
Does this look ok?
https://gdl.space/konevuwazo.cpp
if you're on 2021+ you can combine the cast and type check into one line instead of doing it separately: if(droppedItem is IEquippable equippable)
So the number is the same but looks different because floats can’t show that number? But it is still the same?
im working on a cell based fluid sim, currently cells on the same y keep causing stackoverflows because they keep giving their fillAmount back and forth to eachother. how do people normally solve that problem? i was thinking to either save the newly added neighbours on the cells themselves or making a list of already edited cells and clearing it every iteration
looks OK
cool, my first real use case for an Interface!! 🙂
you'll make a real programmer out of me yet!
both of those numbers are so incredibly small that they can just be treated as 0
lol
add a limit to the amount of times you iterate the fluid amount
not sure what your code looks like rn
So there’s just no way to use a float to accurately represent a number that needs to be small and precise?
please go learn about floating point accuracy in computing
There might be a package out there that has a more precise float, but just know that everything a computer does is approximations
The end user does not need perfectly computed numbers
They are not scientists
here, you can see this and realize what you're doing wont work
https://dotnetfiddle.net/n9EhIf
sure there are other, more precise, data types. but that won't help when they are forced to use floats because that's what unity uses for everything. so all their worrying about these numbers that are effectively 0 is absolutely pointless
been trying different things. right now i'm storing the fillAmount on the pure class fluidcells and calling for spreads if their own fillAmount is over the threshold for spreading. only when they get water added
guess i could add a flag in there that resets every iteration
for context, if you know of the game. i'm pretty much trying to recreate the fluid mechanics of timberborn
Last question: If I don’t store it as a float in the first place, and instead just use the Mathf.Pow directly in an equation, would that work instead?
Mathf.Pow uses floats
dang it
you're not really going to find anything in the unity engine that uses any more precise data types than float
the f in Mathf might stand for something
Maybe describe your use case more. Im not a big physics person but what do you actually plan to do with these numbers? If this is a one time calculation, then i see no problem with storing these as doubles initially and then converting them to float for the actual unity usage.
It’s a simulator essentially that needs that tiny number to calculate the force of one object on another
And so it’s not possible to use a double float in calculations?
yes you can use a double in your calculations but you must convert the result to float in order to pass that to any Unity method
you'll also need to keep track of all these values yourself. it'd be inaccurate for example if you read the current position from the unity object (since thats 3 floats) and used that in your calculations with doubles to set the next position
I'm trying to set up an event system to equip my weapon
When I drag/drop my weapon on equipment it correctly sends the event to my Inventory
But how do I get the dropped weapon in my Inventory script?
Pass it as a parameter?
void Crouch()
{
if(Input.GetKeyDown(KeyCode.C))
{
transform.localScale = new Vector3(height.x, height.y/2, height.z);
GameObject gun = transform.GetChild(
}
if(Input.GetKeyUp(KeyCode.C))
{
transform.localScale = new Vector3(height.x, height.y, height.z);
}
}
why is this crouching code clunky
It doesn't even compile
using System.Collections;
using System.Collections.Generic;
using UnityEditor.Build;
using UnityEditor.Rendering;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
Rigidbody rb;
[Header("Movement settings")]
public float walk_speed;
public float gravity;
public float jumpHeight;
private Vector3 height;
bool isGrounded;
public Transform groundCheck;
public float groundRadius;
public LayerMask ground;
Vector3 velocity;
void Start()
{
rb = GetComponent<Rigidbody>();
height = transform.localScale;
}
void Update()
{
Move();
Crouch();
Jump();
}
private void FixedUpdate()
{
Move();
Jump();
}
void Move()
{
float x = Input.GetAxisRaw("Horizontal");
float z = Input.GetAxisRaw("Vertical");
Vector3 move = transform.right * x + transform.forward * z;
move = move.normalized;
rb.MovePosition(transform.position + move * walk_speed * Time.deltaTime);
}
void Crouch()
{
if(Input.GetKeyDown(KeyCode.C))
{
transform.localScale = new Vector3(height.x, height.y/2, height.z);
GameObject gun = transform.GetChild(
}
if(Input.GetKeyUp(KeyCode.C))
{
transform.localScale = new Vector3(height.x, height.y, height.z);
}
}
void Jump()
{
isGrounded = Physics.CheckSphere(groundCheck.position, groundRadius, ground);
}
}
this is the whole code if u want it
!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.
📃 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.
Yes, this throws a syntax error:
GameObject gun = transform.GetChild(
oh
i forgot to take it out
ignore that
Read the error
use Action<Weapon> instead of Action since the latter does not allow a parameter to be passed
yeah that's what I was missing, thx 🙂
also why does this inherit from monobehaviour if the only members are both static and it doesn't use anything that needs the MonoBehaviour inheritance
dunno, I just followed a YT tutorial that had me put it on an empty gameobject
well that's entirely pointless
Amazing
Perhaps, this is just a start and new methods, suitable for MonoBehaviour, are going to be added soon
Read [this](#💻┃code-beginner message) first
yeah I guess I don't need that 🙂
Your code decreases the character's height by 2 when crouching. Seems fine to me, what's the issue?
I got it now. I just set my variables and constants from floats to doubles and the Math instead of Mathf. Thanks for the help though (from everyone else too) I learned what I needed to
is there a way to only change the scale of the parent
and keep the scale of the children normal
or i need to do a for and go through all the children and double the value?
Yes, I suppose, that's what you would do
!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.
cs
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
Rigidbody rb;
Transform[] children;
[Header("Movement settings")]
public float walk_speed;
public float gravity;
public float jumpHeight;
private Vector3 height;
bool isGrounded;
public Transform groundCheck;
public float groundRadius;
public LayerMask ground;
Vector3 velocity;
void Start()
{
rb = GetComponent<Rigidbody>();
height = transform.localScale;
children = new Transform[transform.childCount];
for (int i = 0; i < transform.childCount; i++)
children[i] = transform.GetChild(i);
}
void Update()
{
Move();
Crouch();
Jump();
}
private void FixedUpdate()
{
Move();
Jump();
}
void Move()
{
float x = Input.GetAxisRaw("Horizontal");
float z = Input.GetAxisRaw("Vertical");
Vector3 move = transform.right * x + transform.forward * z;
move = move.normalized;
rb.MovePosition(transform.position + move * walk_speed * Time.deltaTime);
}
void Crouch()
{
if(Input.GetKeyDown(KeyCode.C))
{
transform.localScale = new Vector3(height.x, height.y/2, height.z);
for (int i = 0; i < transform.childCount; i++)
children[i].localScale = new Vector3(children[i].localScale.x, children[i].localScale.y * 2, children[i].localScale.z);
}
if(Input.GetKeyUp(KeyCode.C))
{
transform.localScale = new Vector3(height.x, height.y, height.z);
for (int i = 0; i < transform.childCount; i++)
children[i].localScale = new Vector3(children[i].localScale.x, children[i].localScale.y / 2, children[i].localScale.z);
}
}
void Jump()
{
isGrounded = Physics.CheckSphere(groundCheck.position, groundRadius, ground);
}
is this efficient
to scale back all the children
What does this mean? "Default references will only be applied in edit mode."
it means exactly what it says. the object you drag in there will only be applied to instances of that object created via the editor. using AddComponent in code will not assign that field automatically
yeah that's what I thought, not very clear though
Hello, I'd like to make a system to place blocks with unity, it doesn't work, the block doesn't move to the end of my player's raycast, I use a layer so that the raycast doesn't interfere with the player
public class Build : MonoBehaviour
{
[SerializeField]
public GameObject blockPrefabs;
void Start()
{
this.blockPrefabs = Instantiate(this.blockPrefabs, new Vector3(0, 0, 0), Quaternion.identity);
}
// Update is called once per frame
void Update()
{
RaycastHit hit;
if (Physics.Raycast(camera.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0)), out hit, 10, LayerMask.GetMask("Player")))
{
this.blockPrefabs.transform.position = hit.point;
}
}
}
I use a layer so that the raycast doesn't interfere with the player
that's basically the opposite of what your layermask is being used for. it will only detect objects on the layer named Player
timescale is 0 but game continues to spawn prefabs ?
depends on it. If you use a time based timer to spawn prefabs and it doesn't get reset back, then it keeps on spawning. Or you're probably using a non-time based timer
yea
im checking by a integer that counts up
untill a certain value
then gets reset
show code
can you share the code?
the integer counts up to 200 then gets reset
aswell as the object being instantiated
that code is not only framerate dependent (so faster on higher framerates) but has nothing to do with the timescale. except, of course, for that erroneous deltaTime multiplication in the velocity assignment
how do i make it time depedant?
szooczt += Time.deltaTime;
make your szooczt a float instead of an int, and increment it by deltaTime. then instead of using that arbitrary 200 unit, compare it the number of seconds you want to pass between spawns
so im guessing 1 is 1 second?
like by using time.deltatime
szooczt would increment by 1 second?
there are 60 frames a second, so it would get incremented by 0.06 each time if my math is correct.
it is not
That's if it's a solid framerate, deltaTime retrieves the time since the last frame to be more specific
I think
share your !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.
and i dont have cinemachine imported
then why are you asking in a code channel?
Yeah thanks for the great help
ask in the correct channel and you might get some, over entitlement problem on your part
hello how can i set a coroutine to null after its finished?
What do you mean exactly? Do you mean a coroutine reference?
What components are you using on object that you're trying to move?
coroutine = null;
If you're using a Character Controller, it ignores modifications to the Transform component
And what else?
Show a screenshot of the inspector of it
is there a way to do it like this?
private Coroutine myCoroutine;
IEnumerator MyCoroutine()
{
//Code
//Set coroutine to null
}
private void Func()
{
myCoroutine = StartCoroutine(MyCoroutine())
}
yes
exactly like that in fact
I don't remember the exact type for coroutines, but yes that should technically work
like this?
private Coroutine myCoroutine;
IEnumerator MyCoroutine()
{
//Code
//Set coroutine to null
myCoroutine = null;
}
private void Func()
{
myCoroutine = StartCoroutine(MyCoroutine())
}
Yep
thanks
one more thing
does stopping a coroutine whit the StopCoroutine(coroutine) makes it null?
no
oh ok
Try disabling this script and then trying again.
Also, when you say it "has no effect", do you actually have non UI elements in the scene to actually see the camera moving?
i have a background which i can spot if the camera moved
If you don't assign it null, it's not null. You're just stopping its execution . . .
How did you do the background? Is it a sprite renderer?
Show the inspector of that
ui image
and tried with a sprite renderer too
So, a UI Image
that is meant to move with the camera
and not move
That is how you're determining the camera isn't moving
no i am looking at the transform position of the camera which should change right when it moves
Yes, but you said it wasn't working even if you changed those by hand. That would be because UI Overlays follow the camera
You are always subtracting same thing here?
yes
direction is always zero
I thought there was no code related to your problem? This is why context in your question is important
It's not mentioned to bully or annoy somebody, there are different channels for different problems
Perhaps you wanted GetMouseButtonDown for the first if condition
Debug.Log what value you are getting
Could I get some tips on how to code a visual indicator for a lock on system? Something like the Huntress' bow aiming from Risk of Rain 2. I'm thinking the best way would be to set up a system that moves around the indicator through a UI canvas and changes its size and position based on the distance the enemy is from the player and whether or not they're on the screen.
it seems to be the most effective way but there could always be something better
what variable type would i use to make
Input.mousePosition
into a variable
badly presented question, look below for a better phrased version
vector3
if you hover over mousePosition in your IDE it will tell you
Look at the Unity docs to see what type mousePosition is . . .
also i would recommend just using Vector2 for mouse positions because your screen is 2D, so it only needs the vertical and horizontal coordinates of your mouse. I'm not really how sure how the third vector would make an appearance
You just do string formatting.
!ban 959495299443863552 Nazi reference in pronouns
matvei31231238791 was banned.
so just grab the local string and then attach the number, i have never worked with localisation
This is not as much localization as just the basics of working with strings.
String.Format()
https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-string-format#get-started-with-the-stringformat-method
but i want to work with the unity locale package ?
to translate to the correct language
Why would that matter?
what ?
I don't know how you're using the localization package, but it probably just provides you a string in the correct language. After that you can use the string formatting to add your stats/numbers
im confused on how to even access the localized string via code, the only stuff i really find is to use an extra script to attach to your game object that then replaces the text on awake
i guess i could run a script on start then that grabs the number and appends it to that textbox
Well, solve one problem at a time. String formatting is one problem. Using the localization package correctly is another. Research them in order.
i dont care about string formatting never asked for that
Didn't you ask how to put numbers in the middle of your text?
i want to load the correct localized string and then append the number
And that's exactly what string formatting is for
the problem is that currently the only way i know of using localization is that extra script to attach to your game object that then replaces the text on awake
The appending numbers part
Yes, you'll need some code to set the correct string to the text component
How what?
can I access the material of a particle subemmitter with a script and change properties in it for each particle?
Question:
How can i load a string from the Localisation Feature of Unity via Code ?
I only found something tedious where i have to do something {value} to a smart string, but that sounds overly complex.
I would like to use something like this, but i couldnt find anything
text = Locale.LocalisedString(tablename,key)
text = text + damagenumber
Did you research how to use the localization package? Did you look at the docs?
Yes, i looked trough this and couldnt find anything that resembles what i want
https://docs.unity3d.com/Packages/com.unity.localization@1.5/manual/Scripting.html
As i said i found Smart String which kinda resemble what i need, but it seems rather tedious then just grabbing the string and adding my number via code
I've never used that package, but it looks like localizedString would be enought for your use case. You just need to format the returned stringed, as I mentioned earlier.
im actually blind
if i follow that LocalizedString to its implemtation stuff
https://docs.unity3d.com/Packages/com.unity.localization@1.5/api/UnityEngine.Localization.LocalizedString.html
i can see how to access it
but i can also see that the implemtation via Smart String isnt actually that hard
thanks tho
Smart Strings are a powerful alternative to using String.Format
It seems like they just do some more stuff for you.
can I not get the rendering material of each particle to change its properties?
what's particles?
https://docs.unity3d.com/ScriptReference/ParticleSystem.Particle.html no material prop here
We don't support multiple materials within a single particle system. All particles will be rendered using the same material.
https://forum.unity.com/threads/multiple-materials-in-particle-system.1204639/#post-7698733
I am trying to apply multiple materials to a mesh renderer in my particle system but I cannot figure out how to do so.
I have provided a link to 4...
I see
yah I checked that, I also cant find the one the way to change it in the whole particle system
That’s pretty much the point of particle system
it is a subemmiter but I can just change its own particle system
It has a renderer
I know but I mean changing material properties
In what way? Particles also have their own shader
like I have a material I set to be the particles material
and I wanted to access that material and change the properties of it in runtime
Keep in mind when you modify a new instance is created
You can use .sharedMaterial if you want , then modify whatever you want
wont that change for all the objects with that material?
Yes
but I wanted to change it for each particle system
I just wanted my material to have like a "start anim"
so something happens when it appears but Time doesnt work for that since it starts counting since the start of the game
Why not make w timer and just swap material instead of directly modding it in the shader
so swapping the material to make it look like its animated?
I thought setting a property would be less expensive
Well no you're creating a new material when you modify it
I see, thanks
so what is the syntax to access it directly?
something like particleSystem.renderer.material?
thanks
uh, i have a very weird unity... is it a bug or am i just doing something wrong?
basically
one of my buttons dont work
and i dont know why
it worked fine
i added another canvas to make a pause menu, but even when removing it still doesnt work???, the button doesnt let me click it
Do you have an event system in the scene
wdym
I mean do you have an event system in the scene
why would that effect wether a button is clickable
Because that is literally the component that makes buttons clickable
you might just try going to the history panel and clicking back to before you added the canvas
the event is if a certain bool is false make the canvas which has a child that is the button, visible
what event?
the weird thing is i remove the canvas and the button STILL isnt clickable
If there is not an Event System in the scene, that would be why your UI doesn't work
theres nothing that specifically uses Event and each indiviual gameobject has its own script
i dont get what you mean by event system
I mean an Event System
oh dear
The object named Event System that has an Event System component on it
IE delegates
gameobject named eventsystem
that has an eventsystem gameobject?
i mean component*
Whenever you first create any UI element in a scene, it will also create an Event System. That component is what makes UI work
don't remove it
i havent touched anything
Notably, it doesn't get auto-created if you instantiate a UI element from a prefab
So, check your scene. Do you have an Event System in it
But it does have useful debugging features, if you look at the window on the bottom of the inspector of it while you're running the game, it will tell you what your cursor is hovering
Hover over the button that isn't working and see what it says you're hovering over
ok
ok first of all
i hovered over it and it said text, and the button didnt work, but it worked before, so okay idk maybe something changed so i made the textbox smaller and now it tells me i hover over either the text or the button and when i click the button it STILL doesnt work??
If it says you're hovering over the text, then that is the thing you're clicking on, rather than the button. If you don't want to be able to click on that object, uncheck the "Raycast Target" checkbox on that object
Does the Event System now show that the button is the thing you're hovering over
yes
Does the button have any sort of animations or response to hovering over it?
no
if i try to click it nothing happens,
not even the weird tilt the other buttons have
Can you show the inspector of the button, and the event system when you're hovering it?
that makes it slightly darker yk
what parts do you need
heres this just so you can rule out that it has no script
If you can get the whole button inspector that would be nice
wait a min
i just saw something in the inspector
in eventsystem
it says im hovering over the button but its not eligble for click?
What are you trying to do
What are you seeing?
Make the Vector3 into movement direction
How do you intend to move

