#so i have to say Bar1=getcomponent<Bar1

1 messages · Page 1 of 1 (latest)

tight oyster
#

done

green galleon
#
private Foo foo;

if(TryGetComponent(out foo)) // we already specified the type is Foo

if(TryGetComponent(out Foo2 foo2)) // we specify that Foo2 is what we want and store it in foo2 if found```
#

capilized letters are usually classes / methods

#

or at least should be

tight oyster
#

so if (trygetcomponent(out Bar1 bar1))?

green galleon
#

yes

#

but capitalization matters

tight oyster
#

gotcha

#

if (TryGetComponent(out Bar1 bar1) || TryGetComponent(out Bar2 bar2))
force++;
but i never use the bar1 or bar2 variables

green galleon
#

then you can put _

#

instead of a name

#

if (TryGetComponent(out Bar1 _ ) || TryGetComponent(out Bar2 _ ))

tight oyster
#

okk

#

it should work now

green galleon
#

yes

tight oyster
#

now the paddles rotate when touched, but it finally bounces, thanks!

green galleon
#

lock the paddle rigidbody Z

tight oyster
#

i have to freeze its y position right?

#

ok

green galleon
#

and freeeze X position

#

Y position is up and down

tight oyster
#

yeah my bad

#

i cannot lock y

#

i can only freeze y

green galleon
#

freeze x

#

and z rot

tight oyster
#

right

#

now it works, ty man

green galleon
#

np!

tight oyster
#

next time, before doing something like this i'll study a bit through tutorials and stuff

green galleon
#

sure but even tutorials can lead you astray

#

everyone does things different

tight oyster
#

i don't want to spend 2 days making a pong game and, more important, i don't want to bother you for something basic

green galleon
#

nah its no bother, just keep practice eventually you get faster/better

#

and its all the same stuff you're using regardless of game

#

its not easy especially with english as second language 😛

#

I understand that believe me

tight oyster
#

like a score and money

green galleon
#

very true

#

now you know about reflect

#

which is very powerful

#

esp when you start doing bullets or other more complex stuff

tight oyster
tight oyster
#

now i gtg

#

i should have started to study 3 hours ago

#

i have an english literature oral test tomorrow

green galleon
#

goodluck !

tight oyster
green galleon
tight oyster
#

can you send me a friend request? i cannot send you one, but if you don't want to is fine

green galleon
#

yeah sure np

tight oyster
#

:)

#

bye

green galleon
#

take care

#

👋