#Cursor lock and camera issue

1 messages · Page 1 of 1 (latest)

worn bane
#

Did this thread work?

wary crystal
#

Hello

#

Thread

#

No other scripts with cursor nah

worn bane
#

@distant parrot we made a thread

worn bane
wary crystal
#

now my camera is starting way way above the position I am setting it to

wary crystal
worn bane
#

And did you try it in build, not editor as well?

wary crystal
#

and yeah trying it in game

worn bane
wary crystal
worn bane
wary crystal
#

oh

#

then no

#

what is build

distant parrot
#

export

#

I said it already

wary crystal
#

where do I do that?

distant parrot
#

File > Build Setting

worn bane
#

Go to edit-> build settings-> build and run

#

File, not edit I guess

distant parrot
#

i dont even remember tbh

wary crystal
#

mouse still moving

#

and visible

distant parrot
#

can you put a Debug.Log in start

worn bane
distant parrot
#

see if it runs

worn bane
#

I have to go, sorry

wary crystal
#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveCamera : MonoBehaviour
{
    public Transform cameraPosition;

    void Update()
    {
        transform.position = cameraPosition.position;
    }
}
#

I don't think this script is working

#

the position is not being updated

#

is it because the void update isn't private?

#

idk

wary crystal
#

I built and ran it if that's what you mean

distant parrot
#

wait

#

wait

wary crystal
#

ah

distant parrot
#

wtf

wary crystal
#

the script

#

I got ya

distant parrot
#

you IDE

#

goddamit

#

no

#

stop

#

everyting

wary crystal
#

??

#

I am listening

#

100% attention

distant parrot
#

start

#

is wrong

wary crystal
#

??

distant parrot
#

goddam it configure ur visual studio

#

tell me if you see a difference

wary crystal
#

configure?

distant parrot
fading shuttleBOT
#
💡 IDE Configuration

If your IDE is not autocompleting code
or underlining errors, please configure it:

Visual Studio (Installed via Unity Hub)
Visual Studio (Installed manually)

VS Code*
JetBrains Rider
Other/None

*VS Code's debugger plugin is unsupported.
We recommend using VS or Rider instead.

distant parrot
#

I should've noticed earlier but Im friyed

#

xD

wary crystal
#

ok followed

#

what did that do/

wary crystal
distant parrot
#

show me its configured

distant parrot
wary crystal
#

I mean

#

I will check again

worn bane
#

S vs. s

distant parrot
wary crystal
distant parrot
#

did u select it in unity as editor

#

and restart VS

wary crystal
#

Oh hey perfect

#

The mouse is gone!

#

thanks lads

#

got another issue now if ya got the time tho haha

distant parrot
#

hey listen if the IDE(VS) was configured it would've def alerted you

#

so for sure configure it , as it is also the rules

#

c# is case sensitive

wary crystal
#

I just did

#

maybe i should follow the other one

distant parrot
#

open script from unity

#

let it load

#

screenshot

wary crystal
#

Yeah it aint showing the error

#

I followed the 2nd option but I'll try the first

distant parrot
#

you have VS2019 yes?

#

did you do this part

wary crystal
#

Yeah I am on there I got either Visual Studio 2019 or Visual Studio Code

worn bane
#

I used to use vscode, and it never worked, but then I switched to just plain vs, and everything did fine

wary crystal
#

I am pretty sure I'm on code

#

Yep it shows them!

#

Thanks lads

#

Can I make it black?

distant parrot
#

not sure if it still like that in 2019

wary crystal
#

oh

#

My 30 day trial has run out

#

I canny use this

distant parrot
#

dude

#

use Community

#

its free

worn bane
wary crystal
#

community?

worn bane
wary crystal
#

I like free

distant parrot
#

indeed, you likely downloaded enterprise trial

wary crystal
#

Thank you

distant parrot
worn bane
wary crystal
#

catto

distant parrot
#

it's catto!

wary crystal
#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveCamera : MonoBehaviour
{
    public Transform cameraPosition;

    private void Update()
    {
        transform.position = cameraPosition.position;
    }
}
#

Why does this not work?

worn bane
#

It looks like a cat with a broken smile and Christmas lights on it's cheeks

wary crystal
#

Any ideas?

#

I do not fathom

distant parrot
#

what you mean "doesn't work"

wary crystal
#

Wait

#

good question

#

The code is running

#

my print("Big Balls"); worked

#

The position is not being changed

worn bane
wary crystal
#

I printed Big Balls

#

to test if it worked

#

it does

worn bane
wary crystal
#

😦

#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveCamera : MonoBehaviour
{
    public Transform cameraPosition;

    private void Update()
    {
        print("Big Balls");
        transform.position = cameraPosition.position;
    }
}
#

Big Balls

distant parrot
#

so what "doesnt work" mean

wary crystal
#

transform.position is not being set equal to cameraPosition.position

#

but what I don't get

#

where tf am I getting transofmr

#

transform

distant parrot
wary crystal
#

I know where I am getting transform

#

Their value did change

#

but

#

It's wrong

#

I don't understnad

#

It's like

#

ALMOST being moved correctly?

#

it is moving with the character

#

but has

#

some weirdass offset

distant parrot
#

show hierarchy

wary crystal
distant parrot
wary crystal
#

This is the camera's position

#

This is the CameraHolder's position

worn bane
#

Why do they both have camera gizmos?

wary crystal
#

oh the other one is the main camera

#

idk why it still exists

distant parrot
wary crystal
#

yes

#

the position is still off

#

so I guess the rotation isn't causing the issue

#

watch it be another capitalisation error

worn bane
wary crystal
#

ye

#

idfk tbh

#

I honestly don't see what's wrong haha

worn bane
wary crystal
#

I wanted to see if the code was running

#

Or are you asking if there's a reason as to why I specifically used "Big Balls"

worn bane
wary crystal
#

Oh

#

There was literally zero reason why I chose Big Balls

worn bane
wary crystal
#

I doubt it

#

Big Balls = funny

#

simple as that

worn bane
#

Your neurons fired in a way that made you type that

wary crystal
#

oh well

#

who cares haha

#

big balls funny

#

all there is to it really

worn bane
#

Ok, I think we drove off @distant parrot

wary crystal
#

possibly

#

I am entirely confused as to why my thing doesn't work

worn bane
#

Me too

wary crystal
#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveCamera : MonoBehaviour
{
    public Transform cameraPosition;

    private void Update()
    {
        print("Big Balls");
        transform.position = cameraPosition.position;
    }
}
#

it sets

#

transform.position of the thingy

#

to

#

the position of the position

distant parrot
#

huh?

distant parrot
worn bane
#

Try saying this.transform.position = randomPos (note: this is pseudo code)

wary crystal
#

alright

worn bane
#

See if it works

distant parrot
#

position comes from transform

wary crystal
#

can I not use a Vector3?

#

or smthn

worn bane
wary crystal
#

pos = new Vector3(x, y, z);

distant parrot
worn bane
#

Wait, can you even update transform.position directly?

distant parrot
#

yes

worn bane
#

It's been like a month or two since I actually used unity

wary crystal
#

Doesn't work

worn bane
distant parrot
wary crystal
#

This?

worn bane
#

But I feel like I should

distant parrot
wary crystal
#

What

distant parrot
worn bane
distant parrot
#
 [SerializeField] Transform posToGo;

    void Update()
    {
        transform.position = posToGo.position;
    }```
wary crystal
#

what

#

I don't see GameObject thingy

distant parrot
wary crystal
#

I don't see that

distant parrot
#

screenshot inspector

wary crystal
#

Where am I looking

#

Ah ok

#

I'm with you

#

I see it

distant parrot
#

ok

wary crystal
#

Wtf

#

WAIT

#

FUCK ME

#

maybe not

#

I was thinking

#

Either

#

Yeah

#

I am a silly sausage

#

Ok so the issue is

#

Ffs

distant parrot
#

the parent is offsetting child

wary crystal
#

yes?

#

the CameraHolder is moving as it should

#

but the camera inside of the PlayerCam isn't moving

#

no yes

#

literally exactly what you said

distant parrot
#

oh ok lol so it working now?

wary crystal
#

Yes

#

I set the position values of the camera to 0,0,0

#

so it was inside the parent

#

haha

#

thanks for the help man

#

I am not at all used to Unity yet

distant parrot
#

all good takes time at first

wary crystal
#

yep

#

I am good with Roblox Studio

#

but Unity is a different beast

distant parrot
#

roblox studio , cute

wary crystal
#

Yeah

#

Was where I started making games

#

I am proud of that

#

No harm in starting somewhere

#

Just another place to utilise creativity

distant parrot
#

nothing wrong wit it no

wary crystal
#

But it's definitely way more user friendly and less complex

distant parrot
#

code is pretty easy once you learn the components

#

all the functions are pretty much in the engine already

wary crystal
#

Yeah seems that way tbh will just take a hot minute to figure out what's where

worn bane
#

Does blender really have a game engine?

distant parrot
worn bane
#

Good thing we made a thread

distant parrot
wary crystal
#

uh

worn bane
#

They got rid of it?

wary crystal
#

so I attached my character controller script

distant parrot
wary crystal
#

and my character controller component

#

but uh

worn bane
wary crystal
#

My bean is wildin'

distant parrot
#

are you following a tutorial or just doing stuff ?

worn bane
distant parrot
#

because you still do need fundamentals lol

wary crystal
#

haha

#

I'll figure it out lmao

#

I try to do my own research as much as possible

distant parrot
#

look into movement tutorials no

wary crystal
#

but I was so absolutely utterly stuck

#

I had to come to this discord

worn bane
distant parrot
#

Unity has specific c# methods yes

#

always good to learn the basics of c# itself too

worn bane
wary crystal
#

It could be worth just working my way through all of the unity tutorials a few times before I continue

distant parrot
#

use the pathways on the site

#

they start slow but they give you good fundamentals

wary crystal
#

will be tomorrow's problems

worn bane
distant parrot
worn bane
# worn bane Unity learn?

I started that once, but knew everything it was saying, so stopped. Will finish sometime in the unspecified future

distant parrot
#

yes its for mostly those who never touched unity at all

worn bane
#

@wary crystal sorry, but I won't be accepting your friend request, nothing personal

#

What were we talking about again? Did all problems get fixed?

#

I've got to go, bye!