Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Curvy Physics Disconnects on Mobile
#1
I'm away from my Home Pc, where I'm doing all of my Unity / Curvy Dev. But I compiled a version using a derivative of the Rigid Body Curvy Controller, and I got  it to work on PC, but every so often it would stop, and not continue pushing the object down the spline path. When I go on Android, it doesn't push the object at all, yet other scripts influencing the objects and other RigidBodies work fine. 

Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FluffyUnderware.Curvy;

public class SplineFlow : MonoBehaviour {
   public CurvySpline Spline;
   private Vector3 position;
   // Use this for initialization
   public float VSpeed, HSpeed, CenterDrag;
   float mTF;
   public Rigidbody mRigidBody;
   void Awake ()
   {
       mRigidBody = gameObject.GetComponent<Rigidbody>();
   }
   void Start () {

   }

   void FixedUpdate()
   {
       if (Spline)
       {
           var v = Input.GetAxis("Vertical") * VSpeed;            

           Vector3 p;
           // get nearest TF and point on spline
           mTF = Spline.GetNearestPointTF(transform.localPosition, out p);
           // apply forward thrust along spline direction (tangent)
           if (v != 0)
           {
               mRigidBody.AddForce(Spline.GetTangentFast(mTF) * v, ForceMode.Force);
           }
           
           
           // continously drag toward the spline to add some magic gravity
           mRigidBody.AddForce((Spline.Interpolate(mTF) - transform.localPosition) * CenterDrag, ForceMode.VelocityChange);
       }
   }
}
Reply
#2
Hi,
What version of Curvy do you use?
I am not familiar with Unity on Android, but could it be that the "Vertical" axis is not defined there?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
(06-21-2018, 08:59 PM)_Aka_ Wrote: Hi,
What version of Curvy do you use?
I am not familiar with Unity on Android, but could it be that the "Vertical" axis is not defined there?

It's a 3D Application, just has some performance limits running on a mobile platform.
Windows 10 (10.0.0) 64bit
Curvy 2.3.0
2017.4.4f1

(06-22-2018, 02:21 AM)dcrosby Wrote:
(06-21-2018, 08:59 PM)_Aka_ Wrote: Hi,
What version of Curvy do you use?
I am not familiar with Unity on Android, but could it be that the "Vertical" axis is not defined there?

It's a 3D Application, just has some performance limits running on a mobile platform.
Windows 10  (10.0.0) 64bit
Curvy 2.3.0
2017.4.4f1

I think I figured it out... because I used touch
var v = Input.GetAxis("Vertical") * VSpeed; 
Wasn't doing anything because the axis weren't mapped.... I made a mistake, sorry...  Wink
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Curvy 4.1.1 is live _Aka_ 0 72 10-15-2018, 12:54 PM
Last Post: _Aka_
Question Curvy 4.1.0 is live _Aka_ 0 74 10-09-2018, 04:06 PM
Last Post: _Aka_
Information Curvy 4.0.1 is live _Aka_ 2 198 09-17-2018, 11:09 AM
Last Post: _Aka_
Information Curvy 4.0.0 is live _Aka_ 0 151 09-07-2018, 02:07 PM
Last Post: _Aka_

Forum Jump: