Hi,
Im trying to get on trigger (after contact with object) speed change to work by comparing API abilty but won't seem to funtion for some reason as below:
Im trying to get on trigger (after contact with object) speed change to work by comparing API abilty but won't seem to funtion for some reason as below:
Code:
using UnityEngine;// note this is just an experiment before script below
using Opsive.UltimateCharacterController.Character.Abilities;//new
using Opsive.UltimateCharacterController.Character;
public class Shoespeed :Ability// Experiment
{
[Tooltip("Your character title goes here")]//
[SerializeField] protected GameObject m_Character;//
public override void OnTriggerEnter(Collider other)//
{
if (other.tag == "Shoespeed") // character makes contact with a pair of shoes assigning new shoes to player through another script on shoes then speed should alter here
{
var characterLocomotion = m_Character.GetComponent<UltimateCharacterLocomotion>();
var speedAbility = characterLocomotion.GetAbility<SpeedChange>(35);// just a guess here?
//GetComponent<UltimateCharacterLocomotion>().MotorAcceleration.z.Equals(80);// wont work this way
//GetComponent<UltimateCharacterLocomotion>().MotorAcceleration.x.Equals(80);// wont work this way
characterLocomotion.TryStartAbility(speedAbility);
}
}
}
Last edited: