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 Splines, this helps immensely. Thank you.
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
  New User Looking for Advice on Choosing Curvy Splines ravigupta 1 396 08-21-2026, 09:45 PM
Last Post: _Aka_
  Physics Railway OJDee 3 1,277 03-27-2026, 10:29 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 7 7,724 07-13-2025, 07:11 PM
Last Post: _Aka_
  Invisible Gizmos In Latest Curvy Splines orrenravid1 1 2,035 06-11-2024, 07:36 AM
Last Post: _Aka_

Forum Jump: