Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to get Object's data if you look at it

Lodeon003Lodeon003 Member
edited November 14 in Programming

Hello, im not very good at programming in unity, and I don't understand how to get an object's data or script if I'm looking at it...

So I wanted to make an ability that allowed you, if you click a button, to teleport to a "teleportation point" positioned around the map, if you are looking at it.

I thought about putting some gameObjects (teleportation point) with a "teleport to" script around the map and put in the player script a raycast. If the raycast from the player finds the "teleport to" script on the teleportation point and you are looking at it, it sets your position to that teleportation point's position (teleporting you there)

I don't know how to access the "teleportation point that you are looking at" 's position... Any ideas how to?

Sign In or Register to comment.