- Home /
Smooth motion for gesture based character controller
Hi there,
I´ve been trying to create a gesture based CharacterController using Omek MotionToolKit. Now that I´ve managed to get things up and running I´m starting to sand out the ruff edges on my scripts. My problem is that I need to get character move smoothly when triggered to move and I´ve tried bunch of things but due to my newbie coding skills I haven´t been able to figure it out and my character shifts from place to place instantly. Here´s my code:
using UnityEngine;
using System.Collections;
using OmekFramework.Beckon;
using OmekFramework.Beckon.Main;
using OmekFramework.Common.BasicTypes;
using OmekFramework.Beckon.Data;
using OmekFramework.Common.GeneralUtils;
using System.Collections.Generic;
using System.Runtime.InteropServices;
public class liike : MonoBehaviour {
public float speed = 5.0F;
public float gravity = 20.0F;
public Vector3 moveDirection = Vector3.zero;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
CharacterController controller = GetComponent<CharacterController>();
if (controller.isGrounded) {
moveDirection = transform.TransformDirection(Vector3.forward)*speed;
}
if (BeckonManager.BeckonInstance.Gestures.IsGestureActive("askelkavelyoik",0))
{
moveDirection.y -= gravity * Time.deltaTime;
controller.Move(moveDirection*Time.fixedDeltaTime);
}
}
}
So what approach would be best to get my CC moving smoothly in this case?
Your answer
Follow this Question
Related Questions
Kick with Kinect 1 Answer
Problems with VisualGestureBuilderFrameSource when adding a gesture 2 Answers
Shooting with get joint rotation .eulerAngles kinect 0 Answers
How to make a Running game with Microsoft Kinect Sensor 0 Answers
ClickOnKinect 1 Answer