#to reach the beam to the flower with the

1 messages · Page 1 of 1 (latest)

topaz dune
#

okay

opal narwhal
#

so

topaz dune
#

so you want to do a Reflect for direction

#

from your White cube hitpoint

opal narwhal
#

yep

topaz dune
#

to the angle of the normal

opal narwhal
#

y

topaz dune
opal narwhal
#

i mean yeah

topaz dune
#

ok so is it clear so far?

#

Vector2 version could work fine I suppose since your're doing 2D ish

opal narwhal
topaz dune
#

yes use that function

opal narwhal
#

they are all vector2

topaz dune
#

doesn't matter

#

vector3 and 2 are interchangeable

#

vector3 in 2D just gets 0 on the z

opal narwhal
#

yes i first used vector3

#

then i saw there is no diffirence so i changed it to vector2

#

so to detect the beam hitting the flower

#

what should i do

topaz dune
#

did you remove the layermask from the raycast

topaz dune
#

ok, come back to that after

#

so you use the function I sent you

#

when you hit the white cube

opal narwhal
opal narwhal
#

i think shoot laser one

topaz dune
#

forget the laserbeam right now

#

focus on the actual functionality

#

worry about visuals later

#

shooting laser, you need to get the laser to be reflected so it can hit somehting

opal narwhal
#

the white cube transform component?

topaz dune
#

make a script for the white cube called Reflector

opal narwhal
#

so just this ?
reflectedObject.position = Vector3.Reflect(originalObject.position, Vector3.right);

topaz dune
#

put it on the object

opal narwhal
#

uhm

#

ok

topaz dune
opal narwhal
topaz dune
#

is just a way to detect it

#

for the raycast

#

so it knows to reflect

opal narwhal
topaz dune
#

must be monobehavior but yes

opal narwhal
#

alright then

#

done

#

next step

topaz dune
#

ok now inside the raycast you have to refect your ray

#

ideally ou should make a variable for rays so they're not confusing

#

did you get it working ?

topaz dune
#

@opal narwhal

opal narwhal
#

any ways

#

i had it working before

#

let me show you