Pages 1
Universal Fighting Engine Forum We are no longer using the forum to answer questions due to bot attacks. Please use our discord instead: https://discord.gg/hGMZhF7 |
You are not logged in. Please login or register.
Universal Fighting Engine Forum → Tips & Articles → Character follows another
Im actually trying to do this as well.
Currently no way to do it without coding changes.
Its possible to have the dog just appear as an assist to do his attacks. But having him always on the field isnt currently possible
Should should I ask about this on the Source Coding page?
Would probably get more traction there.
Id probably figure it out if id source and was working on that particular character but im not even close
Hello.
If you have the Source-Version, it's very easy to add. You can simply read-out the player-variables and the positions of the players (see Documentation).
However, there is another way to add character-specific things, if you don't have access to U.F.E.-variables (I don't know how the basic-version works, so this solution is independent from all U.F.E.-variables). This solution might be "quick & dirty" but it works :
Let's say we want to add a dog following "Ethan" from the demo.
1. At first create or import your dog model. Create a Prefab from it.
2. Go to ressources/characters folder, select Ethan and open the Prefab. Add a new script and call it "Ethan":
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ethan : MonoBehaviour
{
public static Vector3 Ethan_Position;
public GameObject dogPrefab;
// Start is called before the first frame update
void Start()
{
Instantiate(dogPrefab, new Vector3(0.0f, 2.55f, 13.24f), transform.rotation);
}
// Update is called once per frame
void Update()
{
Ethan_Position = transform.position;
}
}
This script instantiates a clone of the dog-Prefab whenever an instance of Ethan is created. It also stores Ethan's current position in a global variable.
Now assign your dog-Prefab to the script (inspector window):
Finally open the dog-Prefab and add a new script called "dog":
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Dog : MonoBehaviour
{
Vector3 tempPos;
// Start is called before the first frame update
void Start()
{
tempPos = transform.position;
}
// Update is called once per frame
void Update()
{
if (transform.position.x > Ethan.Ethan_Position.x) { tempPos.x -= 0.04f; }
if (transform.position.x < Ethan.Ethan_Position.x) { tempPos.x += 0.04f; }
transform.position = tempPos;
}
}
This script updates the position of the dog according to Ethan's position.
That's how it looks like:
https://www.youtube.com/watch?v=7mDZHOP … e=youtu.be
My dog is a simple cube and a sphere.
This is only a quick start how you might include such things. You can put all the required things (animation controller, movement scripting etc...) into the dog-Prefab and code.
Of course you have to make sure, to destroy the clone after the fight and find a solution for dealing with player one and player two playing as Ethan.
shubi
Awesome script! How can I get the dog assist to attack the opponent after I press an input button?
Hey.
I think there is (or will be) some kind of built-in assist functionality in UFE. We don't use it, so I can't say how it works.
But you can do a lot of such things with simply reading out UFE global variables or create some work-arounds with particle-spawns etc. There are so may ways to implement interaction with background objects.
For example we modified our follow-me script to create a guy walking and filming with his phone:
Assists are built in now under the section Character Assist and there is and example in the Source version... maybe Pro as well???
Any suggestion on how to select your own assist character?
What do you mean? You can select the character in the assist move section
He means like select assist as a player.
Meaning every character can use said assist
Not just the ones who have it in move list
Yes, it would be nice to figure out how it can be done.
Any suggestion on how to select your own assist character?
It requires coding, and as such there's probably multiple ways you could probably do it.
One way off the top of my head is have an array of MoveInfo[] assigned to each assist selection on the character select, and then add that array to the playable selected character's MoveSet before the MoveSet is prepared on load once the battle starts.
Another way is to just have every possible assist added to each character, storing the selected assist character as a string on the character select, and adding logic to the Move Recognition method that determines which assist is allowed to be played in the match.
In another way, you honestly might even be able to use one of the event handlers in a script such as OnMove() which could allow you to implement the logic above about how to ignore any assist moves called that aren't of the assist selected on the character select.
Regardless, I think you should move your question to a new topic as it's different from the original post, and your reply may not be noticed by those who are willing to help further.
Universal Fighting Engine Forum → Tips & Articles → Character follows another
Powered by PunBB, supported by Informer Technologies, Inc.