Nope for now.. my project is busy by reloading all asset ..
But if i find a way whit your coding indication i will share it ..
If someone have it working and share it..
i will share whit you a very big object selection, will make you make a great game in a short time : )
How to spam different bot models ?
- MAC
- Contributor
- Posts: 95
- Joined: Sun May 27, 2018 7:59 am
- Contact:
MFPS on HDRP --) https://ka2studio.net/
- MAC
- Contributor
- Posts: 95
- Joined: Sun May 27, 2018 7:59 am
- Contact:
Hello well, for now i don't get better result.. x)killa187 wrote: ↑Thu Jun 25, 2020 5:30 pm
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System;
public class LoadOutSwitch : MonoBehaviour
{
// Start is called before the first frame update
public bl_AIShooterAgent[] bots;
public bool h = false;
// Start is called before the first frame update
void Start()
{
int b1 = (int)UnityEngine.Random.Range(0f, bots.Length);
int b2 = (int)UnityEngine.Random.Range(0f, bots.Length);
bl_AIShooterAgent oldBot = bl_GameData.Instance.BotTeam1;
bl_AIShooterAgent oldBot2 = bl_GameData.Instance.BotTeam2;
bl_GameData.Instance.BotTeam1 = bots[b1];
bl_GameData.Instance.BotTeam2 = bots[b2];
}
// Update is called once per frame
void Update()
{
}
}
Its change the models on starting game, load value news in gamedata but its not cycling the models and its using only the first one in the list.
I'll made anothers try later..
MFPS on HDRP --) https://ka2studio.net/
- MAC
- Contributor
- Posts: 95
- Joined: Sun May 27, 2018 7:59 am
- Contact:
Well i splited in 2 the script for the 2 teams .
So you can spam differents models for each team and you can use the first for the ffa or dm
I make it working whit the update function .. i know its not the right solution.. but it's working.
so it need to be updated in the start function idk whit a timer or a coroutine..
Team 1 :
Team 2 :
So you can spam differents models for each team and you can use the first for the ffa or dm
I make it working whit the update function .. i know its not the right solution.. but it's working.
so it need to be updated in the start function idk whit a timer or a coroutine..
Team 1 :
Code: Select all
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System;
public class LoadOutSwitch : MonoBehaviour
{
// Start is called before the first frame update
public bl_AIShooterAgent[] bots;
public bool h = false;
// Start is called before the first frame update
void Start()
{
int b1 = (int)UnityEngine.Random.Range(0f, bots.Length);
bl_AIShooterAgent oldBot = bl_GameData.Instance.BotTeam1;
bl_GameData.Instance.BotTeam1 = bots[b1];
}
// Update is called once per frame
void Update()
{
int b1 = (int)UnityEngine.Random.Range(0f, bots.Length);
bl_AIShooterAgent oldBot = bl_GameData.Instance.BotTeam1;
bl_GameData.Instance.BotTeam1 = bots[b1];
}
}
Team 2 :
Code: Select all
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System;
public class LoadOutSwitch1 : MonoBehaviour
{
// Start is called before the first frame update
public bl_AIShooterAgent[] bots;
public bool h = false;
// Start is called before the first frame update
void Start()
{
int b2 = (int)UnityEngine.Random.Range(0f, bots.Length);
bl_AIShooterAgent oldBot2 = bl_GameData.Instance.BotTeam2;
bl_GameData.Instance.BotTeam2 = bots[b2];
}
// Update is called once per frame
void Update()
{
int b2 = (int)UnityEngine.Random.Range(0f, bots.Length);
bl_AIShooterAgent oldBot2 = bl_GameData.Instance.BotTeam2;
bl_GameData.Instance.BotTeam2 = bots[b2];
}
}
MFPS on HDRP --) https://ka2studio.net/
- MAC
- Contributor
- Posts: 95
- Joined: Sun May 27, 2018 7:59 am
- Contact:
Hello,
Well finaly i fixed it..
So 2 script, LoadOutSwitch for team1 and LoadOutSwitch1 for team 2.
It's spawn differents bot model whit a timer fixed to 10 sec.
You can add it on your Spawn prefab or on another:
Team 1 :
Code: Select all
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System;
public class LoadOutSwitch : MonoBehaviour
{
// Start is called before the first frame update
public bl_AIShooterAgent[] bots;
public bool h = false;
public float switchTime = 10f;
// Start is called before the first frame update
void Start()
{
int b1 = (int)UnityEngine.Random.Range(0f, bots.Length);
bl_AIShooterAgent oldBot = bl_GameData.Instance.BotTeam1;
bl_GameData.Instance.BotTeam1 = bots[b1];
}
// Update is called once per frame
void Update()
{
{
switchTime -= Time.deltaTime;
if (switchTime < 0f)
{
int b1 = (int)UnityEngine.Random.Range(0f, bots.Length);
bl_AIShooterAgent oldBot = bl_GameData.Instance.BotTeam1;
bl_GameData.Instance.BotTeam1 = bots[b1];
switchTime = 10f;
}
}
}
}
Code: Select all
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System;
public class LoadOutSwitch1 : MonoBehaviour
{
// Start is called before the first frame update
public bl_AIShooterAgent[] bots;
public bool h = false;
public float switchTime = 10f;
// Start is called before the first frame update
void Start()
{
int b2 = (int)UnityEngine.Random.Range(0f, bots.Length);
bl_AIShooterAgent oldBot = bl_GameData.Instance.BotTeam2;
bl_GameData.Instance.BotTeam2 = bots[b2];
}
// Update is called once per frame
void Update()
{
{
switchTime -= Time.deltaTime;
if (switchTime < 0f)
{
int b2 = (int)UnityEngine.Random.Range(0f, bots.Length);
bl_AIShooterAgent oldBot = bl_GameData.Instance.BotTeam2;
bl_GameData.Instance.BotTeam2 = bots[b2];
switchTime = 10f;
}
}
}
}
MFPS on HDRP --) https://ka2studio.net/
- killa187
- Contributor
- Posts: 56
- Joined: Thu Apr 23, 2020 7:46 pm
that looks cool i was just about write another like that bit diff but i like that setup i just might use myself .one the other came from game is on google play store but it crashed in unity big time and so many diff assets to figure out quick the prob so redoing been busy with that. i still got keystore file google play would accept im sure i let them handle keystore if understand might not matter now if lose original but never tried lol so kept that.glad got working and i like its setup so i just might use in the one remaking nowMAC wrote: ↑Thu Jul 02, 2020 5:46 amHello,
Well finaly i fixed it..
So 2 script, LoadOutSwitch for team1 and LoadOutSwitch1 for team 2.
It's spawn differents bot model whit a timer fixed to 10 sec.
You can add it on your Spawn prefab or on another:
Team 1 :
Team 2 :Code: Select all
using UnityEngine; using Photon.Pun; using Photon.Realtime; using UnityEditor; using System.Collections; using System.Collections.Generic; using System; public class LoadOutSwitch : MonoBehaviour { // Start is called before the first frame update public bl_AIShooterAgent[] bots; public bool h = false; public float switchTime = 10f; // Start is called before the first frame update void Start() { int b1 = (int)UnityEngine.Random.Range(0f, bots.Length); bl_AIShooterAgent oldBot = bl_GameData.Instance.BotTeam1; bl_GameData.Instance.BotTeam1 = bots[b1]; } // Update is called once per frame void Update() { { switchTime -= Time.deltaTime; if (switchTime < 0f) { int b1 = (int)UnityEngine.Random.Range(0f, bots.Length); bl_AIShooterAgent oldBot = bl_GameData.Instance.BotTeam1; bl_GameData.Instance.BotTeam1 = bots[b1]; switchTime = 10f; } } } }
Thank to Killa for the base coding : )Code: Select all
using UnityEngine; using Photon.Pun; using Photon.Realtime; using UnityEditor; using System.Collections; using System.Collections.Generic; using System; public class LoadOutSwitch1 : MonoBehaviour { // Start is called before the first frame update public bl_AIShooterAgent[] bots; public bool h = false; public float switchTime = 10f; // Start is called before the first frame update void Start() { int b2 = (int)UnityEngine.Random.Range(0f, bots.Length); bl_AIShooterAgent oldBot = bl_GameData.Instance.BotTeam2; bl_GameData.Instance.BotTeam2 = bots[b2]; } // Update is called once per frame void Update() { { switchTime -= Time.deltaTime; if (switchTime < 0f) { int b2 = (int)UnityEngine.Random.Range(0f, bots.Length); bl_AIShooterAgent oldBot = bl_GameData.Instance.BotTeam2; bl_GameData.Instance.BotTeam2 = bots[b2]; switchTime = 10f; } } } }