Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Begginer questions
#3
Sorry for my bad explanation

1.) I didn't understood this well Sad Animate property can be use for this: my enemy moves for example 5 units, than stops, then change direction and moves 8 units? 

2.)  http://imgur.com/HAjeUPX vertical wall is my trigger which changes splines from down spline to upper spline, but this is a bit jumpy and I have no idea how can I do it smoother Sad

this is my code: 

Code:
void OnTriggerEnter(Collider other)
{
if(other.tag == "Player"){
PlayerSplineController wagon = other.GetComponent<PlayerController>().Wagon;

//TODO:  changing splines is good thing to move to SplineManager
if (wagon != null) {
_enterDirection = Mathf.Sign (wagon.Speed);
Vector3 nearestPoint;
float nearestPointTF;
Transform newParent;
CurvySpline newSpline;

if (direction && _enterDirection > 0 || !direction && _enterDirection < 0 ) {
nearestPointTF = nextSpline.GetNearestPointTF(transform.position,out nearestPoint,7,8);
newSpline = nextSpline;
newParent = nextSpline.transform;
} else {
nearestPointTF = prevSpline.GetNearestPointTF(transform.position,out nearestPoint,6,7);
newSpline = prevSpline;
newParent = prevSpline.transform;
}

wagon.SwitchTo(newSpline, nearestPointTF, 0);
wagon.transform.parent = newParent;
}
}
}
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: