UnityNinja Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

UnityNinja CommunityLog in

UnityNinja - Video Game Development Community, including Resources, Forums, Marketplace & More.


descriptionCreated a Minimap but can't get it to follow the player EmptyCreated a Minimap but can't get it to follow the player

more_horiz
Hi,

I'm using Unity Version 5.5.0f3.

I created a minimap thanks to a tutorial I found online. It looks great. Only problem is, it doesn't follow the player when I test the game.

I tried attaching different scripts, but nothing seems to work so far.

Anybody got some advice on how to do it on this version of Unity?

Cheers

Created a Minimap but can't get it to follow the player Bildsc10

descriptionCreated a Minimap but can't get it to follow the player EmptyRe: Created a Minimap but can't get it to follow the player

more_horiz
Some ideas to fix this: Make a script that constantly changes the position of the camera to the position of the player except on a certain y position.

Code:

var plr : Transform;
var y : float;

function Update () {
transform.position = Vector3 (plr.position.x, y, plr.position.z);
}


Or, you could just put the camera into an unrotated child of the character (or just under the character). If you want the camera to stay at the same y position the whole time, just create some simple code.
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum
power_settings_newLogin to reply