tracking multiplayer movement

hey I’m looking for a way to track/draw the movement of the players on a multiplayer map.
to see if movement is interesting or if the map needs changing.
right now i have a trail render on every player set to infinity, but only the server should see the trails not the players…
also i would like to save that somehow. like making a topdown screenshot just before the player disconnects.
the map has different levels so the whole map should have a kind of transparent shader for the server only or at least for the screenshots

I’m not a big coder but if you guys could give me some hints and maybe some snippets I should be able to fiddle it together…

thanks for any help

darn i can’t find anything about this online… you would think someone would have had the need for this before.
seeing that its also used in the Call Of Duty series i though it would be a popular demand?

I’ll have to try it by myself than i guess:
i was thinking of using the line renderer on the players start position tracking his current position, for starters…

getting confused already… i get a warning that i never assign StartPosRed, StartPosBlue, CurrentPosRed, CurrentPosBlue and their values will always stay null? i thought i was doing that here… StartPosRed = RedPlayers*.transform.position;*
```
*using UnityEngine;
using System.Collections;

public class MovementDebug : MonoBehaviour {

LineRenderer MovementBlue;
LineRenderer MovementRed;
public GameObject[] RedPlayers;
public GameObject[] BluePlayers;
Vector3[] StartPosRed;
Vector3[] CurrentPosRed;
Vector3[] StartPosBlue;
Vector3[] CurrentPosBlue;

// Use this for initialization
void Start () {
	
	RedPlayers = GameObject.FindGameObjectsWithTag("RedTeam");
	BluePlayers = GameObject.FindGameObjectsWithTag("BlueTeam");

	for (int i=0; i < RedPlayers.Length; i++){
		
		StartPosRed[i] = RedPlayers[i].transform.position;
		
		foreach(GameObject GO in RedPlayers){
			
			MovementRed = GO.AddComponent("LineRenderer")as LineRenderer;
			MovementRed.material = new Material(Shader.Find("Diffuse"));
			MovementRed.SetColors(Color.red, Color.red);
			MovementRed.SetPosition(0, StartPosRed[i]);
		
		}
	}
	for (int i=0; i < BluePlayers.Length; i++){
		
		StartPosBlue[i] = BluePlayers[i].transform.position;
		
		foreach(GameObject GO in BluePlayers){
			
			MovementBlue = GO.AddComponent("LineRenderer")as LineRenderer;
			MovementBlue.material = new Material(Shader.Find("Diffuse"));
			MovementBlue.SetColors(Color.blue, Color.blue);
			MovementBlue.SetPosition(0, StartPosBlue[i]);
		
		}
	}

}

// Update is called once per frame
void Update () {
	
	for (int i=0; i < RedPlayers.Length; i++){
		
		CurrentPosRed[i] = RedPlayers[i].transform.position;
		MovementRed.SetPosition(1, CurrentPosRed[i]);
		
	}
	for (int i=0; i < BluePlayers.Length; i++){
		
		CurrentPosBlue[i] = BluePlayers[i].transform.position;
		MovementBlue.SetPosition(1, CurrentPosBlue[i]);
		
	}
	
}

}
_
```*_

:frowning: come on i know you programmers laugh at this…

please someone? I haven’t got a clue whats wrong with the script…
i would at least expect my arrays to get filled with the spawned players, but even that fails… made them public to check and nothing happens.
btw i have the script on a empty GO in the scene called movementDebugging

Ok stupid of me the playersarray didn’t get filled because i tried to do it in Start and my players aren’t spawned yet then.
I problem solved.
Next problem is i can get my startPos array resized to the size of my players array.

Got the feeling I m talking to myself :wink: or Im uber bumping my own thread lolz

I recomend you use javaScript. Is simplier and more direct. C# requiers a better understanding of programing.

So using JavaScript you just do playerArray.push (newplayer). (this is a general example, newplayer could be whatever type you want)
As for the trail render you can just turn it on and off by checking if a key is press down and if the networkview belongs to you (the user). Then the trail will render locally.

hey Gabo thanks.
i know but I’m trying to learn C# thats why i try :wink:
thanks for the tip, I was thinking of doing it with line renderer, take my player start position and a current position, where my start possition gets updated to the previous current position and so on, but i guess I’ll try to make something working with the trail renderer first as you suggested.

It’s strange not more people worked on Heatmaps for unity… or i can’t find it at least.