#💻┃code-beginner

1 messages · Page 36 of 1

uncut dune
#

seriously?

wintry quarry
#

yes

uncut dune
#

damn

wintry quarry
#

public fields are poor practice. Public functions and properties are ok

uncut dune
#

glad I use [SerializeField] mostly

wintry quarry
#

if float1 was a property though, the first example is ok

uncut dune
#

ok thank you so much

cosmic grove
#

yea i could try that, though idk how to control direction, but pretty sure i can search it up. thanks

hidden bone
#

How would one save text from an Input Field and load it on launch

rich adder
hidden bone
#

alright, how would i save it into a file?

rich adder
hidden bone
#

ok thanks, i'll look into it

rich adder
swift crag
#

pro tip: there are methods to read/write all text from/into a file

#

you don't have to open a stream and then do a 20 line song and dance, as I originally did

#

🫠

#
        var text = JsonConvert.SerializeObject(data);
        System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(Path));
        System.IO.File.WriteAllText(Path, text);
#

e.g.

rich adder
swift crag
#

you can skip line 2 if you're just writing into Application.persistentDataPath

#

no, that would be for a text asset you build into the game

hidden bone
#

How do i get the data from the input field?

rich adder
#

or .text

hidden bone
#

ok thanks

queen adder
#

how are the outline effects/shaders achieved

swift crag
#

One way is to push the mesh outwards a little and render its backfaces

#

Another is to do the outline as a post-processing effect

#

bless bgolus

queen adder
#

ty, I searched "unity outline shader" and didn't amount to anything other than errors ill check that out

swift crag
swift crag
twin bolt
polar acorn
#

I don't see an error

#

Is your IDE configured

twin bolt
polar acorn
#

Can't cast Transform to GameObject. I was honestly expecting that one to be a compile error, not a runtime

twin bolt
#

oh ok

calm coral
#

Hey I have a question, why Vector3.zero.normalized is not normalized? Thonk When I try to print that out it returns vector 0,0,0

wintry quarry
#

it's actually something that doens't make any sense at all

calm coral
wintry quarry
#

what direction is Vector3.zero pointing in?

polar acorn
#

Mathematically, it should cause your program to explode

calm coral
wintry quarry
#

It's basically like dividing by zero

wintry quarry
#

if this is something that comes up in your game, simply check that the vector isn't 0 before doing it

polar acorn
calm coral
calm coral
#

I need to find out if player is looking at the center of universe

#

I mean at point 0,0,0

wintry quarry
#

the dot product takes two direction vectors
Vector3.zero is not a direction

polar acorn
wintry quarry
#

looking at zero is not the same as having zero as the look vector

#

if I'm standing at 1, 0, 0 and looking at 0, 0, 0, my look direction is -1, 0, 0

#

If i'm standing at 0,0,0 and looking at 0,0,0, then I've just ripped a hole in the spacetime continuum

#

that's kinda like looking at your own head

calm coral
calm coral
#

I've just found this ||@wintry quarry@polar acorn||

acoustic arch
#

could someone help explain how i could have my players full sprite with all child gameobject sprites together as another image inside of the inventory?

#

i heard i should use Render Texture, with a Raw Image

#

but im confused how to do this

#

i have made a 2nd camera with a raw image and idk what to do yet

acoustic arch
#

i got it figured out

#

without google too 😏

swift crag
#

did you throw the render texture into the Raw Image component?

mellow jacinth
#

Basically i’m here to learn unity i’m not even beginner i’m too bad at programming.

#

Help me out

eternal falconBOT
#

:teacher: Unity Learn

Over 750 hours of free live and on-demand learning content for all levels of experience!

mellow jacinth
#

!learn

eternal falconBOT
#

:teacher: Unity Learn

Over 750 hours of free live and on-demand learning content for all levels of experience!

polar acorn
cyan wigeon
#

anyone knows what this refers to ?

#

as in where to find it

#

realised this is the place:

But it still dont work any ideas what I need to adjust config wise? I am using unity Localization package

wintry harbor
#

I'm getting this error for this script. Could someone explain what the error message means to me? I already added a Circle Collider 2D to the game object.

polar acorn
#

OnTriggerEnter2D does not take a Collider as a parameter

wintry harbor
polar acorn
wintry harbor
final trellis
#

anybody know a fix for this?

polar acorn
#

Pretty sure += and -= increment after use, so it's clamping, then adding. Put the += and -= on separate lines, then run the clamp afterwards

timber tide
#

Is Vector3Int serializable or am I crazy

sonic yoke
#

Im making a game about you being in the woods camping and you see a big nest and you have a gun. And you have to kill all the spiders that come out and you have to survive waves. And at the 10th wave you see a HUGE spider and you kill it. And if you beat it a cutsene will play where you take hair spray and a lighter and light it on fire and it blows up. Then it says to be continued and i need mods any body wanna help?

polar acorn
sonic yoke
#

yes i need help with invers kenimatics here in a bit

polar acorn
sonic yoke
#

can you help

polar acorn
sonic yoke
#

I asked if you can help me with it i've never done it before.

polar acorn
#

Do you have an actual question or are you just trying to get someone to commit to solving your problem before you've even said what it is

summer stump
# sonic yoke can you help

The server rules are that you should just state the specific issue you have and someone might help. No need to ask if someone can help

magic condor
#

I'm making a mod for Gorilla Tag, a VR game, and I have no idea what I'm doing. I have the mod template but I cant figure out how to code this. All the mod does is puts an object in a certain place.

sonic yoke
#

but ill go to the thing

eternal falconBOT
final trellis
#

"bub" bro thinks hes wolverine

sonic yoke
#

Bruh, best come back of the year.

summer stump
sonic yoke
#

oooohhhhhh

sonic yoke
polar acorn
#

It's in the bot message

sonic yoke
#

not twice once

sonic yoke
#

ooooohhhhh srry bout dat ill use the thing you sent me

final trellis
#

it works completely fine when seeking left and right in the middle of the audioclip tho

#

jsut has trouble with the ends

polar acorn
#

Add first. Then clamp

final trellis
#

seeking left out of bounds does actually reset it to 0 but still produces that wonderful red error saying its out of bounds, seeking right out of bounds just produces the red error, but twice

polar acorn
final trellis
#

ok so looks like it works now ( istg i wrote the code exactly like that ) but only for going below the bounds, going beyond the bounds still produces an error ( only 1 this time! )

polar acorn
#

You probably want to subtract a small amount from it

#

inside the clamp, try clip.Length - 0.001f or something similar

final trellis
polar acorn
final trellis
#

holy hell

#

what the hell

#

why is 27.2185 - 5 = 0

#

i love math, especially when it makes sense

#

so yeah no big scary red errors but now this is happening

polar acorn
final trellis
#

should I post all of it too?

polar acorn
#

At least the two Seek functions

final trellis
#

for context of what im doing, its basically a mini audioplayer

opal fossil
#

can I use CharacterController in some objjects, and rigid body in other objects if its convenient for the gameobject in the same game?

final trellis
#

hitting the end of the clip seems to freeze up the playback entirely, no seeking back or forward, just doesnt do anything, but the values being recorded are max value of clip - 5 = 0 and max value of clip + 5 = 5

polar acorn
polar acorn
opal fossil
#

nicee

polar acorn
#

and also if you don't expect any of the rigidbodies to move around the character controller

#

it's just gonna shrug off any forces that hit it

final trellis
#

seems to reset to 0???

#

which i kinda get but ???

#

wait i got the worlds worst idea

#

oh ok i think i found the issue

#

unity's handling of looping audio clips is just weird

#

i had to toggle on looping for the audiosource and it works but yeah it loops now, easy fix tho.

#

thank you unity very cool

#

thank u btw i was completely bewildered and there wasn too much info online i could find lol

devout minnow
#

Hi im relatively new to unity and i was just curious on i could replace my transform movement with physics movement? Can anyone help me?

silk night
queen adder
#

can the PropertyDrawer of list be manipulated? I dont wanna see the Element x thingie in here

silk night
queen adder
#

what a hack, nice !

sharp bloom
#

I dont know what the hell this is but it looks cool...trying to make circular shaped pattern for enemy attacks

zinc hill
#

is applying gradient noise to shader expensive??

broken hazel
#

I'm getting a CS8803 Error with this area

#

I would like help finding out what to do with this and for clarification it for terrain generation

teal viper
#

Also, why a photo?

summer stump
#

But I can't tell from your screenshot, do you have an opening curly brace for the class?

public class TerrainGenerator : MonoBehaviour
{ <- this
}
#

It looks like it is missing

static cedar
#

Seems like it. UnityChanThink

summer stump
#

@broken hazel Oh dang. Just realized you can see the super pixellated and blury error message at the bottom! Nice.
I'm gonna say it's the missing curly brace, since it is complaining about top-level statements

static cedar
#

Also next time. Windows + Shift + S.

broken hazel
teal viper
#

Or even just sharing the code properly
!code

eternal falconBOT
broken hazel
summer stump
#

Or hell, copy the code, email it to yourself, send it via your phone
Millions of ways to do it lol

teal viper
#

Get yourself an ide. If your computer can handle unity, surely it can handle VS or VS code too.

raven trench
#

if i make a variable can it be called in any script or just the script its made in

swift crag
#

If the field is public, then any class can see it

#

If it's protected, any child classes can see it

#

If a field is not static, you must have a specific instance of the object to access it

#

If the field is called foo, then, within the same class, you can write this.foo (or just foo) to access the field

#

that will give you your own instance's copy of foo

#

If you have an instance of the class stored in a variable named bar, you can access the field with bar.foo

#

(assuming that the field's visibility lets you see it)

calm coral
#

Hey, how often is OnGUI() method called? If I google it's allegedly called a few times more than Update() but no info how many times exactly

swift crag
#

I know that it gets at least two calls.

north kiln
#
  1. There is no exact number
  2. Why are you using OnGUI
swift crag
#

i use OnGUI pretty frequenetly to make debug interfaces

drifting horizon
#

hey how do i make a simple system to check when an object is touching the ground?

swift crag
#

you should not do anything in OnGUI that changes state if it doesn't involve calling a GUI method. So Time.timeScale = GUILayout.HorizontalSlider(Time.timeScale, 0.25f, 2f); is fine, but player.health += 1; would be a bad idea

swift crag
#

but two good options are:

#
  • shoot a raycast from the player's center towards the ground and see if it hits anything
  • use Physics.CheckSphere to test if any ground colliders are near the bottom of the player
#

(or, in 2D, use Physics2D.OverlapCircle / Physics2D.OverlapBox)

drifting horizon
#

okay ill look into that thanks

calm coral
swift crag
#

it should not matter to you

calm coral
swift crag
#

you should not be doing anything in OnGUI that depends on the exact number of times it's called

north kiln
#

Yes, but why are you using GUI.Label? Are you making a debug GUI or are you making a full UI for a game? Because it's only use these days should be the former

swift crag
#

I only discovered that it gets called multiple times while doing some logging. I never noticed for quite a while

north kiln
#

even modders should be using UI Toolkit 😛

swift crag
drifting horizon
swift crag
#

CheckBox checks a rectangle

drifting horizon
#

oh it takes a vector2

swift crag
#

whether using 2D or 3D

drifting horizon
#

for some reason i read that as a float

swift crag
#

it can be any combination of side lengths

drifting horizon
#

yea got it

calm coral
north kiln
#

Sure 👍 that's a fine usecase

broken hazel
#

hi im back

#

so in row 54 there is something wrong and in the one that is similar. Can you help me? i can give the error code if that helps

north kiln
#

You are required to use an !ide to get help here

eternal falconBOT
teal viper
cerulean stirrup
broken hazel
#

float xCoord = (float)x / width * scale = offsetX;
float yCoord = (float)y / height * scale + offsetY;

cerulean stirrup
#
float xCoord = (float)x / width * scale = <-- here offsetX;
    float yCoord = (float)y / height * scale + offsetY;```
north kiln
#

@cerulean stirrup #854851968446365696 also says not to give answers to people without configured IDEs

drifting horizon
# eternal falcon

im using vscode and its not autofilling. i have the unity extension, and it was working a bit ago-- idk what changed

swift crag
#

Did you follow every single step?

broken hazel
#

i fixeded it

swift crag
#

Top to bottom. No creative interpretation, no skipping steps, no substitutions, no "it's probably good already".

broken hazel
#

ty again lovely people

drifting horizon
swift crag
#

From the beginning. You do not need to uninstall anything, but you do need to ensure that every single step has been accounted for.

summer stump
swift crag
ashen ferry
#

row 54 shows pic of notepad kekW

broken hazel
#

alr ill force my store to work

swift crag
#

just use VSCode. it'll work fine

drifting horizon
swift crag
#

was it the Visual Studio Editor package?

#

obnoxiously, that thing is locked by the "Engineering" feature by default

drifting horizon
swift crag
#

indeed. this changed a few months ago

#

the Visual Studio Code Editor package has been deprecated for a long time, but now it's completely obsolete

drifting horizon
#

any idea why this isnt triggering? i gave the floor the "floor" tag, and boxcollider2d

young warren
drifting horizon
#

whats that

north kiln
#

and also use CompareTag instead of comparing tags using equality.

drifting horizon
#

hmm, the physics debugger doesnt seem to detect the invisible box

polar acorn
#

What do you mean? Did you draw the box and it's not showing up?

drifting horizon
#

oh do i have to manually draw the box in the code?

polar acorn
#

Either the code isn't running or the box is nowhere near where you expect

slender nymph
drifting horizon
queen adder
#

does anyone know how to fix this error “Setting the parent of a transform which resides in a Prefab instance is not possible {GameObject: ‘PhotonVRVoice’).”

slender nymph
#

yes, don't call SetParent on a prefab

queen adder
#

How do i do that😭

static cedar
slender nymph
#

well look at where you are setting an object's parent and make sure that you aren't doing that to a prefab

queen adder
#

Mk

north kiln
#

Usually it's because you're instancing something and not then modifying the instance

queen adder
#

Im so confused😭

north kiln
#

If your code is throwing that error, send the code

queen adder
#

Wdym

north kiln
#

What are you having trouble understanding? Don't cross-post as well.

queen adder
#

No body answered in gen chat srry

teal viper
#

You need to wait at least a few minutes to get an answer.
Following the "asking questions" guidelines in #854851968446365696 can help get help faster too.(or at all)

queen adder
#

Im abt to just quit on this game😭 ive had to restart over and over for almost a year now bc it breaks every time

drifting horizon
teal viper
#

How is it that you can't fix(or at least understand) that error after working on it for an year..?

drifting horizon
#

i cant find any way to fix this issue (not even sure how to draw a box)

queen adder
#

Im stupid in the head

teal viper
#

More likely that you didn't learn the basics properly or trying to work on something you're not ready for yet.

teal viper
queen adder
#

Its a gtag fan game that ive seen 8 year olds do better than me at😭

#

That shrug was uncalled for

drifting horizon
#

oh damn it does detect something

#

so its a tag issue

teal viper
drifting horizon
#

oh wait i think its detecting the player first...

#

that would make sense

summer stump
queen adder
#

Nah its smth with the photon voice

drifting horizon
queen adder
#

My error is smth with the photon voice

teal viper
#

Your error was explained to you several times by now.

slender nymph
queen adder
#

Im too dumb to understand

slender nymph
#

there are beginner courses pinned in this channel and on the unity !learn site
start with those

eternal falconBOT
#

:teacher: Unity Learn

Over 750 hours of free live and on-demand learning content for all levels of experience!

queen adder
#

!learn site

eternal falconBOT
#

:teacher: Unity Learn

Over 750 hours of free live and on-demand learning content for all levels of experience!

teal viper
summer stump
# queen adder Im too dumb to understand

First of all, stop that.
Second, they asked for the code so they could help 🤷‍♂️

But yeah, this may be too much to start with? Unity's learn page would help

queen adder
teal viper
#

Then you miss even more basic knowledge that is required to understand whatever you didn't understand.

slender nymph
teal viper
#

Proper learning involves learning everything from the bottom up.

queen adder
#

I tried

#

It doesnt always work out for everyone asshole

teal viper
#

If you encounter something difficult during your learning, it's ok to ask the community. We might be able to explain or direct you to proper learning materials.

slender nymph
# queen adder It doesnt always work out for everyone asshole

this is definitely not the tone you should be taking with people trying to help you. if all you are interested in is throwing yourself a pity party because you don't understand and you refuse to go through the beginner courses so that you can understand, then why are you even here? go throw your pity party somewhere else where someone may actually care

queen adder
drifting horizon
#

any decent way to prevent objects falling at high speeds from passing through the floor?

slender nymph
rich adder
drifting horizon
#

where do you do that

teal viper
slender nymph
summer stump
mossy arrow
mossy arrow
slender nymph
#

the troubleshooting steps you need to take

mossy arrow
ivory bobcat
#

Also, make sure to save.

mossy arrow
slender nymph
slender nymph
#

yes. so read it

mossy arrow
#

then what did i do

slender nymph
#

well you're obviously working in 2d so clearly you need to click the "I am working in 2D" option

ivory bobcat
mossy arrow
#

2d

ivory bobcat
#

Don't try to skip out on reading - fast reading isn't applicable.

slender nymph
#

also have you put a log or breakpoint inside of your OnCollisionEnter2D to check whether it is actually being called?

mossy arrow
#

i was reading this "Comparing tags using equality; use CompareTag to get proper warnings.
Destroying components instead of their gameObject, leading to the appearance that nothing happens.
Ignoring errors that throw exceptions, these cause the code after to not run (fix the exceptions to resolve the issue)."

slender nymph
#

read the entire fucking page

ivory bobcat
#

So pick the appropriate one

mossy arrow
mossy arrow
ivory bobcat
#

You aren't receiving physics messages because likely your setup is incorrect. Follow the guide to ensure everything is correctly setup.

mossy arrow
#

i did what he did but i might have to look more

#

im go i have to do sum rq

mossy arrow
calm coral
#

Hey, how can I create multiple lines? I can't add multiple LineRenderer components to the same game object, is there a way to split that line into a few parallel lines?

timber tide
#

make multiple gameobjects as siblings?

calm coral
timber tide
#

better to keep multiple of the same components on multiple different GOs anyway

charred anvil
#

I can’t fall asleep

#

!bugs

eternal falconBOT
#

🪲 To make bug reporting as quickly as possible, we made a bug reporting application for you. When running Unity choose Help->Report a Bug in the menu, or you can access it directly through the executable in the directory where Unity is installed. It will also launch automatically if you experience a crash.

📝 If your bug report is to do with Documentation, either an error, typo, or omission, you can report it by scrolling to the bottom of the page where you found the issue and click ‘Report a problem on this page’!

💡If your report is to do with a new feature idea, you can check the Unity Product Roadmaps page to see if your idea has already been planned.

For more complete instructions on how to report bugs, access: https://unity3d.com/unity/qa/bug-reporting

somber wren
slender nymph
#

if you do not plan to rotate the object using physics then constrain the rotation on the rigidbody

somber wren
#

ok yeah it works ty

slender nymph
#

also there are a few weird choices in that code. why are you rounding your input (which should just be -1,0,1 with digital input) then also clamping it to that range?

somber wren
#

i guess bc with a controller its not always -1, 0, 1 ?

#

no ?

#

yeah the clamp should be useless tho

slender nymph
#

correct it is not, however if you want to support being able to move slower with a controller when not maxing out the joystick axes then you shouldn't be rounding it

somber wren
#

yeah true, i'll remove it. I won't lie i took this piece of code online because i just needed a controller quickly, but now looking at it you're right

#

Now is still my biggest problem, i don't know how to change my transform.up with my cross vector of the legs without conflicting with the forward vector

queen adder
#

We really need a counter of peeps who go profane against boxf UnityChanLoom

slender nymph
somber wren
# slender nymph i don't know what you mean by this so you'll probably need to provide more detai...
#

this it not my post, but same problem

#

im looking at it right now

queen adder
#

just add the vectors? nvm the problem was so deep to readback

slender nymph
somber wren
#

i dont know how to do, maybe im missing something

#

funny it is that most ppl are good in 2D and doesnt work in 3D, this is my first project for uni and they throwing us in procedural animation in 3D with unity 👍

slender nymph
#

multiply the transform.forward by the result of Quaternion.AngleAxis(your angle to change, Vector3 representing the axis it should rotate around which is probably just transform.up)

somber wren
#

but i cant multiply and vector and a quaternion

slender nymph
#

yes you can, the quaternion just has to be on the left side of the multiplication operator

somber wren
#

oh yeah

#

internet was telling me to do some intermediate calculus i was like "really ?"

#

thank you xD lemme try

#

ok its working for my controller, but when i put back the modifications of my transform.up it doesnt work and it doesnt move CRY

#

Here are my transformations of the transform up

candid oyster
#

how to select a random number from 0 to 3?

candid oyster
#

thanks

light moss
#

Can someone please help? For some reason my enemy only shoots to the right and does not shoot depending which side it is facing

slender nymph
#

it's most likely due to code on your actual bullet

#

btw that shootcooldown coroutine doesn't actually do anything

light moss
#

the actual bullet just has velocity

slender nymph
#

yes, and that velocity is sending it to the right

sullen rock
#

okay... I have a very specific question about execution order
line 33 in a script A instantiates a gameobject that has a script B on it
line 34 changes a value in script B
does this change execute before or after OnEnable in script B

slender nymph
#

after

sullen rock
#

fuck

#

thanks

slender nymph
#

Awake and OnEnable are called before Instantiate even returns

sullen rock
#

well, time for a workaround

slender nymph
#

what exactly are you trying to accomplish?

sullen rock
slender nymph
#

no, start is called later in the frame or even the next frame

sullen rock
#

so yes, the change of value from script A does execute before start in script B

slender nymph
#

wait, yeah i misread the question, but the info i provided is correct.

sullen rock
#

and the use - Im generating random environment blocks as the player is moving and starting it "low" and moving the enviro parts up as the player gets closer to emulate the feeling of looking into the distance

and the issue is, when I instantiate the "starting" blocks when you first load an app, they start low as well

#

using start instead of awake/on enable solves the issue

light moss
#

This is my Bullet Velocity. how can I have the bullet shoot to the left or right depending where the enemy is facing

slender nymph
#

either rotate the bullet so it faces the correct direction when you instantiate it, or you need to pass the desired direction to the instantiated bullet so you can apply that direction when you assign the velocity instead of just using transform.right

light moss
#

This code makes my bullet freeze for some reason

slender nymph
#

don't make it an int, just use a float. the cast is probably screwing it up somehow

light moss
#

it still freezes

slender nymph
#

print the values of your variables

light moss
#

It says "NullReferenceException: Object reference not set to an instance of an object BulletVelocity.Start () (at Assets/Scripts/Player Scripts/BulletVelocity.cs:18)" However I have Rigid Body Component for the Game Object already

gaunt ice
#

line 18 is transform.parent

slender nymph
#

you are not assigning a parent in your Instantiate call

light moss
#

so what do I change it too?

gaunt ice
#

the bullets hava no parent, do them needs parent? or can be gameobject directly under the scene?

slender nymph
# light moss so what do I change it too?

either assign a parent in the Instantiate call by literally just adding transform as the fourth parameter or use some other way to determine the direction. such as passing the direction to the bullet when you spawn it

flint pilot
#

hello everyone I am fairly new to this world, I have this problem that I can't solve, it gives me the error : NullReferenceException: Object reference not set to an instance of an object
Tire.<Update>g__NewMethod|6_0 () (at Assets/Scripts/Tire.cs:29)
Tire.Update () (at Assets/Scripts/Tire.cs:25)

wintry quarry
#

Either script1 or script1.bulloni is null

flint pilot
#

if you want i can show you the other script

wintry quarry
#

Not really necessary

flint pilot
#

so what i can do

wintry quarry
#

Figure out which of those things is null and fix it

gaunt ice
#

the script is public, you dont need get component to assign it

flint pilot
#

what do you mean, sorry for these questions but really I'm going crazy

gaunt ice
#

just drag and drop it in the inspector

wintry quarry
#

To figure out which thing is null

somber wren
#

How can i make my raycast hit take the first hit only ? like i have a platform under the ground, the hit will take that coordonates and not the ground itself

#

Like on this scene, the raycast will not care about the little platform on top of the ground

flint pilot
# gaunt ice just drag and drop it in the inspector

I'll explain what I need this script for, I need to remove 5 bolts via VR to a wheel and after I remove these bolts I reactivate the rigidbody and the interactable grab, doing as you said of course it happens that as soon as I remove one of them already it reactivates the wheel

somber wren
#

and it makes this

teal viper
azure zenith
#

Help

#

My AudioClip will not play

#

Why?

#

audioclip.play();

#

?

teal viper
#

I don't think you can play an audio clip like that.

#

There is probably no such method.

#

And you're probably getting errors.

azure zenith
#

What can I do then?

somber wren
teal viper
somber wren
#

when i debug the hit, it detects both objects (ground and cube/sphere), but doesnt take count of others that the ground

teal viper
#

Are you using RaycastAll? Why?

somber wren
#

No just Raycast

teal viper
#

Just raycast only hits one object. The first one it encounters.

somber wren
#

hmm i see

#

thats why spherecast were better !!

#

but spherecasts makes my bug through ground sometimes

teal viper
#

Draw debug rays. It's not quite clear where the origin of the rays is and what direction they have.

somber wren
#

the origin is the tip of my legs

#

the end

#

and direction is -transform.up

#

i was using sphere cast, but it makes me bug

teal viper
somber wren
#

yeah...

#

so its just a raycast probleme now, its better i like it

teal viper
#

What I'd do, is raycast from the joint down towards the tip, instead from the tip of the leg.

verbal dome
#

Like if the initial position of the sphere already overlaps something, it wont detect it

#

Solvable with OverlapSphere or CheckSphere, at least.

#

Video looks like theres more issues tho

azure zenith
#

Help

teal viper
azure zenith
gaunt ice
#

"AudioSource".PlayXXXXX

azure zenith
#

I have an audioclip

candid oyster
#

Hi, I want to make it so that a prefab instantiates at the spot of a gameobject

#

its nearly working but I need to convert the gameobject into a vector somehow

frosty hound
#

You can't convert a GameObject into a Vector. However you can use the GameObject's transform.position

candid oyster
#

thanks

azure zenith
#

You need an audio source for an audio clip

#

Unity is a pain in the ass

#

And this channel is dead

cerulean stirrup
#

AudioSource is a component you can add to a gameobject

#

add it there and you can assign a AudioClip and modify audio settings

azure zenith
#

Exactly what I have done and yet it does not work

cerulean stirrup
#

did you reference it

gaunt ice
#

the warning tells you that the audioclip is null

#

the variable references nothing

cerulean stirrup
#

probably that the AudioSource has no AudioClip attached

azure zenith
#

In my inspector, the audio source has the audio clip

gaunt ice
#

but playoneshot takes audioclip as on of its argument, so what you pass into it

azure zenith
#

My clip

#

My audio clip

#

That should be correct

gaunt ice
#

have you check if it is null before you pass into palyoneshot?

cerulean stirrup
frosty hound
#

Instead of playing 20 questions, just show your code. It's a waste of time to claim you've done it all right.

azure zenith
#

I think I fixed it

teal viper
sour fulcrum
#

Whats the vibe on the performance of something like a Physics.OverlapBox?

blissful trail
cosmic grove
#

guys why

 public void SetCameraX(float xAxis){
Cam.transform.rotation = Quaternion.Euler(Cam.transform.rotation.x , Cam.transform.rotation.y ,Cam.transform.rotation.z) ;}



setting the rotation to 0,0,0?, shouldnt it be the same as it was before

dont mind the random argument

teal viper
teal viper
sour fulcrum
#

idk just wanted a like "its probably not going to be a problem before almost anything else" to a "it's like using getcomponent a ton" type scale haha. i get its a vague question

teal viper
cosmic grove
teal viper
cosmic grove
#

like degrees and rad?

#

also i fixed it

teal viper
#

Degrees and radians are basically the same. It's like meters and kilometers.

#

Quaternions and Euler angles are different.

cosmic grove
cosmic grove
#

thanks

azure zenith
#

Okay, my sound is still not playing but there are no warnings this time

buoyant knot
#

degrees and radians just differ by a factor

buoyant knot
#

they are effectively the same, except mixing them up will make your calculations totally wrong

azure zenith
#

The sound does not play though

north kiln
#

Go through these steps to see if your issue is one of them.

azure zenith
#

It is not muted and volume is 1

#

Btw, my game audio works so footsteps can be heard

#

It just does not play sound when you collect the item

teal viper
#

How many times ere you asked to show code or info on your setup? Or read the #854851968446365696 on asking questions?

azure zenith
#

I just want possible advice

#

I don't want to share my code

#

I made an audio source and dragged and dropped my sound

silk night
north kiln
arctic maple
#

@wintry quarry hey, we managed to fix the issue yesterday and just thought i'd let you know what caused it.

the problem was that our entire game was organized into empty header objects that were tagged EditorOnly. stuff like ----UI---- etc. this was for organisations sake and ended up being fine in editor. originally, objects weren't supposed to be children of these categories so the empties were marked as editorOnly to make that clearer. they were just supposed to be inbetween everything in the hierachy. later someone forgot this and made them all have children at some point. no error about this either, since it technically wasn't an error.

such a silly mistake lol.

subtle veldt
#

Hellooo !
Quick question : I have this GameObject wich is where the player will shoot from and it's rotating to look at the mouse position, but I want it to rotate around the player. I want it's pivot point to be in the center of the player. How can I do that ?

barren vapor
slender sinew
#

(I am assuming you mean you already have the rotation code working)

#

as in, the object is rotating properly but just not in the right position

subtle veldt
barren vapor
subtle veldt
#

There is no sprite that's why I was asking, it only tracks where the player will shoot from.

barren vapor
wintry quarry
subtle veldt
#

Yeah I thought that would work but it's using another game object whereas there are ways to do it with code only like Nephren told me

dusk dust
#

hey guys, I'm building an Android game, and I have Images that I call and display in runtime,how and when is the best place to store it so I can access it after I build?

wintry quarry
#

what kind of access pattern are you requiring

buoyant knot
#

if I use kinematicRigidBody.MovePosition(pos), is there any way to read that RB’s current targetting moveposition? Or do I just need to log it somewhere, and reset the log every frame?

wintry quarry
#

Seems like you already have it in the pos variable

#

The Rigidbody doesn't expose it anywhere, no

buoyant knot
#

that’s what I was getting at. ty

dusk dust
wintry quarry
#

why do they need to be image names?

dusk dust
wintry quarry
silk night
wintry quarry
#

Again what's wrong with the direct references?

#

what kind of access pattern are you requiring
^ this is the question you really haven't answered

dusk dust
static cedar
#

Ngl, the more i check around here, the more i see even though these problems are easy to solve, most of the difficulty comes from how ur gonna explain it. UnityChanThink
Props to u guys ig. UnityChanPanicWork

calm coral
#

Hey, is there a way to write a binary number as a float not Int32 ?

wintry quarry
buoyant knot
wintry quarry
calm coral
static cedar
#

And i don't know why you want to write a float input in binary either.

buoyant knot
#

if you just want to set a constant 6f, just write 6f

#

you probably want to define a constant for that or something tho

calm coral
wintry quarry
#

what's wrong with 1/4f or 0.25f?

dusk dust
buoyant knot
#

like
private const float DEFAULT_LINE_WIDTH_MULTIPLIER = 6f;

wintry quarry
#

as I mentioned in my first response

calm coral
wintry quarry
buoyant knot
#

computers don’t use irrational numbers

silk night
buoyant knot
#

you are trying to solve a problem that does not exist

slender sinew
wintry quarry
# calm coral Alright...

since the binary representation of 0.3f is infinitely repeating why on earth would you want to represent it in binary?

static cedar
#

Definition of irrational number is that it can't be expressed in fractions right? UnityChanThink

calm coral
wintry quarry
buoyant knot
#

you can’t

wintry quarry
#

changing the way you write the number doesn't help you at all in that regard

#

a float is a float

lapis stirrup
#

public class SceneManager : MonoBehaviour
{
public void LoadScene(string sceneName)
{
SceneManager.LoadScene(sceneName);
}
}

what's wrong?

eternal falconBOT
wintry quarry
queen adder
#

At what point should I stop in this video so I know I have learned enough CSharp for Unity https://youtu.be/M5ugY7fWydE?si=9J4CeU9Wfn71IOaw

Ask me Anything Anytime on Twitter: https://x.com/NewThinkTank

In this C# Full Course I provide the most complete tutorial on C# all in one huge 9 Hour course! I cover not only the core C# language, but also provide numerous examples on how to use them to make real applications. At the end of the course we make a database management system from...

▶ Play video
wintry quarry
static cedar
#

Different video to what i watched.

dusk dust
queen adder
buoyant knot
#

i feel like I can’t describe more about the precision thing without horrendously confusing the man

queen adder
silk night
wintry quarry
slender sinew
#

and thats assuming you are actively trying to learn basically the whole time lol

wintry quarry
dusk dust
slender sinew
#

you should describe what you ar trying to make

dusk dust
static cedar
slender sinew
teal viper
slender sinew
#

anyways, you can still use the inspector to reference the images... even if you assign them to each level at runtime

queen adder
neon fractal
queen adder
#

My biggest problem with these vids though I have a bad attention span so idk how anyone watches these head on

static cedar
static cedar
teal viper
neon fractal
teal viper
# neon fractal

Okay. Why did you remove that from the code that you shared? And what does is it output to the console when you test?

static cedar
#

@queen adder This is the one that i watched. UnityChanThink
https://www.youtube.com/watch?v=wxznTygnRfQ

C# tutorial beginners full course (C# for Unity)
#C# #tutorial #Unity
⭐️Time Stamps⭐️
#1 (00:00:00) C# tutorial for beginners
#2 (00:06:30) output 💬
#3 (00:10:48) variables ✖️
#4 (00:19:32) constants π
#5 (00:20:35) type casting 💱
#6 (00:27:49) user input ⌨️
#7 (00:31:24) arithmetic operators 🧮
#8 (00:35:54) Math class 📏
#9 (0...

▶ Play video
neon fractal
polar acorn
teal viper
# neon fractal

comment out Destroy and change the log to: Debug.Log(cell.name, cell.gameObject);.
Then when the message is printed in the console, click it and look at what object is highlighted.

neon fractal
teal viper
dusk dust
# slender sinew you should describe what you ar trying to make

I'm trying to make a game that generates blocks that fall and inside them is an image, and you have to choose the right answer for each block, It's like a teaching game, to teach you English.
so it will be an image falling and you choose the responding word for it, so the block should be generated on runtime, my problem is I want an optimal solution to reference the images, and put it in the block

neon fractal
polar acorn
polar acorn
teal viper
teal viper
#

If you log something in that new object's awake or OnEnable, you might see what spawns it in the stack trace.

ruby python
#

!code

eternal falconBOT
ruby python
#

Okay, so what in the holy hell am I doing wrong here? The camera just isn't moving to where it supposed to be (stays static in the scene). My Target is an Empty just in front of my object. It looks at it fine, but the position of the camera isn't changing at all.

public Transform target;

    public float smoothSpeed = 0.125f;
    public Vector3 offset;

    void FixedUpdate()
    {
        Vector3 desiredPosition = target.position + offset;
        Vector3 smoothedPosition = Vector3.Lerp(transform.position, desiredPosition, smoothSpeed);
        transform.position = smoothedPosition;

        transform.LookAt(target);
    }
wintry quarry
ruby python
#

The Camera.

slender sinew
#

you sure smoothSpeed is properly set in the inspector.. ?

wintry quarry
polar acorn
slender sinew
#

public variables with an initial value in code is a common problem here, it will just use whatever was serialized in the inspector

pastel talon
#

Hello! I have a function that activates an animation when I click on an object. The problem is I can't re-activate it because it stays activated even after the animation has finished. How do I re-activate it?

ruby python
#

I've tried adjusting the smoothtime to lower and higher values, the camera just doesn't move to the rear of the ship when it rotates (it's like it's using world coords.

polar acorn
# pastel talon Hello! I have a function that activates an animation when I click on an object. ...
  1. Instead of using GameObject just drag in the Animator directly
  2. Instead of toggling an animator component on or off, you should set a parameter on it to transition between states.
    https://learn.unity.com/tutorial/animator-controllers
Unity Learn

An Animator Controller is a Unity asset that controls the logic of an animated GameObject. Within the Animator Controller there are States and Sub-State Machines that are linked together via Transitions. States are the representation of animation clips in the Animator. Transitions direct the flow of an animation from one State to another. In thi...

slender sinew
#

well.. it is

slender sinew
#

using world coords

polar acorn
#

You have nothing in your code that uses local

slender sinew
#

localPosition is the position of the transform relative to its parent, position is the world position

polar acorn
#

You're moving to the position that is 30 units behind the object in world space

slender sinew
#

that's not the problem here though, because everything in the script is using world coords, which should be fine I would imagine

polar acorn
#

If you want this thing to stay a fixed distance behind the object as it rotates, you should probably just use Cinemachine that does all that for you

slender sinew
ruby python
#

I tried changing it to localPosition, and the camera went batshit nuts and caused unity to error out because it went out of bounds or something.

#

thing is, this is the code for pretty much ever single camera follow script I've seen.

polar acorn
polar acorn
ruby python
#

Yeah, but even this isn't following. lol.

slender sinew
polar acorn
slender sinew
#

if you wanted to switch to local position

#

all .position would have to become .localPosition

pastel talon
ruby python
#

@slender sinew Nope, that causes Unity to completely wig out.

slender sinew
ruby python
#

gimme a sec

polar acorn
#

It being on a different object changes nothing

pastel talon
#

I believe I tried that before but I guess I did something wrong then

viral hemlock
#

Is piskel a good pixel art creation tool ?

wintry quarry
#

It's ok

viral hemlock
#

Sorry if this is of topic

ruby python
#

sokay, think I got it figured. Thanks for the input fellas.

gusty hazel
#

why doesnt the if statement work in this code

polar acorn
eternal falconBOT
polar acorn
#

And the if statement does work. If the code inside it doesn't run, then other doesn't have the tag "walkFinish"

neon veldt
#

How do I rotate something around one axis with Mouse Input?

polar acorn
pastel talon
muted wadi
#

im making a DDR style game mechanic but I'm having an issue where sometimes when the note collider is intersecting the collider that the player is meant to activate, it just passes through instead of registering it as hit. Does anyone here have experience with that type of thing?

polar acorn
polar acorn
muted wadi
#

I've changed it to continuous and tried out all the other collision detection methods but the problem still persists

pastel talon
polar acorn
muted wadi
#

im wondering if maybe it could be because of the script that I use to move the cubes downwards, though I don't think it should be breaking the collision detection

float fallSpeed = 1.5f;
private void Update()
{
    transform.position += Vector3.down * fallSpeed * Time.deltaTime;
}```
polar acorn
#

Teleportation does not collide with anything

muted wadi
#

ah

#

damn

pastel talon
silk night
polar acorn
pastel talon
#

Lol I dont know what neither of those are. What, are they just random names that dont mean anything?

polar acorn
#

Look at the intro to C# in the pins

silk night
#

and what digiholic said

pastel talon
polar acorn
#

Because this is day one stuff

silk night
#

day 2 to be generous, day 1 is installing the ide 😄

polar acorn
#

If you don't know what int, float, and bool are, you are not ready to be implementing anything. You should be barely at "Hello world"

pastel talon
#

I've been paying 100% attention. I'm one of the most attentive in class. I guarantee you she just sucks then

#

we went straight into it on day one

silk night
#

how are you even programming without knowing what a bool is What

pastel talon
#

I don't even know

gusty hazel
#
        Debug.Log ("Detected");
        cowText.text = "Press E to interact";
        ani.SetBool ("Detected", true);
        if (other.gameObject.CompareTag("walkFinish")){
            Debug.Log ("colided");
            walk = false;
            TutStart ();
        }
    }```
pastel talon
#

she just teaches us functions and makes us copy them

gusty hazel
#

why isnt the collider working

polar acorn
gusty hazel
#

no it doesnt

polar acorn
# gusty hazel no it doesnt

The Three Commandments of OnTriggerEnter2D:

  1. Thou Shalt have a 2D Collider on each object
  2. Thou Shalt tick isTrigger on at least one of them
  3. Thou Shalt have a 2D Rigidbody on at least one of them
gusty hazel
#

3 thats the issue

neon fractal
#

@teal viper Thank you for pushing me in the right direction. I fixed my problem

muted wadi
#

I've changed the script to use movetowards and its working a little better, but sometimes the colliders will still pass through, not sure why

#

current collision settings are set to extrapolate and continuous detection

silk night
#

oh nvm

#

is your object really fast?

#

like could it pass before a next physics tick?

muted wadi
#

nope

#

its pretty slow

muted wadi
#

i am using an ontriggerstay to check for the collider though

silk night
#

Then better check for enter

muted wadi
#
 float fallSpeed = 4f;
 Rigidbody rb;

 private void Start()
 {
     rb = GetComponent<Rigidbody>();
 }
 private void Update()
 {
     rb.MovePosition(transform.position + Vector3.down * Time.deltaTime * fallSpeed);
 }```
silk night
#

Serialize the rigidbody and fill it in inspector btw

#

wont help your problem but just a general thing

muted wadi
# silk night Then better check for enter

that wont work for the ddr because it only does a check the second the collider enters the other collider, i need it to continuously check which object is inside the collider so the player can press a button and it gets destroyed no matter if its 10, 20 or 50% through the collider

silk night
#

can you fill me in what ddr means?

muted wadi
#

if you get what i mean

#

dance dance revolution

#

its a rhythm game

silk night
#

oh yeah i know that, just didnt know the abbreviation

muted wadi
#

ah

silk night
#

can you check if Enter works as expected though?

muted wadi
#

sure

#

as expected, I have to press the button at the exact frame it enters the collider

#

otherwise it wont be registered again and will just pass through

silk night
#

I mean just if it detects the enter 100% of the time

#

and just doesnt detect the stay 100% of the time

#

Technically you could do a HashSet which stores all objects that triggered enter and removes all that triggered leave, destroy all elements of HashSet on pressing the button

muted wadi
#

worth a try

subtle yacht
#

Hi, i have an issue on my script and I wonder if someone can help me in a call ?

azure zenith
#

Which is better? To destroy a gameobject or to set active to false when you pick it up?

#

Or does it not matter?

muted wadi
#

is it a lot of objects or just a few?

#

if its just a few then you might be better off setting active to false, in case you ever find a need to reactivate it

subtle yacht
calm coral
# azure zenith Or does it not matter?

I guess it matters if you later want to do something with it. Deactivate if you want to enable it back and use later, destroy if it's not going to appear in the game ever again

polar acorn
summer stump
azure zenith
#

Also, my sound does not seem to be working when I pick the item up

silk night
azure zenith
#

Alright, cheers

#

Can an OnTriggerEnter contain sound?

calm coral
subtle yacht
polar acorn
#
Unity Learn

An Animator Controller is a Unity asset that controls the logic of an animated GameObject. Within the Animator Controller there are States and Sub-State Machines that are linked together via Transitions. States are the representation of animation clips in the Animator. Transitions direct the flow of an animation from one State to another. In thi...

subtle yacht
#

Ok thanks I will try to do it 👌

polar acorn
#

See how easy it is to get a question answered when you actually ask one instead of expecting someone to jump into DMs with zero information as to what the problem is

subtle yacht
merry nebula
#

Anyone know how I could merge 2 healthbars into one? I have my P2 attached to my P1 and they should count as a single entity, but they have completely different functions and so therefore they aren't really one thing, but they should still share HP. (the comments at the top are kinda me thinking if I should make 2 separate scrits, but idk if that would work so am looking for a solution here 😵‍💫 )

eternal falconBOT
merry nebula
polar acorn
merry nebula
polar acorn
#

Or make a new script that handles the shared health that your current Health script references instead of having its own copy of

swift crag
fiery geyser
#

Hy Guys, I have a problem in an online game where robots are constantly on the server and players can enter and interact with them, but I have a bug that if the server is empty and someone enters, the objects in the robots' hands get bugged, can someone get me help or have an idea of ​​what causes this??

swift crag
#

Your UI shouldn't be running your game

swift crag
#

we also don't know what multiplayer framework you're using, how holding objects works, etc.

wintry quarry
chrome wasp
#

My collision will not work and I am super confused

#

So I have followed steps in the course I am doing giving rigidbody to my character and making sure they both have box colliders

#

And there is some collision but if I just hold forward I go through it

polar acorn
chrome wasp
#

wsad

wintry quarry
polar acorn
#

not what buttons

wintry quarry
#

not asking what buttons you use, asking what method you're using in the code to move it

chrome wasp
#

float xValue = Input.GetAxis("Horizontal")Time.deltaTimemoveSpeed;

#

Variable

rich adder
#

thats not movement

chrome wasp
#

transform.Translate (xValue, 0, zValue);

wintry quarry
polar acorn
#

that's teleportation

chrome wasp
#

yeye

#

ahhh

polar acorn
#

teleportation does not respect colliders

chrome wasp
#

Right because we are just teleporting forward frame by frame

swift crag
#

if you are using a rigidbody, you need to let the rigidbody handle things

#

otherwise it's like getting on a bus and then trying to steer it yourself

#

it's gonna crash

bitter carbon
#

cna anyone help me please, for some reason it fully works exept the x position is like off by 0.4 / 5

chrome wasp
#

how do I let rigid body handle

swift crag
rich adder
swift crag
#

Here is an example of what could be wrong. The cube isn't actually positioned correctly.

bitter carbon
#

yea the other thing is good

azure zenith
#

AudioSource.PlayClipAtPoint(PickUpSound, transform.position); does not work

bitter carbon
#

it is perfectly in the middle with same rotation as urs

rich adder
azure zenith
#

No

#

It is not

chrome wasp
#

So do I just need to use another way to make my cube move?

swift crag
#

a very easy thing to miss

azure zenith
#

I can hear other sounds

swift crag
#

This will do so in a way that respects colliders, assuming the rigidbody isn't kinematic

chrome wasp
#

and then do I just use that instad of the teleportation methods?

swift crag
#

Right.

#

rb.position = ... will teleport the rigidbody to a new position, without trying to move it from point A to point B

#

which you might sometimes want

chrome wasp
#

So I would get rid of the transform.translate thing?

swift crag
#

Yes.

#

You'll want to compute the new position based on the distance you want to move

#

probably rb.position + moveAmount

bitter carbon
#

is it better tu use transform.position than rb.position???

rich adder
bitter carbon
rich adder
#

rb.moveposition, addforce, .velocity

bitter carbon
#

how does that make it better?

chrome wasp
#

I literally started Unity yesterday i am confuse

rich adder
#

.velocity is kinda forcing it but stil respect physics

bitter carbon
rich adder
chrome wasp
#

I am not sure how to impliment rb.position + moveAmount into my code

azure zenith
#

OMG

#

HAHAHAHAHA

#

I DID IT

#

I finally did it

bitter carbon
rich adder
azure zenith
#

I got told I needed an AudioSource but I actually did not

delicate portal
#

Can i modify this object's rotation somehow?

rich adder
bitter carbon
#

anyone know how to make this work properly it works but for some reason its ofsetted on the x

flint pilot
#

i need a hand on something, so i have five bolts of a wheel and each of them has an equal script that defines, when the drill is near unscrew the bolt. i need to make the wheel understand that when all five bolts are unscrewed i can detach it. now it detaches but right after i remove one

rich adder
chrome wasp
rich adder
#

weird

polar acorn
azure zenith
bitter carbon
bitter carbon
chrome wasp
#

error message

rich adder
ruby python
#

Would anyone please take a look at this and see where I'm going wrong? Pulling my hair out at the moment.

In the first image, the little solar panels are supposed to be pointing in the direction of the sun (Just on the Y axis for now), but the angle is way way off and I can't understand why. (Second image is to illustrate their 'neutral' position).

[SerializeField] Transform sun;

    // Update is called once per frame
    void Update()
    {
        Vector3 targetDir = sun.position - transform.position;
        transform.rotation = Quaternion.Euler(0f, targetDir.y, 0f);
    }

    private void OnValidate()
    {
        Vector3 targetDir = sun.position - transform.position;
        transform.rotation = Quaternion.Euler(0f, targetDir.y, 0f);
    }
chrome wasp
#

k

rich adder
#

we've been talking about rigidbody this whole time

pastel talon
#

How do I trigger particles?

bitter carbon
polar acorn
bitter carbon
pastel talon
polar acorn
bitter carbon
rich adder
#

i don't get iit

fiery geyser
rich adder
#

the method is on Transform class and it doesn't help the main issue they had.

polar acorn
polar acorn
bitter carbon
polar acorn
bitter carbon
fiery geyser
# wintry quarry what debugging steps have you taken so far?

I'm using Photon Fusion, I believe the problem is that when the server is empty the Object stops being a parent of the hand and I don't know how to save this even with an empty server I tried to reset the rigidbody of the objects when the server is empty but it didn't work, I'm looking for a way to keep this Parent inside Photon Fusion

polar acorn
bitter carbon
#

i dont have time to argue so ill be afk

polar acorn
#

that's literally what you replied to

chrome wasp
#

dude this is just not working

#

I might take a break from Unity again lol

#

like idk

rich adder
#

"just not working" is not helpful

#

guess we just throw our hands up and say "iss broke" 🤷‍♂️

chrome wasp
#

the problem is I am not familar enough with everything to know what I need to change

#

In the course I am watching the teleporting works somewhat fine but it won't work at all for me

rich adder
#

all your doing is changing using methods on transform to methods on rigidbody

chrome wasp
#

right so I tried replacing transform to rigidbody

#

"Non-invocable member 'Rigidbody.velocity' cannot be used like a method."

rich adder
#

what don't you show what you did instead

rich adder
chrome wasp
rich adder
#

we sent you twice the docs to .velocity

silk night
eternal falconBOT
frosty hound
rich adder
#

how do you see it written in example

frosty hound
#

Simply typing Rigidbody means nothing to the code, it doesn't know what rigidbody you're referring to.

gaunt ice
#

!ide .....

eternal falconBOT
silk night
#

that too 😄

chrome wasp
rich adder
candid oyster
#

honestly as a begginer I must agree that the docs are really hard to learn from

#

I found a lot more luck with youtube videos

rich adder
#

its a lack of understanding how basic c# works

#

nothing much to do with unity

#

knowing Class vs Instance differences

polar acorn
rich adder
ruby python
#

@polar acorn Of course is. lol. Well don't I now feel like a complete muppet. I really should stop doing this coding milarky at the end of the day. lol.

chrome wasp
#

"Import Error Code:(4)
Message: Build asset version error: assets/mover.cs in SourceAssetDB has modification time of '2023-10-19T16:55:26.4573584Z' while content on disk has modification time of '2023-10-19T16:55:31.8948717Z'"

lavish ingot
chrome wasp
#

Now Im getting that

rich adder
candid oyster
#

Im not trying to argue with yall

#

Im just saying that I was in a similiar situation to Lilith

rich adder
#

yeah but saying "finding luck on youtube" is bad advice

chrome wasp
#

I started it and it spammed the console with a million errors telling me rb variable has not been assigned

chrome wasp
#

No but what do I assign it as

#

float?

lavish ingot
#

The velocity.

polar acorn
candid oyster
#

you obviously know a lot more then me

chrome wasp
#

box

polar acorn
lavish ingot
rich adder
#

doc doesnt say about assignment

gaunt ice
#

drag the rb on your character and drop into the variable apperas in the inspector

lavish ingot
chrome wasp
#

Gregg already has rigid body component

gaunt ice
#

you can assign other components in inspector through the same way (including your script)

pastel talon
rich adder
#

Starts Awake

#

forgot what is called

chrome wasp
lavish ingot
#

Lazy*

chrome wasp
#

stupid

polar acorn
chrome wasp
#

So I assign my variable to gregg?

polar acorn
pastel talon
polar acorn
#

if that is the one you want to use

rich adder
#

all the way at the bottom

#

Play On Awake

chrome wasp
polar acorn
#

you would drag the object into the variable on your script

pastel talon
rich adder
chrome wasp
#

so for the variable would I write public Gregg =