Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spawning Controller Prefab with Matched Spline Prefab Using Pool Manager
#7
Ok, using instantiate() instead of pool manager has worked. But i want to use pool manager.

When i use pool manager, i get this error at the beginning.

IndexOutOfRangeException: Array index is out of range.
FluffyUnderware.Curvy.CurvySplineSegment.GetOrientationUpFast (Single localF) (at Assets/Packages/Curvy/Base/CurvySplineSegment.cs:1974)
FluffyUnderware.Curvy.CurvySpline.GetOrientationUpFast (Single tf) (at Assets/Packages/Curvy/Base/CurvySpline.cs:953)
FluffyUnderware.Curvy.Controllers.SplineController.getInterpolatedSourcePosition (FluffyUnderware.Curvy.CurvySplineBase spline, Single tf, UnityEngine.Vector3& position, UnityEngine.Vector3& tangent, UnityEngine.Vector3& up) (at Assets/Packages/Curvy/Controllers/SplineController.cs:566)
FluffyUnderware.Curvy.Controllers.SplineController.GetInterpolatedSourcePosition (Single tf, UnityEngine.Vector3& position, UnityEngine.Vector3& tangent, UnityEngine.Vector3& up) (at Assets/Packages/Curvy/Controllers/SplineController.cs:378)
FluffyUnderware.Curvy.CurvyController.applyPositionAndRotation (Single tf) (at Assets/Packages/Curvy/Base/CurvyController.cs:1142)
FluffyUnderware.Curvy.CurvyController.Prepare () (at Assets/Packages/Curvy/Base/CurvyController.cs:712)
FluffyUnderware.Curvy.Controllers.SplineController.Prepare () (at Assets/Packages/Curvy/Controllers/SplineController.cs:241)
FluffyUnderware.Curvy.CurvyController.OnValidate () (at Assets/Packages/Curvy/Base/CurvyController.cs:636)
FluffyUnderware.Curvy.Controllers.SplineController.OnValidate () (at Assets/Packages/Curvy/Controllers/SplineController.cs:220)

Latest trigger script:
 
Code:
using UnityEngine;
using System.Collections;
using PathologicalGames;
using FluffyUnderware.Curvy.Controllers;

public class TriggerScript : MonoBehaviour {
   public GameObject enemy;
   public FluffyUnderware.Curvy.CurvySpline curvySpline;
   private SplineController sc;
   private int count = 0;

   void Start()
   {
       
   }
   void OnTriggerEnter(Collider other)
   {
       Debug.Log("Triggered.");
       sc = enemy.GetComponent<SplineController>();
       sc.Spline = curvySpline;
       Debug.Log(curvySpline);

       Enemy1Create();
   }

   void Enemy1Create()
   {
       curvySpline.Refresh();
       sc.Play();
       //Pool.Instance.Activate(0, Vector3.zero, Quaternion.identity);
       //Instantiate(enemy, Vector3.zero, Quaternion.identity);
       PoolManager.Pools["EnemyPool"].Spawn(enemy);

       Debug.Log(sc.IsInitialized);
       count++;
       if (count < 3)
           Invoke("Enemy1Create", 0.7f);
   }
}
Reply


Messages In This Thread
RE: Spawning Controller Prefab with Matched Spline Prefab Using Pool Manager - by Kerkenez - 03-26-2016, 11:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_

Forum Jump: