Search Unity

[RELEASED] Ultimate spline solution

Discussion in 'Assets and Asset Store' started by Raed_Abdullah, Aug 5, 2014.

  1. Raed_Abdullah

    Raed_Abdullah

    Joined:
    Aug 5, 2014
    Posts:
    50
    mmm That's kinda weird actually,, it works fine with me (using the latest version)
    you can always use the alternate way by shift + D
     
  2. armadea

    armadea

    Joined:
    May 27, 2016
    Posts:
    1
    Hi there,

    Not sure if this thread is still monitored, but I can't seem to make it work. I installed it through Unity, the UI appears, the object as well as the preferences panel, but I can't create a point no matter what. CTL triggers the "magnifier" icon on my cursor. I'm using Unity 5.3.5 on OSX Mountain Lion, if that helps.

    Let me know if you need any further info on my end. Thank you for your time!
     
    Last edited: Aug 23, 2016
  3. DavidSmit

    DavidSmit

    Joined:
    Apr 1, 2014
    Posts:
    50
    Same here, I get an error, that 'AcceptDrag is not allowed to be called from a ScriptableObject'
    Is this plugin still supported?
     
  4. joferjoe

    joferjoe

    Joined:
    Feb 2, 2016
    Posts:
    95

    it has been an issue for months so I'm guessing he stopped supporting it, but commenting out
    //DragAndDrop.AcceptDrag();
    //DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
    gets rid of the errors :)
     
  5. pencilking2002

    pencilking2002

    Joined:
    Sep 30, 2013
    Posts:
    23
    Hi @Raed_Abdullah. I'm trying to have my player go up and down a spline based on player input. Perhaps I am doing something wrong but after trying this for a whole day I can't get it to work. The player can go up (non reverse way) but as soon as I try to reverse the path everything breaks and the player stops moving, sometimes he jerks a bit and then stops moving completely. Here's my code so far:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using SplineTool;
    5.  
    6. public class TestPlayerRailMove : MonoBehaviour {
    7.    
    8.     public FollowSpline followSpline;
    9.        public float moveSpeed = 5.0f;
    10.      private float origMoveSpeed;
    11.  
    12.     private Rigidbody rb;
    13.  
    14.     private void Awake()
    15.     {
    16.         followSpline = GetComponent<FollowSpline>();
    17.         rb = GetComponent<Rigidbody>();
    18.         origMoveSpeed = moveSpeed;
    19.     }
    20.  
    21.     void FixedUpdate()
    22.     {
    23.  
    24.         // Goin up the path
    25.         if (Input.GetKey(KeyCode.UpArrow))
    26.         {
    27.             followSpline.reverse = false;
    28.             moveSpeed = origMoveSpeed;
    29.         }
    30.         // Going in reverse
    31.         else if (Input.GetKey(KeyCode.DownArrow))
    32.         {
    33.             followSpline.reverse = true;
    34.             moveSpeed = origMoveSpeed;
    35.  
    36.         }
    37.         else
    38.         {
    39.             moveSpeed = 0;
    40.         }
    41.  
    42.     }
    43.  
    44.     /// <summary>
    45.     /// Moving along the spline
    46.     /// </summary>
    47.     /// <param name="pos">target position this object will move to</param>
    48.     public void Move(Vector3 pos)
    49.     {
    50.  
    51.         transform.forward = (pos-transform.position).normalized;
    52.  
    53.         var targetPos = Vector3.Lerp(rb.position, pos, moveSpeed * Time.fixedDeltaTime);
    54.         rb.MovePosition(targetPos);
    55.  
    56.         // Make sure player's x rotation stays constant
    57.         transform.localEulerAngles = new Vector3(0, transform.localEulerAngles.y, transform.localEulerAngles.z);
    58.     }
    59. }
    60.  
     
  6. SIV

    SIV

    Joined:
    May 7, 2014
    Posts:
    219
  7. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    I just tried to port some code I made in a much older version of Unity to the newest version. This code included several references to the Spline Tools, so I installed the latest version into this project as well.
    But I get these compile errors:

    Code (CSharp):
    1. Assets\Spline Tools\Editor\SplinePreferences.cs(30,10): warning CS0618: 'PreferenceItem' is obsolete: '[PreferenceItem] is deprecated. Use [SettingsProvider] instead.'
    2.  
    Code (CSharp):
    1. Assets\Spline Tools\Editor\SplineAssetEditor.cs(15,13): warning CS0618: 'SceneView.onSceneGUIDelegate' is obsolete: 'onSceneGUIDelegate has been deprecated. Use duringSceneGui instead.'
    2.  
    And then my scripts give an error stating that the type or namespace name 'SplineWindow' could not be found, as well as any of the other Spline Tools scripts. This one has me particularly confused, because those scripts DO exist; i see them in the asset folder. I have no idea why Unity can't recognize them as scripts and therefore they are types I can use.

    Help?