#💻┃code-beginner
1 messages · Page 379 of 1
like if i jump it should not look at me jump
i just want it to move along the z axis with player
holding jump does that weird camera thing
not holding it looks good
public class WaitForAnimation : CustomYieldInstruction
{
private Animator animator;
public override bool keepWaiting => animator.GetCurrentAnimatorStateInfo(0).normalizedTime < 1;
public WaitForAnimation(Animator animator)
{
this.animator = animator;
}
}
Anyone know why this doesn't work for my coroutine?
Use the player gameobjects transform as reference
what in the actual fuck?
I want it to be green (I'll deal with the size of all these squares later) but why is it showing white on the color tab?
this is a coding channel
This is the beginning code channel, for non-code-beginner questions, try #💻┃unity-talk
Make sure to explain what the issue is. As for the color property in the inspector:
Define the vertex color of the Sprite, which tints or recolors the Sprite’s image. Use the color picker to set the vertex color of the rendered Sprite texture.
It would alter the color of a white cube - try it.
Show some code then.
Implies it's an issue with code
You're changing the material color, not the SpriteRenderer color
so why do you expect the SpriteRenderer color to be anything else
Maybe read along first mao 😄
looks green in the scene though
changing color links to _Color too so it should work
Check the right side of the game view
because spriteRender uses _Color for the vertex coloring
to avoid spam
"......."
So still, wondering why all your boxes get green except the last column
problem with doing it in the shader like that is it'll change the color for all sprite renders using that material
does any one have a double sided mesh collider script??
so ideally change the sprite render's color property
oh.....
makes sense
well they're all the same color here but still
Actually, it'll create a new sprite render material for each sprite unless you do sharedmaterial. Either way, don't change vertex color in the shader. (less of a problem in URP, but you still need to destroy the material if you aren't using them later)
What exactly are you expecting to get? Like box in a box as collider? thast not gonna happen if you mean that
kinda i mean like a double sided mesh for example this dome
if its not possible ill figure out another way
ok new problem here
I know my code looks atrocious
but the point of it is to basically space out all the squares with the distance between the squares being n * their length (1/4 of their length in this case)
you need to specify more what you actually mean. double sided mesh "script"? What are you trying to do
if you want to collide from outside and inside, that would be a mesh collider and the mesh would have to serve the vertcies for it. Not sure tho about convex/concave colliders these days. I know they were not possible back in the days
but they aren't really aligned in the way I want them to be and the space between them certainly isn't 1/4th of their length
oh okay ill give that a try
you know you can set the parent within the instantiate method, right? right now you are instantiating worldspace and then parent to something locally.
changed it
what the
I made everything have f
this is literally the opposite of what I intended
I mean
the fact that the squares are in the camera is good
but why is the distance between squares bigger than the lengths of the squares themselves?
it's -1 -> 1 for x and -16/9 -> 16/9 for y btw if you're wondering about the size of the camera
oh I found the problem
I need to actually double the size for these guys
since in the instantiate, their vectors are multiplied by 2 or -2 and then have to them added -1 or 1 to convert from 0 -> 1, 0 -> 1 to -1 -> 1, 1 -> -1
magnificent
is that distance actually 1/4 though?
I think so yeah
I was scared that c# wouldn't allow variable array sizes but since it does I can do it with more than 10 x 10 squares now
C# doesn't allow changing the array size. Unless you mean something else
He means supporting multidimentional arrays. [,]
ah yes, the error || || my favourite! this should be easy to fix
!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
I've gone over the guide and looked at forums but intellisense is not working for vscode
it recognizes things like what a monobehavior is, and it autocompletes things like int var etc but like not void awake
how do i fix this enemy instead of patrolling it is going circles in one placeeee
Can you show your package manager?
Make sure Visual Studio Editor is installed and up to date.
Remove Visual Studio Code Editor, it's no longer necessary, obsolete and even conflicts with the newer Visual Studio Editor Package.
Change the code that makes it go in a circle to code that makes it patrol between points.
Nothing much else can be said unless you show code
ill send u the code
dm or here?
You should read the #854851968446365696 and #📖┃code-of-conduct which would also clarify on your question above about dming.
!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.
a powerful website for storing and sharing text and code snippets. completely free and open source.
Is this from chatgpt?
Why would it set isChasing to false when that method is only called when it already is false
nop
How can I make the movement of a dynamic rigidbody be precise and constant, instead of slowing down and smoothing out towards the end of the movement?
That does not happen with kinematic movement. But I need dynamic rigidbodies to have collision between characters.
I dont really see which part of this even tries to patrol. I suggest you add debugs, especially like Debug.DrawRay or DrawLine so you can visualize what direction this is trying to move and hopefully that clarify to you why its moving around like this. I suspect it might be do to it only moving in its transform.forward direction which isnt rotating fast enough. You could just have it move in the actual wanted direction instead of just forward. I do have to go so try to learn to add more debugs into what's happening
wait ill check the code cuz i made two of them one is chat gpt but the one im using in the video is not chatgpt made
Are you moving it with AddForce?
One way to get "snappy" movement is to directly change rb.velocity instead
https://paste.myst.rs/2n9trbof this is the none chatgpt sorry i sent the wrong code
a powerful website for storing and sharing text and code snippets. completely free and open source.
Any idea how this line caused a stack overflow?
OnHover?.Invoke();
On Hover is a
public UnityEvent OnHover;
at a guess you have subscribed a method to the event which allso Invokes OnHover
Interestingly enough it only happens with one specific instance of that class,
Let me look after that
well
Removing that fixed it xD
Idk why it was there to begin with, trying to revive an old project
Thanks a lot!
Is there a way to declare a prefab as a variant of another if it's already instantiated
assuming the makeup of the prefab is similar enough
I am moving it with rb.MovePosition(newPosition);
newPosition = Vector2.MoveTowards(rb.position, targetSlot.Value, moveSpeed * Time.deltaTime);
Make sure that your input isn't smoothed
Idk what else here would make you accelerate/decelerate over time
Showing your full script would help tho
I don't understand why is this not destroying the player.
Anything I missed?
Also better update newPosition before moving, not after
im new to programming and what not but would someone please help me out with why my selection manager code keeps giving me the cs0246 error ive tried googling it but everything its telling me is something ive already tried
Post the entire error - stack trace.
Thanks, the movement is precise now. But if I have multiple units and they bump into each other, they get pushed around and slide a little bit.
Is it possible to prevent them from sliding, and just make them block each other?
this bit?
The error says that it doesn't know what a Text is. You may need to include the directive.
im so new i wouldnt know how to do that
Right click Text in your script and there should be an action that would allow you to add the missing directive - assuming your ide is properly configured.
First thing that comes to mind is try higher friction values in the rigidbody's or collider's physics material
You'll need to configure your !ide to get proper help on this discord server - part of the rules and it would solve most if not all minor mistakes/syntax-errors like this.
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
oh right mad thank you
Don't be afraid to ask for help on any concerns with the configuration though.
The common issues when installing VS or VSC are:
- VS: user forgets to select the Unity Workload during installation
- VSC: user needs to manually remove the VSC Editor package - it's obsolete and conflicts with the new VS Editor package.
i did it and its still not doing what you said it would when i right click can we call or something and you run me through it real quick
Which IDE are you using?
vscode
What unity version?
Assuming you've done the configuration steps already, show an image of your package manager
For example 2021.1.6f1 didnt work well with the new vscode package for me
But 2021 LTS works better
2022.3.32f1*
Show an image of your package manager. Visual Studio Editor should be installed.
You still have the old package
oh
Update the Visual Studio Editor package and remove the Visual Studio Code Editor package - it's obsolete now and conflicts with the new Visual Studio package.
ok ill do that now
im gonna sound slow but hteres no update button or anything
and i cant even remove it if i wanted to
2.0.22 is the newest version
Does it not let you remove the other package?
no it doesnt
So the Remove button is greyed out?
yeah
Not sure then. Havent seen that lock icon myself - must be a unity 2022+ thing
2021.3.39f1
Click on Visual Studio Code Editor and show us the package
Okay so seems like the Engineering package is using that package
hm ok where would i change that
every time i add a box collider to my player, it breaks the movement
Search for the Engineering package and remove it if you don't need it
ight
Okay. How are you moving? Show code
paste the whole code?
he means ss
📃 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.
Show the movement script at least
oh fair enough
You should be able to right click Text and perform a suggested action - include the Unity UI directive. If not, you may need to regenerate the project.
Left click that light bulb
go to Edit > Preferences > External Tools
and regenerate the project.
Show a screen shot of your packages
So how does the movement break?
Not sure if boxcollider2D supports negative scale, that could be an issue
idk what this means sorry
Here you said 'it breaks movement', in what way does it break
Because that doesn't really say anything
oh. so like the camera still movse but the player is just stuck and doesnt move at all.
Found small visual bug, i made component script "Toggle", but inspector still shows UnityEngine.UI.Toggle script icon
P.S if i asign it it will change icon
#💻┃unity-talk This is a code channel
Okay
I'm not sure why your ide isn't providing intellisense, auto complete and suggestions. Likely it isn't properly configured. Is Text underlined red?
no
Close your VSC Editor and reboot the Unity Editor
alright
it was something else i figured it out thx
guys i have this while loop in a "OnTriggerEnter" and i have this
WHY DOES UNITY CRASH EVERY TIME I COLLIDE WITH THIS
and if i remove the delay it dosent crash but it spawns every object at the same time which makes it kinda laggy so i added a delay and now it crashes
im so confused
Because it never ends the while loop.
And Unity is single threaded, so it will never have time to do anything else.
Why is the while loop even there 🤔
didnt do anything
and it does i++ each turn
im gonna try reconfiguring it and see if that fixes anything
well its supposed to end tho? cuz the spawndelay when its set to 0.1f it goes back to 0 then it spawns it again and goes to 0.1 and then 0 to spawn it again until i = number2
well in theory
Can you post the full !code then? Because if Unity hangs, it's because it's stuck in this while loop. Or another while loop you made.
I have no idea what number2 means.
I just wouldn't advise while loops anyhow for beginners, because you get things like this.
This could easily be fixed with a for loop instead.
📃 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 if the if(spawnDelay < 0) is false in the while loop, then i will never get incremented and the while loop is stuck forever
Because i < number2 wil stay true
when spawndelay is >0 it just waits for it to become 0 and thne do it again right?
that's whta im hoping for im making a delay
This is a coding channel. Either share relevant code or use the proper channel. Also, "how to fix it" is unclear.
Like I said, it never goes to any other piece of code when it's stuck in a while loop.
So it will not decrease spawnDelay, because that's in the Update and that's not in the while loop.
ohhhh
does a for loop fix this?
Nope, nothing here makes it wait.
If you want to wait inside a method then you might wanna look at Coroutines
i tried a couroutine and it also crashed
If you use a while loop sure, you would need to yield it if you did that.
I think a good coroutine like osmal says is the best way.
Yep, gotta yield to make it wait a frame and give the values a chance to change
Code doesn't take in-game time to run. It happens instantly, all at once.
show i use vscode or vsenterprise cause looking at the configuring ide it has both but im wondering if one is better then the other
there is no such thing as "vsenterprise"
there's Visual Studio and Visual Studio Code
there are different versions of Visual Studio, yes, but they aren't unique code editors or something
yeah alright
alright ive followed the steps and what not but its still no configured properly
did you really just go follow all of the steps for VSCode in the past 60 seconds
or do you mean you tried earlier? :p
This has been going on for a while
oh boy
yeah
okay, so show me your package manager window (showing the Visual Studio Editor package) and the External Tools settings
You have had that compile error for a while, maybe it is messing something up
its to do with what im coding which wa why i came here to begin with but then that editing thingo wont work so im stuck do i delete the script reset unity the redo it?
Fix the error by adding using UnityEngine.UI; to the top of the offending script
well, presumably you have not defined InteractableObject
let's try something else first, though
alright
close VSCode, hit "Regenerate project files", and double click a script asset to re-open VSCode
If it's not working, hit ctrl-shift-U to open the Output window
ight
then switch it to C# and scroll up to the top of the log
i just had to make it so the coroutine is the one that repeats itself in the end instead of calling it with a while loop 😅 @fossil drum
Correct.
Starting a coroutine does nothing.
It does not "delay" the method that started it
otherwise your game would freeze
well, to be exact: StartCoroutine will run until it hits a yield
i cant find that C# thing but shouldnt it already be C#
screenshot your entire VSCode window.
and all of a sudden the dev kit has an error everything is fuck stuffing up
This is the dropdown I was pointing to.
fuck im slow
It's possible that the .NET Install Tool is having a problem. That would prevent the editor from working.
possible
I'll also need to see the installed Unity extension
okay, so that's present
so, what do you see in the C# output window? My editor spits out something like this
hmm yeah idk
i'd whack it with the "restart computer" stick before continuing
ight ill see what that does
If you didnt restart unity and vscode after you fixed the compiler errors, I would definitely do that
i find visual studio more obnoxious to deal with tbh
although, it also doesn't exist at all on my mac
which is a more pressing concern
Sadly visual studio often hangs for me especially in a large project
it's very very obviously a 3000 year old IDE
dem fightin' words . . .
I used it for C++, because VSCode's C++ extension can't grok templates at all
No should’ve have
good to know; i randomly started learning C++ bcuz i got stuck on making a custom inspector with ui toolkit . . .
Switch to the Terminal tab at the bottom and try running dotnet
Wait ui toolkit can use c++?
Oh or you mean you gave up on that and started learning c++?
no, i was doing ui toolkit stuff that i couldn't get to work out and got frustrated . . .
I see
yep . . . 😅
That's fine, then
oh, one thing
run dotnet --info
maybe this is an ancient version of dotnet
i was bored and wanted smth to do. kept reading it would be good to know/learn C or C++ and was curious . . .
get well soon 🙏
that's the same version I'm using, so presumably it's fine
yeah
guys i have a code for basic movement but when i crouch my flashlight becomes smaller and goes higher
how do i fix this
switch to the "C# Dev Kit" tab in the Output window and share the contents through a paste site like https://gdl.space
first, turn off debug mode in your inspector
click the vertical dots button there
I'm guessing you're scaling down playerBody when you crouch
done do i paste the link here again
well, don't do that
that's going to scale everything parented to playerBody
Are you trying to reduce the size of a CharacterController or something?
yes
playerbody is the CC
you can change the size of the character controller without scaling playerBody
just change the height and center of the character controller
i tried that but then i fly mid-air
ah, I wonder if dotnet is just the runtime, and you still need to install the SDK separately
I'm a little fuzzy on that
https://dotnet.microsoft.com/en-us/download
Download the .NET 8.0 SDK from here
hmm ill install the sdk again
then restart after the installation
i can show you my code if u want
all of the questions I found asking about this particular line:
The application 'restore' does not exist.
say that this'll happen if you don't have the SDK
yes, because you need to adjust the camera's position as well
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class movement : MonoBehaviour
{
public CharacterController controller;
public float walkSpeed = 12f;
public float sprintSpeed = 20f;
public float crouchSpeed = 8f;
public float speed = 12f;
public float gravity = -19.62f;
public float jumpHeight = 3f;
public Transform groundCheck;
public float groundDistance = 0.4f;
public LayerMask groundMask;
public Vector3 velocity;
public bool isGrounded;
public float playerHeight = 1f;
public float crouchHeight = .4f;
[System.NonSerialized]
public bool crouching = false;
private bool goDown;
// Update is called once per frame
void Update()
{
//Crouching
if(Input.GetKeyDown(KeyCode.LeftControl))
{
crouching = true;
goDown = true;
speed = crouchSpeed;
}
else if (Input.GetKeyUp(KeyCode.LeftControl))
{
crouching = false;
}
if (crouching && goDown)
{
transform.localScale = new Vector3(1f, crouchHeight, 1f);
goDown = false;
}
else if (!crouching && !goDown)
{
transform.localScale = new Vector3(1f, playerHeight, 1f);
}
}
alright done
!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.
please read the bot message
ok
i installed it
so, as I said, you need to stop changing the scale of playerBody
that's going to cause everything that's parented to it to get squished
You should change the height and center of the character controller.
Then you need to move the camera up and down so that it's in the right spot
how do i do that cuz im new to coding
Try playing with the height and center in the inspector
That will show you the values you need to use
(the center should basically just be Vector3.up * height / 2)
alight fen is there anything else i needa try
run dotnet restore in your terminal
you should get an error about not providing a project file
if i would do what you say would this also make my groundcheck go up
okay, that looks fine
no, because you're moving the center of the character controller down at the same time that you're reducing its height
everything will stay in the same place
now, show me the C# and C# Dev Kit outputs again
what should i do with my crouch- and playerheight
i don't know what you mean by "what should i do with my crouch"
i just described how to make your character controller shorter
no but i have 2 public bools called crouchheight and playerheight
playerheight = 1f
crouchheight = .4f
you can use those to set the height of your character controller
so let me get this straight,
the character controller should become smaller which moves the camera down without scaling the camera down
but idk how to do any of that
Changing the character controller's size only changes its size. It does not cause anything else to move around.
if you have no idea how to change a few fields on a character controller, you might want to stop and switch to some !learn tutorials first
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
okay, so it now reports that you have a .NET SDK installed (it previously didn't)
alright finally getting somewhere lol
and for a sanity check, show me "dotnet.exe" --info
i'm pretty sure that's identical to dotnet.exe --info on Windows, but, you know
might as well make sure
I have some buttons that once clicked I want to desactivate I want them to disappear and not be visible, but when I do, it doesn't work, here is the code:
public class UIManager : MonoBehaviour {
[SerializeField] private Button startServerButton;
[SerializeField] private Button startClientButton;
[SerializeField] private Button goBackButton;
[SerializeField] private Image connectionMenuBackground;
[SerializeField] private TextMeshProUGUI playersInGameText;
[SerializeField] private Camera connectionMenuCamera;
private void Awake() { Cursor.visible = true; }
private void Start() {
playersInGameText.enabled = false;
startServerButton.onClick.AddListener(() => {
if (NetworkManager.Singleton.StartServer()) {
Debug.Log("Server started...");
} else { Debug.Log("Server couldn't be started..."); }
startServerButton.enabled = false;
startClientButton.enabled = false;
goBackButton.enabled = false;
connectionMenuBackground.enabled = false;
connectionMenuCamera.enabled = false;
playersInGameText.enabled = true;
});
startClientButton.onClick.AddListener(() => {
if (NetworkManager.Singleton.StartClient()) {
Debug.Log("Client started...");
} else { Debug.Log("Client couldn't be started..."); }
startServerButton.enabled = false;
startClientButton.enabled = false;
goBackButton.enabled = false;
connectionMenuBackground.enabled = false;
connectionMenuCamera.enabled = false;
playersInGameText.enabled = true;
});
}
}
They are not clickable, just still visible
disabling the Button component doesn't stop it from showing up. You can deactivate the entire game object, though
Did you restart your computer after installing the SDK?
no was i supossed to do that?\
i forgot to mention it
ah ok ill do that real quick
I wonder if VSCode is still hanging onto something from before the install
ight done
there was an update
yo i think you did something
these red squwiggles werent there before
Doesnt like like Unity is connected ur IDE anymore
What do you mean?
well when i double clicked on thingo it came up with vscode so i think its still working
i dont think this should throw an error? (trying to make an editor)
target doesn't exist though
Does the class inherit from Editor?
Nope, thank you
nice!
yeah but it still wont fix my issue
your issue was that your IDE wasn't working :p
i guess you just have another issue now
so what is InteractableObject?
where is it defined?
im sorry what do you mean
You're trying to use a type called InteractableObject.
yes
anyone know a fix to this?
!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.
So I have a 2D-Platformer and i want the camera to follow the player, i got a script cameracontroller like this:
using UnityEngine;
public class CameraContoller : MonoBehaviour
{
[SerializeField] private Transform player;
private void update()
{
transform.position = new Vector3(player.position.x , transform.position.y, transform.position.z);
}
}
but it doen't work, what can I change to get it work?
i still dont really know what you mean sorry im knackered
Update
ohh thx
you could spell Update correctly
the code you just sent declares a class called SelectionManager
so where is the code that declares a class called InteractableObject?
oh i dont have one
then why did you expect any of this to work?
you can't just make up random names that don't exist
well actually i assumed it would be my crossair thing
oh wait im slow its my interaction info ui thats the class its supposed to be
i fixed it
Hey guys, a few days ago i asked about my game doesnt work correctly when i builded. (But it works in unity editor). When i build for WebGL, it works perfectly. But for windows or android, it returns Null error when i play. Also If I build other than webgl, i get an error like this :
What to do?
I'm loosing my mind.
I want to make a bullet to ricochet from walls. But i'm using kinematic rigidbody.
Is there any good way to SetRotation of Rigidbody2D by Vector2?
Or i'm better off with turning it to dynamic and use velocity? Cuz that works.
Vector2.Reflect
I mean, yeah, but how to translate it to rotation angle for rigidbody?
Like, i have two vector2 variables(reflect and current transform.right)
What's the issue? Why would you need to rotate it? Can't you just set the forward direction?
Or rather right, with 2d.
But is it really ok to modify transform and not rigidbody?
And can you just do that like transform.right = reflect?
You could probably access the rotation property of the rigid body if necessary and assign it a quaternion relative to direction https://docs.unity3d.com/ScriptReference/Quaternion.LookRotation.html
Where forward would be your unchanged forward and up would be your new up relative to the reflection.
Doesn't seem to work like it should.
I'll stick with dynamic and velocity i guess
I just started Unity and I'm trying to make a game like Cookie Clicker. I have a button that changes the workerShopActive bool but when I start the game the worker buttons are the only thing that shows, and it says "worker" in the console. When i click the button both button types are not active and it still says worker in the console. does anyone know how to help
If you're getting the log "worker" in the console, it means that there is at least one active instance of this script where storeScript.workerShopActive && isWorkerButton is true
How to I turn the other buttons back on though?
Simple trigonometry that part - Mathf.Atan2
how do i get out of this mode?
Theres a hotkey that I forgot but you can double click the top bar next to Scene
What other buttons? This script seems to turn itself off or on a bunch based off of different conditions
Nothing here seems to reference any other buttons
shift-space
or right click the game window tab and un maximize
or double click it
k ty
in the same script the bool isWorkerButton will change the text it needs how much you can buy of an item and when to show in the shop.
Hi
Me and a friend were trying to code
How to solve this?
It says "there should be a }"
You're probably missing a }
Can't really tell without you actually showing the rest of the code
It would be suggestive content
Cause we named the objects
Kind of explicit ways
So idk if i can
For every { you need a }
Ok ill see
Just add a } at the end of the script, the error is pretty straightforward
I'm surprised you didn't just try it out after reading the error
For some reason my tag won't change to other falling when the other is other falling 2. Here's the code: https://pastecode.io/s/p1fks6e2
how do i fix the project settings bug? (atleast i think its a bug)
wdym "the project settings bug"
it doesnt show
You're checking this object's tag for "Other Falling 2"
does anyone know how can i fix it?
and "it" is referring to . . . ?
Also, please consider learning what a boolean is so you don't need to encode literally every piece of information about an object in its tag and layer
I wonder if Windows threw the window way off screen
you do realize that this is a code channel right? and have you tried restarting unity?
try hitting win-left or win-right after trying to open the settings
otherwise, yes, restart, then ask in #💻┃unity-talk
I tried switching the other and this, but it didn't work
Before the if, log this.gameObject.tag and other.gameObject.tag
See what they are at that point
whats happening with the task bar tf
What about it
that looks like default windows 11 settings
this is not a windows support server
hello guys i am having a little issue in here, the first print is working good but the sencond if is not getting, can someone help me please?
note that Destroy(Isco) will not destroy a game object
One of those conditions is false. Or you're getting an error
unless Isco is itself a game object, I guess
i'm very confused by Isco.gameObject.GetComponent<Isco>()
Then why the .gameObject 😵💫
the first one is a variable and the second one is the name of a class
so how do i correct it?
debug your code
i dont know how to do it, that why i am here ahha
Debug.Log is a good way
Log the values of the things you're actually checking for, instead of just a word
Log more than just some static word. Log the values of the things you are checking in your if statements
that way you can see if those conditions are true
how log works?
It prints whatever you give it to the console window
Like this: Debug.Log(Isco.transform.GetChild(0) != null);
okay i am gonna try
Is it this window down here ?
it is not printing anything with that code
well there's a nother condition you need to check before that too - the Ocupado thing
Where did you put that log
yeah that means the outer if statement isn't true
this tells you a lot of information
So, it never reaches that line, meaning the first condition is not true
How do you know
if "the ocupado thing" is working then you'd see both of those logs in the console
ok so it is not woking either one of the condicions
Nope
so either the Ocupado variable is false, you have an error in the console you are not addressing, or this code isn't running. but if the first log appears in the console then it is one of the first two things
with this code, i want to swith Isco with the child of his. how can i do it ?
someone help plase?
can you explain what you're actually trying to make your game do
nothing about components or game objects
what do you mean by child? what are you trying to do? Isco is a type . . .
it is a fiching game, when the fish is in the bait and collied with the boat, i want it to desapeer
when the bait reach the fish, the fich becomes its child
so i only want to make the child desapeed
desapear
okay, so why are you destroying Isco?
destroy the child
Destroy(Isco.transform.GetChild(0).gameObject);
(you can't destroy a Transform)
ok that is what i need it
i want to swith Isco with the child of his.
this made me think you wanted to switch the two objects around in the hierarchy
making the bait the child of the fish or something
let me try the code you send
GetChild returns a Transform. you need to get the GameObject from the Transform and destroy that . . .
Technically transform is a component so you can destroy, but... Unity is weird
the code you send his working, but one more thing
after the fisch desapear i want to continue fishing the other fish and that is not working
you actually can't destroy a transform, it will yell at you if you try
really! not tried! But Destroy can take a component. That inconsistent!!
yes, but every GameObject has a Transform, so by law, it cannot be destroyed as one cannot exist without the other . . .
can someone help me with this?
I can throw chesse on my car as wheels, not gonna work either. 😄
it's not inconsistent. you can pass a transform to destroy, it just doesn't destroy it and will yell at you at runtime. i don't remember if it throws an exception or just a warning though
you just asked a few seconds ago. let people read and attempt to respond . . .
okay okay sorry dude i wait
also, you didn't explain what is not working. we don't know how you did it or what you tried . . .
!!!!
i said in that message
No you did not. Youdid not show any code besides the destroy one and therefore we do not know what you tried already. or if you did not write any code yet and asking here for code snippets
essentialy i think he's asking that he wants to repeat the destory object more then once
the only code i use to destroy the game object is this one
again, how is it not working? obviously you have code, but we do not have your code. you need to provide the code to show us what you did. then we can help provide answers for why it's not working . . .
exacly
i dont, i dont know how to reset that and the destroy
i only see code for attempting to destroy a child. i don't see anything about wanting to continue fishing or what that code looks like . . .
yh that what i need and dont know
I feel like the very basics are missing here. Either from your code or from your knowledge.
I propose you visiting unity learn platform and get the basic tutorials going to get a grasp of how everything works and is tied together
this is the last thing i need i am with a very short deadline, if you could just help, i would apreciate
Im not gonna write code for you, sorry. If you try and come back here with whatever you tested, people will help. But noones gonna write the code for you, but maybe someone is willing to.
correct
i did this with a timer, the format is giving me error, can help with this?
look real hard at what you are passing as the first parameter
using UnityEngine;
public class Healthbar : MonoBehaviour
{
[SerializeField] private Health playerHealth;
[SerializeField] private Image totalHealthbar;
[SerializeField] private Image currentHealthbar;
private void Start()
{
totalHealthbar.fillAmount = playerHealth.currentHealth / 10;
}
private void Update()
{
currentHealthbar.fillAmount = playerHealth.currentHealth / 10;
}
}```
Assets\Scripts\Health\Healthbar.cs(6,30): error CS0246: The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?)
Assets\Scripts\Health\Healthbar.cs(7,30): error CS0246: The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?)
So what is wrong with "Image". I don't get it, because I need Images there.
!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.
!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)
the error said that the Image type cannot be found. are you using the correct namespace for Image? it belongs to a different namespace than UnityEngine. you need to use the correct one . . .
You didn't even bother to ask a question
Btw you are multiplying with deltaTime twice
And speed too
It walks exactly as you set it up. What do you mean by strangely?
Can you please provide some information. We do not see your screen or anything... give some effort in describing
you are moving so slow because you have multiplied your speed down to probably near zero. what did you change after Osmal said you were using delta time a million times?
are we supposed to know what, "walks like in a movie," means?
and what is the value of speed ?
im confused on the comma
do you mean 7.58
well have you tried to increase your value in the inspector and see what happens ?
You should go look at some tutorials on simple 3d movement. There are a few things that stand out from your code. One being your values need to be normalized so it fixes diagonal movement speed, and two, You will likely run into issues using Translate and your physics/colliders.
Your new video shows you moving faster? So whats your problem now? Walking throuh walls ?
!learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
keep forgetting the shortcodes 😄
#854851968446365696 has some commands
the code is working, you're phasing through walls which is the problem of using Translation
in here, doing scenes connection, what do i put inside the parentheses
show your players Gizmos in local space mode
your are likely not rotating your player to your cameras forward transform
did you bother looking the function in the docs or the IDE ?
it literally tells you
your ide will tell you if you write ( after Async
when in doubt
https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.LoadSceneAsync.html
look at that it even has examples. Whattya know
in the scene, to make sure your forward facing is correct in the first place
I cant tell if you're in Global or local mode
show the whole screenshot , no crop
Local because the orientation gizmo in top right points in different direction 
oh yeah you're right
ok so the forward seems correct
its not in playmode, you should show your gizmo when you turned your camera view
Your player is not automatically just going to go forward in the direction your camera is facing when hitting W unless you rotate it to match the camera.
just realized you're not even doing transform.forward * vertInput
you're using world Z
first of all you have a rigidbody, dont use translate
I found a free site in my native language, whit exercises
Please take the advice of going to learn basic movement via unity learn or youtube
Translate uses Space.Self by default. But yeah should move the rigidbody instead
velocity or addforce, using the rigidbody component
ah does it? always thought it was world unless specified, for some reason
good to know. I barely use it 😅
I get it mixed up too
I don't think i have ever used Translate once.
rb.AddForce should be in FixedUpdate, you prob want to specificy a force mode
also if you dont lock rigidbody rotation on X/Z this will flip your player
no Inputs should never be in FixedUpdate
thats why i said rb.AddForce should be in FixedUpdate,
You generally get input from update and apply physics in fixed update. Also it may be better to modify the .velocity to move your character and if you want abrupt starting and stopping movement use GetAxisRaw
Now you should remove * Time.deltaTime because AddForce is already scaled with delta time
Make sure to adjust speed to a smaller number after that
yup thats why your Z barely moves
the Time.deltaTime on rigidbody
are you rotating the camera individually from the player ?
that does not answer my question the slightest
show your rotation code
any rotation you got sure
how many other things are you rotating 🤔
The player is not rotating. The camera rotation doesn't matter whatsoever.
unless you've attached this component to the camera, of course
so ur rotating both indivudually
Not sure if it was mentioned, but remove the deltaTime from your mouse input calcs
oof moment
This code doesn't care about how anything is rotated. It applies force in the X and Z directions.
The rotation of the player and the camera mean nothing.
it does if they're looking in the wrong direction while moving
Pressing W moves you right because that's the direction the world Z axis is pointing
You have MouseX = -90 which makes your camera rotation different anyway
you're moving in the direction of the blue cone, no matter what you do with your camera or player
Which explains the seemingly flipped X and Z movement
yeah, and the -90 is clearly there to make you start out looking down the hallway
since a -90 degree rotation on the Y axis rotates you to the left
You need to make it so that you move in the direction you are looking.
not just a fixed direction
Calculate a movement vector by using your forward and right directions.
Vector3 move = Vector3.zero;
move += transform.forward * Input.GetAxis("Vertical");
move += transform.right * Input.GetAxis("Horizontal");
move *= speed;
move *= Time.deltaTime;
This would be reasonable.
(yes, it's missing a clamp so that diagonal movement isn't faster)
well, you'd then need to use that vector
you can store it in a variable and use it in FixedUpdate
If you do that, get rid of the Time.deltaTime line
AddForce can be given a vector
No. You pass the vector INTO AddForce
Change it back, remove the x, 0, z and instead use the vector you made
which you store in a variable, just like you're currently storing x and z
if you don't know how to write C#, you should really stop what you're doing and use !learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
Dear lord almighty, go learn the basics first instead of blindly guessing
As a developer, you have to stop asking "like this?" and learn the basics, make informed code changes, test your changes, ask yourself, is this behavior correct?, if not, understand more , rinse and repeat that process. YOU need to be the problem solver!
you need to have a basic level of understanding
we can't write your entire game for you, nor can we help you write every single line of code
if you are asking "like this" and clearly have red underlines in the code, the answer is always "no"
No "buts", this is very simple.
do it first and fail then come back
Nothing, go and !learn
:teacher: Unity Learn ↗
Over 750 hours of free live and on-demand learning content for all levels of experience!
You have been told explicitly what to do.
You do not have the foundation needed in order to understand it though
us telling you the line to write there will nothing to your learning
actually, start with c# first and forgo unity for now
So you need to build that foundation
You don't try to drive without taking some lessons first
Pass the vector you made into AddForce 🤷♂️
you will spend hours on it because you don't understand the basics
No reason to answer your question if you won't understand it, just copy it, and later come back with more basic issues which wouldn't exist if you took your time to actually learn something
it wasn't even your walking. You copy/paste without understanding anything
fun fact, you can hover the method (AddForce) and it tells you what kind of parameter it takes in (but yeah u gotta watch some tutorial videos and learn the basics)
"whats a parameter ? "
the thing you put in the parentheses 😝
like this ? (parameter)
to be pedantic, the thing you pass to the function is an argument
the function has parameters
but i digress
listen here Fen, don't be using that tone with us... its not nice
you definately gotta be trolling now
you wasting more time doing it wrong than learning it once how to do it right..
this mentality makes no sense to me
you should go and look up a unity tutorial on youtube
where do you think he got this code from?
Don't do youtube
https://www.w3schools.com/cs/index.php
And then
https://learn.unity.com/pathways
theres tutorials with rb.AddForce(Vector3 force); ? 😄
so you see how a vector3 is passed in translate there? its not different than the one in AddForce
they both want V3 as direction.
put 2 and 2 together
this example is taking three arguments
player.Translate works in the local space of the transform by default, unlike AddForce, which is working in world space
i suppose you could just use AddForceRelative
oh the youtube tutorial is telling you to use Translate? sorry wasnt reading the conversation earlier. yeah that tutorial is bad, better use aethenosity's links instead
Either way, if this is your level of programming knowledge then even if you get past the youtube tutorials, you won't be able to make anything of your own (clearly seen here) and instead you'll just spend hours wasting your time (like right now). Just... spend a few god damn days and learn the basics from scratch. C#, then Unity. Most of your issues will be gone.
oh right, it's AddRelativeForce
anyone know why this isnt working, im tryna send a player id through my webhook and its just giving me a 400 bad request error:
private void SendWebhook()
{
string playerId = PlayerPrefs.GetString("PlayerID");
if (string.IsNullOrEmpty(playerId))
{
Debug.LogError("Player ID is missing or empty.");
return;
}
StartCoroutine(SendWebhookCoroutine(playerId));
}
private IEnumerator SendWebhookCoroutine(string playerId)
{
WWWForm form = new WWWForm();
form.AddField("Player ID", playerId);
UnityWebRequest request = UnityWebRequest.Post(WEBHOOK_URL, form);
yield return request.SendWebRequest();
if (request.result != UnityWebRequest.Result.Success)
{
Debug.LogError("Failed to send webhook: " + request.error);
}
else
{
Debug.Log("Webhook sent successfully.");
}
}```
perhaps your request is bad, then
although 404 is not a "bad request"
that means "not found"
404 is not found
i mean 400
form field Player ID is suspect
Failed to send webhook: HTTP/1.1 400 Bad Request
UnityEngine.Debug:LogError (object)
have you verified what your end point requires ?
and to my knowledge your key Player ID i don't believe should work
check if blocked first or just move using a character controller
I know this isnt exactly coding, but how do i move the blue circle on my sprite? Im using cinemachine to track my character sprite however the blue circle it tracks is way off and idk how to move it and i cant find anything online.
in the sprite editor
if its not coding why are you asking in a code channel
i couldnt find a better channel you goof
ty
That is not a good reason
what a DOLT
I'm confused by your original question, do you want to move to a spot if its not blocked ?
idk wat you mean by " can i make colliders work with offsetting the player "
cant you use a rigidbody for movement instead?
or character controller
you're going to have to not reply "huh" and "wdym" and actually inquire to clear up what your confusion is on
to have collisions, you gotta put a rigidbody component (and a collider) on your player and then instead of changing transform.position you do rigidbody.moveposition instead, for example
those two controller respect physics ^^ aka colliders
(btw MovePosition does NOT respect collisions)
you would need to move via velocity or using forces
doesnt it? im pretty sure it does
dejavu we had a debate about this with @rocky canyon yesertday lmao
#💻┃code-beginner message
it doesn't
I could've sworn MovePosition does not and indeed it didn't after they test 😛
negative
It will move you into a wall, at which point you'll get violently depenetrated
kinematic bodies are a whole different story - they don't respect collisions at all they are unstoppable forces
you will respect the collider -- but not in the gentle way (:
you'll respect it by going flying at 30 trillion miles per hour
nope
My own quote in which I am wrong lmao
indeed thats why he was like "I don't need further proof, PraetorBlue approved "
haha
wait now i am confused. whats the truth then 😂
so if you already have a rigidbody use that?
if you use character controller, you have to simulate gravity. but character controller has a few out of the box features that make it somewhat easier than rigidbody, but thats still debatable.
do I need to be making an input manager with the new input system unity? what is even the purpose of an input manager?
seperatation of concerns
you don't "need" it
MovePosition:
- If you're kinematic, you will naturally push other objects out of the way correctly (this is good, it was designed for this)
- But you will be allowed to move inside walls if you are dynamic, and you will get pushed out. Which is not the same as not being able to move into them in the first place
I am making a local multiplayer game, I have read that managers need to be a singleton. So is it even possible to be making manager?
yes but you're not applying offset to the Rigidbody component, you're doing it to the Transforms directly (which is the same as teleporting)
You should be using the Rigidbody for everything, not just the jumping
if you're kinematic then does rigidbody.moveposition stop when it encounters a wall before it reaches its destination? somebody told me that once
no, velocity or forces
no
it will go right through the wall
You can push other rb collider bodies, they cannot affect you the slightest
walls you will phase right through
but non kinematic means it stops correctly then?
no as PraetorBlue said, its only because the dynamic is trying to fix the intersecting of you basically teleproing into wall
so its pushing it out of the wall
I always assumed MovePosition mentiones its a method to move kinematic , i think its meant for that mainly
ok that is weird, i remember someone explaining that moveposition works with collisions because under the hood it actually checks collisions properly while moving it or something. its good to know that its not the case
maybe they got confused, because you can use Move Position to push other rigidbodies
so there is some calculations there for collisions, just not from you. Other rbs
they just know where the kinematic is I suppose
bruh.. why are you still setting position on the transform
we're going in circles
how you expect to fix it if you keep doing it wrong
we gave you already the advice how to do it
You aren't desperate enough to go learn the basics. Or to even understand why you are doing what you are doing.
desperation fuels excellence
Your inability consumes you
throwing random statements at the wall will not produce a working game
when i want something like .indexof and to use it in other function does it matter whether i pass int or a list to run indexof on
That def should have been "Throwing random words at a wall will not produce a sentence" lol
you can't do (3).IndexOf(...), for sure
i don't really understand your question
how would you even run index of an int?
MovePosition is garbo and you might as well just use character controller
How would you get indexof on an int
int.IndexOf like what?
if you want to use a method from a class, you'd better have an object of that type
its question about does it matter if i pass small int or huge array through function
This makes even less sense
since in array case i believe it could be copied as its kind of primitive
what is the end goal here?
arrays and lists are objects. they are passed by reference not value
arrays are not value types
why would you think that
so same performance ok
is there issue if you pass everyone the address to the same Building ?
int is 32 bite. A reference is 64 bits. Not quite the same but very little difference
yeah just in case of passing 1000 entries long list its always good to ask
When in doubt, you could always profile it and see
i dont believe profiler
you should know this stuff. it's very basic C#
1000 isn't much
Then you should probably stop not believing it
also with reference types all you're passing is the address to the same object..
it can have whatever quanitity it makes no difference to passing the list around
How can i approach Singletons in a local multiplayer game.
perhaps you want something that isn't actually a singleton
but rather something that has one instance per player
also by "local multiplayer" do you mean couch multiplayer/coop
Either one, whichever suits your game more. addForce may be trickier to use initially, because you'll need to handle actually slowing the player down. Directly setting velocity to what you want is easier but then you might end up ignoring collision forces
"setting velocity it obviously didnt work since its same as offsetting atp"
wdym by this
show what you wrote
setting velocity is definitely not the same as setting the trasnforms directly
Yea I didnt see the code if it was posted before so I have no clue what you mean
nah just this
#💻┃code-beginner message
never seen new code or changes they did
Oh
supposedly the rigidbody is already there for AddForce jump
since there will be more than a single instance of the player, so will the manager. I have read before that the manager has to be Singletons
what will the referencing of something like that look like
"The manager", which one? Also why does your player need to be a singleton in the first place
is this a couch coop?
or actual networking
Yeah couch multiplayer
so if its a singleton you only need 1 , why are you spawning "per-player"
I don't understand this part
since there will be more than a single instance of the player, so will the manager.
why does manager need to be "per-player"
what is "the manager"?
if it's a game-wide manager (e.g. something that controls the match timer), there is only one instance, no matter how many players you have
this is widly easier since you're only dealing with the same build running
if it's something player-specific, then it obviously can't be a singleton anymore
each player has its own instance
in that case, you'd either have each player reference their object, or have a singleton that you can ask for a player's object
for health, powerup, and so on. And updating the ui and so on
GameManager.Instance.Players[0]
but you only need 1
add players through a list, and just loop through each one
each player has health. health is a property of the player.
your manager can get info from multiple players at the same time
since they all have the same props anyway
oooh, okay.I think i get it now
I will try to prototype something out. Thank a lot ❤️❤️
You probably want to look into events here
put an event to when your stats changed and react to changes accordingly
each player has their own event when something happens (health changes etc..)
hey guys noob question how i make this sword stay stuck to his hand, when the character does a animation the sword just stays still doesnt move
is it rigged such that the sword doesnt move in any key points of the animation
also not really a codding question
where should i ask then
Hey guys! Need some help with my object pickup. I am in for 3 hrs on this and still can't get it to work. The reachtool I've created detects in console the objects ready for pickup , but nor the text appears (pickup) neither can pick the object
am i allowed to ask questions abt scripting for a unity 2d project here or am i missing a channel?
if it's code and not editor tool specific then this would be the place
awesome
As always - debug your code. Add log lines where you expect code to run and things to happen and verify that the reality matches your expectations.
i am like, extremely new to coding and especially C# (I only have minor javascript experience) so I've been trying to learn off YouTube tutorials. I just completed my first remake of Tetris, but I can't figure out how to properly script a game over. The tutorials i've followed have become a little useless since I mashed together a bunch of them to create my tetris. I'm assuming this is probably really simple and im just way over my head in terms of knowledge.
this is the script i use for behaviors on the tetris blocks themselves: https://hatebin.com/epsqtjubws
this is what i use to control spawning the pieces: https://hatebin.com/fjqknvijut
can anyone help me figure out a way to trigger a game over since my code is kinda all over the place.
well, check the topmost rows of your grid that there isn't a block occupying it there after being set every frame. If there is -> trigger gameover
thats how i figured i should do it but im honestly not sure how to actually do that in C# :(
like i know the absolute basics and thats it
what would be the indicies for the top most row
iterate over them every frame and check if there is something occupying them
or, when you set the blocks, check if it's one of those indicies. Either way works honestly
Well your grid height is 20, so you could build that check into the method CheckForLines
Probably because it's facing backwards
anything rigidbody movement related goes in FixedUpdate
Is there an way to do this?
transform is not a vector3.
oh
Bool IsGameOver()
{
Return HasLine(height);
}
square pegs can't go in round holes, no
Or height + 1
if its a public Transform just assign it in the inspector
But everything can go in the square hole
But i want to be able to set it like this (0,0,0)?
Transform contains position, rotaion and scale.
If you want the variable to be 0,0,0 then why is it a Transform
Show a screenshot of the player selected with the transform arrows visible, in both local and global modes
i thought i would need to build an entire other void to transition it to the game over scene
How would i go about getting the euler angle between two Vector3s?
angle
is angle the same as a euler angle
googling "unity vector angle between" gave me the correct result (:
ive tried googling obviously if im asking here
it'll always return the smallest angle though if that matters
If you want the rotation between two vectors, use Quaternion.FromToRotation
This gives you a rotation that, when applied to the first vector, gives you the second vector
(Vector3.Angle gives you a single angle, which is the angular distance between the two directions)
i want to rotate an arrow so it points from the first vector to the second vector
And within the isvalid check so at line 49 add this check
If (IsGameOver(height)) // scène manager call to game over
And do you have any code rotating the object at all?
are these two vectors positions?
yes
okay, so you want an arrow to have its tail at point A and its head at point B
2 points on the 2d plane
would i add that still within the CheckForLines void?
well the arrow would be at a screen border and pointing towards the To point
Your code does not account for any sort of rotation and will always move the object the exact same direction whenever the same buttons are pressed
like a waypoint arrow
and the first point is the center of the screen, or something like that?
Something like this, then.
right
You want Quaternion.LookRotation.
oh
It's a bit unintuitive in 2D
Instead of moving in world space, move in local space. You've explicitly told the code to move in world space which ignores the object's rotation
No leave the CheckForLines as it is. A method or function should only do one thing, in this case checkforlines.
var rotation = Quaternion.LookRotation(Vector3.forward, destination - source);
LookRotation's main use is to rotate a camera in 3D space
How would you create GUI from purely script?
The first argument is the "forward" direction, and the second argument is the "up" direction
In 2D, "forward" isn't really relevant: it points into the screen
Instantiate(myWholeUIAsAPrefab, Vector3.zero, Quaternion.identity)
okay I think I understood what you meant?
This rotation will make your transform.up point in the same direction as the destination - source vector
not instantiate a prefab
A whole lot of new GameObject and AddComponents
ohh i didnt know you could do new gamobject
you're going to need to be a little more specific here
If (IsGameOver()) // scene manfsr logic. So without the height. My bad
I create most of my main menu via script.
I have prefabs for things like:
- A settings category list
- A single setting
- A credit category
making like a slider for example, purely with script. So not like instantiating a prefab
