I am making a radar script in a unity FPS game project I am making for class. I already have a working example of a radar script that works in relation to the player's position. However the rotation is in relation within the world map, not the player's view.
In code I have it kinda like this (not actually my code, as I don't have it with me right now, but basically the same algorithm)
if (isPlayerInViewRange(otherPlayer[i]){ //these are both normalized Vector dir = getDirectionFromPosition(player, otherPlayer); dir = rotateDirectionInRelationshipToPlayer(player, dir); //problem here dir = new Vector3(dir.x, dir.z, 0); dir.Scale(MapToRadarPosition, 0, MapToRadarPosition); radarDot[i] = dir; radarDot[i].setActive(true); } else { radarDot[i].setActive(false); } Any ideas what I am missing, I feel like I am missing some obvious function to do it.