Hi,
When assigning the target (Player) and the Camera, can someone tell me what to use for each?
For example in MFPS 2.0 what is the PLAYER and the CAMERA that follows the player? I also need to know these for other Assets such as Enviro where it asks for the same.
Thanks!
UGUI Minimap help!
Forum rules
To request support/assistance for MFPS, you first have to verify your purchase by sending your purchase invoice number to Lovatto in a PM.
To request support/assistance for MFPS, you first have to verify your purchase by sending your purchase invoice number to Lovatto in a PM.
- Lovatto
- Admin
- Posts: 1834
- Joined: Sun Dec 07, 2014 3:18 pm
- Contact:
Player are instantiate in runtime, each time that respawn, so you need get it when it's instantiate by script, for this you can use the 'bl_EventHandler.OnLocalPlayerSpawn' this event is called each time that the local player is instantiate, you can use like this:
Code: Select all
private void OnEnable()
{
bl_EventHandler.OnLocalPlayerSpawn += OnLocaSpawn;
}
private void OnDisable()
{
bl_EventHandler.OnLocalPlayerSpawn -= OnLocaSpawn;
}
void OnLocaSpawn()
{
bl_GameManager GameManager = FindObjectOfType<bl_GameManager>();
if (GameManager == null)
return;
Player = GameManager.OurPlayer;
}
- ArtandGaming
- New Member
- Posts: 9
- Joined: Tue Feb 20, 2018 2:43 am
What script do I enter this code into?Lovatto wrote:Player are instantiate in runtime, each time that respawn, so you need get it when it's instantiate by script, for this you can use the 'bl_EventHandler.OnLocalPlayerSpawn' this event is called each time that the local player is instantiate, you can use like this:Code: Select all
private void OnEnable() { bl_EventHandler.OnLocalPlayerSpawn += OnLocaSpawn; } private void OnDisable() { bl_EventHandler.OnLocalPlayerSpawn -= OnLocaSpawn; } void OnLocaSpawn() { bl_GameManager GameManager = FindObjectOfType<bl_GameManager>(); if (GameManager == null) return; Player = GameManager.OurPlayer; }
Also, is "OnLocaSpawn" supposed to be "OnLocalSpawn"? Or does it really matter?
- ArtandGaming
- New Member
- Posts: 9
- Joined: Tue Feb 20, 2018 2:43 am
Also, would I be right in thinking after entering this code it will create an "player" object that I can use for the options I mentioned above?Lovatto wrote:Player are instantiate in runtime, each time that respawn, so you need get it when it's instantiate by script, for this you can use the 'bl_EventHandler.OnLocalPlayerSpawn' this event is called each time that the local player is instantiate, you can use like this:Code: Select all
private void OnEnable() { bl_EventHandler.OnLocalPlayerSpawn += OnLocaSpawn; } private void OnDisable() { bl_EventHandler.OnLocalPlayerSpawn -= OnLocaSpawn; } void OnLocaSpawn() { bl_GameManager GameManager = FindObjectOfType<bl_GameManager>(); if (GameManager == null) return; Player = GameManager.OurPlayer; }
Apologies for my lack of coding knowledge, I'm and artist not a programmer
- ozonostudio
- Member
- Posts: 18
- Joined: Fri May 11, 2018 1:46 pm
Not sure If I should buy the minimal I see a lot of questions but no answers since the past year