You want to enable and disable objects based on what stance and what move the character is doing?
I can add that sometime.
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 → Posts by FreedTerror
You want to enable and disable objects based on what stance and what move the character is doing?
I can add that sometime.
You can take a look at this post: https://www.ufe3d.com/forum/viewtopic.p … 305#p16305
It boils down to enabling and disabling gameobjects based on what stance the character is in.
using System.Collections.Generic;
using UFE3D;
using UnityEngine;
public class NewBehaviourScript1 : MonoBehaviour
{
private ControlsScript controlsScript;
[System.Serializable]
public class Options
{
public CombatStances[] combatStances;
public GameObject[] disableGameObjects;
public GameObject[] enableGameObjects;
}
public Options[] options;
private void Start()
{
controlsScript = GetComponentInParent<ControlsScript>();
}
private void Update()
{
if (controlsScript != null)
{
for (int i = 0; i < options.Length; i++)
{
for (int j = 0; j < options[i].combatStances.Length; j++)
{
if (controlsScript.MoveSet.currentCombatStance == options[i].combatStances[j])
{
SetGameObjectActive(options[i].disableGameObjects, false);
SetGameObjectActive(options[i].enableGameObjects, true);
}
}
}
}
}
#region GameObject Methods
public static void SetGameObjectActive(GameObject[] gameObject, bool active)
{
if (gameObject == null)
{
return;
}
int length = gameObject.Length;
for (int i = 0; i < length; i++)
{
var item = gameObject[i];
if (item == null)
{
continue;
}
item.SetActive(active);
}
}
public static void SetGameObjectActive(List<GameObject> gameObject, bool active)
{
if (gameObject == null)
{
return;
}
int count = gameObject.Count;
for (int i = 0; i < count; i++)
{
var item = gameObject[i];
if (item == null)
{
continue;
}
item.SetActive(active);
}
}
#endregion
}
Sure thing. I'll edit my post when I can.
You need to use the 3D arena template.
It sounds like you used the 3D fighter template.
Here's a link that might help
https://learn.microsoft.com/en-us/visua … ts=windows
UFE 2 doesn't have tag team out of the box.
UFE 3 is functional, but isn't currently being worked on.
Hmm, the id is used in a bunch of areas in the code.
I don't fully understand how the id's work either.
Probably just best to keep an eye out in your project if anything strange happens as a result of this change.
Yes it's possible.
To do it right would be quite a bit of work I'd imagine.
UFE 2 isn't setup to handle items smash bros style.
You could use the stance system to handle transformations.
I'm really not sure why the first issue is happening.
I can confirm the issue with the custom hit clips.
I can't really say when the next patch will be released.
If we find a solution for the custom hit clip issue I might be able to share the code for it.
First Issue:
Not sure why your getting results like that.
Enable the debugger. I need to see the frame data at runtime.
Second Issue:
Your saying that the custom hit clips don't produce the expected results?
I'll have to test this to verify.
It doesn't really matter where you put this code, it targets both players.
I'll have to investigate more if this doesn't work.
I just glanced at the gauge code and found a couple variables of interest.
Let me know if this works for you.
using FPLibrary;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
private void OnEnable()
{
UFE.OnRoundEnds += OnRoundEnds;
}
private void OnDisable()
{
UFE.OnRoundEnds -= OnRoundEnds;
}
private void OnRoundEnds(ControlsScript winner, ControlsScript loser)
{
UFE.p1ControlsScript.gaugeDPS = (Fix64)0;
UFE.p1ControlsScript.inhibitGainWhileDraining = false;
UFE.p2ControlsScript.gaugeDPS = (Fix64)0;
UFE.p2ControlsScript.inhibitGainWhileDraining = false;
}
}
Stamina system: Custom script needed.
Slowing down character movement speed, animation speed and damage: This is probably going to be tricky but, the variables that controls those can be accessed. If you want to have multiplayer support with this, you will likely need the source version and implement those variables with the rollback system. Variables that affect gameplay and can change during runtime need to be implemented properly with rollback in mind.
You might have a Y force being applied on one of your hits on block.
Set Apply Different Block Force to true.
Set the Y Force to 0.
If you can get me a video of the issue I could better assist you.
I don't think I understand the issue you're facing.
You can look into Jump Options
Here's one way to do it
Create an empty GameObject
Create Animation
Assign the Animator Controller to an Animator component.
It's possible.
Are you trying to loop a sprite based animation?
By Z-Index do you mean sorting order?
The script has a variable you set in the inspector.
This might work.
You can call this method from anywhere at anytime.
public static void MaybeStopAllUFECameraShakes()
{
List<ControlsScript> controlsScriptList = UFE.GetAllControlsScripts();
if (controlsScriptList == null)
{
return;
}
int count = controlsScriptList.Count;
for (int i = 0; i < count; i++)
{
if (controlsScriptList[i] == null)
{
continue;
}
controlsScriptList[i].shakeCameraDensity = 0;
}
}
I threw this together, it should work.
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
//Attach to your character prefab
private ControlsScript myControlsScript;
[SerializeField]
private int spriteRendererSortingOrder;
private void Start()
{
myControlsScript = GetComponentInParent<ControlsScript>();
}
private void Update()
{
UpdateSpriteRenderer();
}
private void UpdateSpriteRenderer()
{
if (myControlsScript == null
|| myControlsScript.mySpriteRenderer == null)
{
return;
}
if (myControlsScript.currentBasicMove == BasicMoveReference.Idle)
{
myControlsScript.mySpriteRenderer.sortingOrder = spriteRendererSortingOrder;
}
}
}
Using move files this is doable.
Out of the box UFE 2 doesn't have air control for jumps like smash bros.
Enable the Update when offscreen option in the Skinned Mesh Renderer component to see if it helps
Universal Fighting Engine Forum → Posts by FreedTerror
Powered by PunBB, supported by Informer Technologies, Inc.