#hm

1 messages · Page 1 of 1 (latest)

eager arrow
#

hi

austere mauve
#

I think we found the problem

#

You see that thing?

#

Camera.transform.position

#

That changes the camera’s position

eager arrow
#

yes

#

ooh

#

should i delete it

austere mauve
#

That’s THE problem

#

Probably
If its not used for anything

#

Try deleting it

eager arrow
#

ahh

#

im getting script errors now

austere mauve
#

XD

#

Lemme see the section of the script you found it in

agile crest
#

Just put // infront of it to comment it out

austere mauve
#

Is there leftover semicolon…

eager arrow
austere mauve
#

Uhh

#

me unexists

agile crest
#

That's all one piece of code, if it's split over multiple lines, you need to do it for all the lines

#

find the ); that finishes it

eager arrow
#

/* void Update() { camera.transform.position = new Vector3( currenthitbox.transform.position.x, currenthitbox.transform.position.y, camera.transform.position.z ); */

austere mauve
#

Yea that’ll do

agile crest
#

Nope

eager arrow
austere mauve
#

Wait

agile crest
#

You've commented out the method

austere mauve
#

YOU

#

AAAAA

eager arrow
#

oh

austere mauve
#

TWIX

eager arrow
#

so i delete it instead

austere mauve
#

YOU COMMENTED VOID UPDATE

eager arrow
#

OH

austere mauve
#

YOU”RE MEANT TO COMEMNT ON JUST THE CAMERA TANSFORm

agile crest
#

Stop with the caps.

austere mauve
#

Sry ze caps lock broke

#

Im still going ot use full caps tho xD

eager arrow
#

/* { camera.transform.position = new Vector3( currenthitbox.transform.position.x, currenthitbox.transform.position.y, camera.transform.position.z ); */

austere mauve
#

Uhh

#

Its meat to be /* camera.transform.position - - -

                            Camera.transform.position.z

);
*/

eager arrow
#

OH

austere mauve
#

I think that first { is for void update

#

So it’s going to hae } but not { and unity’s going to give you another error

#

I don’t even code much.. i took 3 cs50 lectures and i know you’re not meant to comment out the {

eager arrow
#
    
    {
       // camera.transform.position = new Vector3( //
            currenthitbox.transform.position.x,
            currenthitbox.transform.position.y,
          /*  camera.transform.position.z
        ); */
         ```
eager arrow
#

i only started using unity/coding 2 months ago since im taking 1 game dev class

#

but the class ended now so i cant get help

#

but assignment still due

#

🥺

#

did i do it right

austere mauve
#

Probably

#

Ask carwash

eager arrow
#

@agile crest

austere mauve
#

Yea try saving it

#

We can just work from the errors…

eager arrow
austere mauve
#

?

#

Wtf

#

Just send the whole script…

eager arrow
austere mauve
#

Oh dear god its 5kb

#

Im scared now

eager arrow
#
        
        Vector3 currentMovement = this.rb.velocity; 
        currentMovement.Scale(new Vector3(0.0f, 1.0f, 0.0f));
        // Moving left
        if (Input.GetKey(KeyCode.A))
        {
            if (!this.facingLeft) {
                this.flip();
                this.facingLeft = true;
            }
            currentMovement += new Vector3(-this.movementSpeed, 0.0f, 0.0f);
        }

        // Moving Right
        if (Input.GetKey(KeyCode.D))
        {
            if (this.facingLeft) {
                this.flip();
                this.facingLeft = false;
            }
             currentMovement += new Vector3(this.movementSpeed, 0.0f, 0.0f);           
        }
        
        /* Moving Up
        // if (Input.GetKeyDown(KeyCode.W) && !isJumping)
        {
            this.isJumping = true;
            currentMovement += new Vector3(0.0f, this.jumpSpeed, 0.0f);            
        }

        // Moving Down
        if (Input.GetKeyDown(KeyCode.S) && isJumping)
        {
            currentMovement += new Vector3(0.0f, -this.jumpSpeed, 0.0f);            
        }
        */

        this.rb.velocity = currentMovement;
    }

    public static bool setCanSteal(bool canSteal) 
    {
        if (Player_Controller.instance.isJumping) 
        {
            return false;
        }
        else
        {
            Player_Controller.instance.canSteal = canSteal;
            Player_Controller.instance.rb.velocity = new Vector3(0.0f, 0.0f, 0.0f);
            return true;   
        }
    }
    

    void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("Ground"))
        {
            this.isJumping = false;
        }
    }

    public static void startTalking()
    {
        instance.isTalking = true;
    }

    public static void stopTalking()
    {
        instance.isTalking = false;
    }

    public static void ActivateHumanForm()
    {
        if (!instance.isHuman) {
        instance.isHuman = true;
        instance.humanform.transform.position = instance.foxform.transform.position;
        instance.currenthitbox = instance.humanform;
        instance.humanform.SetActive(true);
        instance.foxform.SetActive(false);
        instance.rb = instance.currenthitbox.GetComponent<Rigidbody>();
        Guardmanager.destroyAllGuards(); 
        }
    } 
  

    public static void ActivateFoxForm()
    {    
        if (instance.isHuman) {
        instance.isHuman = false;
        instance.foxform.transform.position = instance.humanform.transform.position;
        instance.currenthitbox = instance.foxform;
        instance.humanform.SetActive(false);
        instance.foxform.SetActive(true);
        instance.rb = instance.currenthitbox.GetComponent<Rigidbody>();
    } 
}
}
#

it made me send it in 2 parts

austere mauve
#

Oh dear

eager arrow
agile crest
#

This

camera.transform.position = new Vector3(
            currenthitbox.transform.position.x,
            currenthitbox.transform.position.y,
           camera.transform.position.z
        );

is one line of code, split over multiple lines for readability. It is actually:

camera.transform.position = new Vector3(currenthitbox.transform.position.x, currenthitbox.transform.position.y, camera.transform.position.z);```

So you can't comment out _ONE_ line of it
austere mauve
eager arrow
#

ahh

#

so should i just delete the lines mentioning camera

austere mauve
#

Damn carwash smart

agile crest
#

2kb, 5kb for a script file is irrelevat

austere mauve
#

#

Well i never use scripts

eager arrow
#

carwash

austere mauve
#

Totally off topic but I found a lego cowboy hat xD

eager arrow
#

oh dang

austere mauve
#

Parrot xD

eager arrow
#
    
    {
       
            currenthitbox.transform.position.x;
            currenthitbox.transform.position.y;
        ```
eager arrow
#

this is it currently

austere mauve
#

Why is it stil-

#

Yk what i wont ask

#

Save and try to run

eager arrow
#

still what

austere mauve
#

The current hit box.transform

eager arrow
#

shouldi delete them

austere mauve
#

Sec

eager arrow
#

sec?

austere mauve
#

Can you show me line 62 row 13?

eager arrow
austere mauve
#

Yeah delete both…

eager arrow
#

no errors yay!

#

lemme see if it works

austere mauve
#

Well finally…

eager arrow
austere mauve
#

XD

#

Did you MOVE the camera yet

eager arrow
#

i did get one error when i played but still lets me play so i dont think it matters

eager arrow
austere mauve
#

I am genuinely confused

eager arrow
austere mauve
#

Twix

#

Can you try to like

#

Make the camera smaller, with teh scale tool

#

Make it roughly the height of the white wall

eager arrow
#

i dont think i can i changed all the scale x,y,z to 100 and then changed them to 0 and it was the exact same size

austere mauve
#

Do you mean
“I can’t scale the camera”

eager arrow
#

yes

austere mauve
#

How…

eager arrow
#

i even tried using the scale tool

austere mauve
#

How did you make the camera gigantic then

eager arrow
#

i dont think i changed the size of it when i brang it in

austere mauve
#

Then make a new camera

#

Im still confused tho

eager arrow
#

this is the new camera

#

i didnt change the size at all just added it in

austere mauve
#

Why is it still big…

#

Wait Twix

#

What about the SCENE

#

Maybe you can scale that up

eager arrow
#

i can scale it up

#

but i can only see the background

#

im thinking making a new camera doesnt automaticalyl make it the game view

austere mauve
#

Then move the scene up

austere mauve
eager arrow
#

yeah i deleted the old one and am using the new one

austere mauve
#

Ok

#

Just try to move stuff and scale stuff untill you get it

#

I gotta go