#No Speed variable

1 messages · Page 1 of 1 (latest)

ocean gate
#

Thread

eager bone
#

Then

#

show

#

the

#

line

#

jesus

daring temple
#

@gray niche here

gray niche
#

I've already created a thread what's this for?

inner kayak
#

So we don't have to see your nonsense in the main channel. If you want to go around wasting people's time, you can do it here out of sight.

eager bone
inner kayak
#

Have fun

gray niche
#

Get to my previous thread, much information is there plus with CarController script fully through the link!

#

Wasn't needed to create another thread.

ocean gate
#

When you have an error, and you announce that to a discord channel you can't just never provide information about it, never provide the code that causes it, and just go on rambling about other parts of your intentions

#

just provide the context

eager bone
#

@gray niche Don't ping me into another thread that also doesn't have the information I asked for

#

Just look at your fucking console and tell me what the error is

gray niche
#

It'll, just get there, because I'll continue that thread.

patent brook
#

Brone. Please stop being difficult. Understand that people want to help

#

They're asking to see the error in the console

autumn zephyr
#

brone how hard is it to say a line number? you know what numbers are?

patent brook
#

Can you please show a screenshot of the error in unity?

gray niche
#

Just wait, I'm trying to send it.

patent brook
#

That's all

#

Good. Thank you

autumn zephyr
#

shouldn't take a half hour of 8 people begging to help you

gray niche
#

Yeah.

autumn zephyr
#

is this a power play

patent brook
#

Don't goad them any further @autumn zephyr

gray niche
#

My pc was turned off cause no charge, now just launched it ..

patent brook
#

Okay, we'll wait. When it's done, just take a screenshot of the error in the unity console
Then we can see which line the error actually is

#

Then we can point out which line in your script has the issue

#

That's all Digi has been asking for. I understand you're frustrated, but so is everyone else

#

So let's just restart first. Like your PC :p

gray niche
#

Yeah, I'm sorry. Beginner problems...

inner kayak
gray niche
#

Unity's taking too long to launch...

ocean gate
#

We don't need to hear it

gray niche
#

Lol...

gray niche
eager bone
#

Okay so

#

the error

#

is not even in the class you gave

gray niche
eager bone
#

Okay

#

so it's exactly what I said

gray niche
eager bone
#

an hour ago

ocean gate
#

if (Speed => 50)
What is this symbol

gray niche
#

it's just the speed!

eager bone
#

Same solution different line

ocean gate
#

if (Speed >= 50) is what you actually want

eager bone
gray niche
ocean gate
#

That will only solve one of the errors

gray niche
#

what about 26? is it also wrong?

#

Line 26! that's also an error!

ocean gate
#

The comparison symbols read as you would speak them. "Greater than or equals to". Not "Equals or greater than". => in C# means a bunch of other things

gray niche
#

changed them and they're not fixed!

ocean gate
#

Your other issues are as digi says, you can't just mention speed and expect it to know about the car controller

gray niche
#

I was asking for attaching the script!

ocean gate
#

you have to reference the car controller and refer to it

eager bone
gray niche
#

Look...

eager bone
#

Scroll up

#

I posted the screenshot of where I answered this

ocean gate
#

carController.Speed

gray niche
gray niche
gray niche
eager bone
ocean gate
#

It shouldn't be hard to understand where that goes, your errors should be underlined in red

ocean gate
gray niche
eager bone
ocean gate
#

Good, you don't have to participate either

eager bone
#

you don't want to use this.Speed

#

You want to use the speed from car controller

#

as Vertx has also told you

ocean gate
#

If it's not obvious where these problems are, then I'm concerned your IDE is not configured, as it should be all clearly underlined in red

gray niche
eager bone
ocean gate
eager bone
#

what

gray niche
ocean gate
eager bone
#

what universe are you in that I say "Don't use this.Speed" and your solution is to add this.Speed

autumn zephyr
#

your followplayer script doesn't have a definition for Speed

#

so this.speed is a compilation error

ocean gate
#

Pointless to continue without a working IDE

eager bone
#

This can't be a real person

#

I refuse to believe it

gray niche
autumn zephyr
#

it's not configured

ocean gate
#

Cool, you need to configure it

autumn zephyr
#

just follow it

#

skip the parts you've done, do the parts you haven't

gray niche
#

Just made two changes! External edito, attached to Unity!

eager bone
gray niche
#

Speed yet not fixed!

ocean gate
#

Is it underlined in red though

eager bone
autumn zephyr
#

it wasn't supposed to fix your error, rather simply allow you to see it

gray niche
eager bone
gray niche
ocean gate
#

Did you manually install VS? Or add it via the hub

eager bone
#

is it underlined or not

gray niche
gray niche
autumn zephyr
#

you also said "yeah!" when he asked if it was showing as an error

#

(which means red underlined)

eager bone
gray niche
ocean gate
#

Ok, close VS, in the External Tools preferences of Unity, hit Regenerate Project Files, and then re-open VS via Assets/Open C# Project

#

and hopefully it'll work

gray niche
autumn zephyr
#

it's not really negotiable if you want to get it to work

gray niche
#

Re-launching...

autumn zephyr
#

make sure "external script editor" is set to visual studio -> press "regenerate project files"

#

under edit -> preferences

#

did you regenerate the project files before re launching?

#

and confirm that your ide is set as the external editor

gray niche
#

My default settings...

autumn zephyr
#

kk. so yes you pressed the regenerate button?

ocean gate
#

As long as the Unity workload was added when VS was installed, it should start working now

gray niche
autumn zephyr
#

buuuut you said you were re-launching

ocean gate
#

If not, Window/Package Manager, and see if there's an update to the Visual Studio Editor package

gray niche
#

I got this msg!

ocean gate
#

that's fine

gray niche
#

Aha!

#

Visual studio gave me a msg said there were build errors. Alsed for restart and fix so I clicked yes!

#

Now there are underlines of Speed!

eager bone
ocean gate
#

we're talking about the code, the code needs to refer to the speed on the car controller

eager bone
eager bone
#

I'm out I can't deal with this shit again

gray niche
#

I think you're to the wrong direction again! My goal is just to get the Speed from CarController into followPlayer!

🤦‍♂️

eager bone
autumn zephyr
#

this.speed refers to the speed on THIS object, which is not a car controller

#

and speed doesn't exist on that script

autumn zephyr
#

what does that mean

gray niche
autumn zephyr
#

i feel like you're gaslighting me into being less sure

gray niche
autumn zephyr
#

but every time i looked at it, that was the case

ocean gate
#

It's simple, you have followPlayer, it doesn't have a Speed variable

autumn zephyr
#

that's your carcontroller script, not your followplayer script

ocean gate
#

look at that script, the script with the error

autumn zephyr
#

in followplayer.cs, THIS means THIS INSTANCE of followplayer

ocean gate
#

where is Speed? It's on CarController. Where is that? You have a reference to it in carController

autumn zephyr
#

followplayer doesn't have a speed

ocean gate
#

refer to the speed on carController.

gray niche
ocean gate
#

We all know what you want, you're just not listening

autumn zephyr
#

this.speed is NONSENSE

eager bone
autumn zephyr
#

you can't do that

#

you ahve to stop doing that

#

you have to eliminate that code

#

you have to write it differently

eager bone
#

(I can't stay away it's like a train wreck)

ocean gate
#

your attempt to get speed is nonsense, you need to get it from where it exists.

gray niche
autumn zephyr
#

WHAT THE FUCK DOES THAT MEAN

ocean gate
#

"Applied" is meaningless, this is code

autumn zephyr
#

it's not applied?

ocean gate
#

there is no applying

autumn zephyr
#

you just..write it

#

type the words

gray niche
#

If it doesn't work at whatever the way we try, then why keep it!

inner kayak
#

I'm half tempted to overrule the English only rule and let someone translate to whatever native language this person speaks.

#

Because half the things they say are clearly just lost in translation.

autumn zephyr
#

this.speed WILL NOT COMPILE

#

CHANGE. IT

gray niche
#

How many times should I say, this is changed already.

autumn zephyr
#

"this" means followplayer. you want carcontroller

gray niche
#

Same as previous
Speed >= 50

eager bone
autumn zephyr
#

if it's the same as previous

#

you did'nt change it my dude

#

that's the opposite of changed

#

this.speed and speed are the same value

ocean gate
#

Just look at line 23 of FollowPlayer, no other line.
FollowPlayer doesn't declare Speed. Trying to access Speed is therefore an error.
So where do we get Speed from? CarController.
Where in FollowPlayer does a car controller exist? carController.
On line 23, access carController to get Speed. carController.Speed

autumn zephyr
#

you're referencing the speed variable on followplayer WHICH DOESN'T EXIST

gray niche
autumn zephyr
#

CarController is the class. you want carController

#

you have to be fucking with us

#

you would have accidentally done it correctly by this point

gray niche
#

Good News!

#

👏

#

Worked!

#

The Speed is currently working. But gonna forget the current issues which are 999+

#

Thanks ☺️