UGUI Minimap help!

Support for MFPS 2.0 (for verified users)
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.
Post Reply
User avatar
ArtandGaming
New Member
New Member
Posts: 9
Joined: Tue Feb 20, 2018 2:43 am

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!
User avatar
Lovatto
Admin
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;
    }
How to find your Invoice Number: Here
How to find your Order Number: Here
User avatar
ArtandGaming
New Member
New Member
Posts: 9
Joined: Tue Feb 20, 2018 2:43 am

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;
    }
What script do I enter this code into?

Also, is "OnLocaSpawn" supposed to be "OnLocalSpawn"? Or does it really matter?
User avatar
ArtandGaming
New Member
New Member
Posts: 9
Joined: Tue Feb 20, 2018 2:43 am

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, 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?

Apologies for my lack of coding knowledge, I'm and artist not a programmer :lol:
User avatar
Oggy
Contributor
Contributor
Posts: 79
Joined: Fri Oct 13, 2017 2:53 am

Hi Lovatto, how to set up this function? :?:
Show Enemy location only when this are attacking / Firing.
User avatar
ozonostudio
Member
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
Post Reply