How do I add sideways force through animation events?

zoicelols

Member
This is how I add forward and backward force to my character through animation events. I can't seem to figure out how to add left and right force to my character though. I have the combat movement type active so I am always facing forward.

This is my code for forward and backward.

Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Opsive.UltimateCharacterController.Character.Abilities;
using Opsive.UltimateCharacterController.Character.Abilities.Items;
using Opsive.UltimateCharacterController.Game;
using Opsive.UltimateCharacterController.Events;
using Opsive.UltimateCharacterController.Input;
using Opsive.UltimateCharacterController.StateSystem;
using Opsive.UltimateCharacterController.Utility;
using Opsive.UltimateCharacterController.Character;

public class AddForceAnimationEvent : MonoBehaviour
{
    
  
    public int thrust;
    public Transform Transform;

    private UltimateCharacterLocomotion rb;

    void Start()
    {
        rb = GetComponent<UltimateCharacterLocomotion>();
    }


    public void ForceForwardEvent(string F)
    {
        
         rb.AddForce(Transform.forward * thrust);

    }

    
}
 
Top