Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Begginer questions
#10
Thanks for all your help Wink You are the best!

I don't understand this method very well, but I created simple custom controller:

Code:
public class EnemyWagonController : SplineController
{
private float _tfValue;
private int _direction = 1;

void Awake()
{
Vector3 nearestPoint;
_tfValue = Spline.GetNearestPointTF (transform.localPosition, out nearestPoint);
transform.localPosition = nearestPoint;
}

public override void Refresh ()
{
Move ();
}

void Move()
{
Vector3 nearestPoint;
_tfValue = Spline.GetNearestPointTF (transform.localPosition, out nearestPoint);
transform.localPosition = Spline.MoveByLengthFast (ref _tfValue, ref _direction, 2f, CurvyClamping.PingPong);
}
}

And I assume MoveByLengthFast(ref float tf, ref int direction, float distance, CurvyClamping clamping) distance is speed, but how can I track my controller reached target distance? Wink

Sorry for my stupid questions.
Reply


Messages In This Thread
Begginer questions - by Szagi - 03-18-2016, 03:55 PM
RE: Begginer questions - by Jake - 03-18-2016, 08:30 PM
RE: Begginer questions - by Szagi - 03-21-2016, 10:07 AM
RE: Begginer questions - by wollong - 03-22-2016, 02:13 AM
RE: Begginer questions - by Jake - 03-22-2016, 10:14 PM
RE: Begginer questions - by Szagi - 04-01-2016, 08:15 PM
RE: Begginer questions - by Jake - 04-03-2016, 08:44 AM
RE: Begginer questions - by Szagi - 06-01-2016, 07:29 AM
RE: Begginer questions - by Jake - 06-04-2016, 02:14 PM
RE: Begginer questions - by Szagi - 06-06-2016, 06:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Scene 51 questions lukasynthetic 3 12 06-22-2022, 04:12 AM
Last Post: _Aka_
  Spline editing questions giollord 5 150 12-04-2021, 02:24 PM
Last Post: _Aka_
  Questions about Generator: mesh/objects within spline, snap to control point dartboard 5 1,261 06-09-2021, 12:42 PM
Last Post: _Aka_
  Controller speed questions Lupp_ 6 1,863 01-20-2021, 09:20 PM
Last Post: _Aka_

Forum Jump: