Quantcast
Channel: Questions in topic: "follow"
Viewing all articles
Browse latest Browse all 536

Looking for help with orbit/follow player script vector math calculations

$
0
0
So basically I have an object, a 3D menu, attach itself to a game object when that object is selected. The camera is a first person camera (actually this is for a HoloLens app), so the player can walk around the object and look at it from any angle and I want the 3D menu to move around the object following the player at a particular distance (toward the player) from the root of the object the menu is attached to. The menu is circular so the player can see the menu options around the edge but still see the object as if looking through a scope. I'm fairly new to Unity and vector math, so I'm having trouble figuring this out the basic calculations that are needed. I am already using a billboard script attached to the circular menu so that it constantly faces the player. I just can't get it to move in orbit like fashion following the player (Camera.main) position at a set distance from the object. Note: The menu will appear when the player clicks on the object, but so that the user doesn't forget to close the menu, it will disappear if the player moves away from the object. Sorry I don't really have any code. Basically I just have the game object called ObjectOfMenu. (This is a first every post/request for help. I defiantly need to learn quite a bit about vector math.)

Viewing all articles
Browse latest Browse all 536

Trending Articles