hi guys, im looking to create a smooth camera tween which i asume would follow a spline/motion path. im not 100% sure how to do this… would i create a spline in maya? then create some sort of script to make the camera follow this path? thanks
make object attach camera to it and use this script works fine for me
public var waypoints : Transform[ ];
public var rate : int =20;
private var currentWaypoint : int = 0 ;
function OnDrawGizmos(){
iTween.DrawLine(waypoints,Color.blue);
}
function Start(){
moveToWaypoint();
}
function moveToWaypoint(){
//Time = Distance / Rate:
var travelTime = Vector3.Distance(transform.position, waypoints[currentWaypoint].position)/rate;
//iTween:
iTween.MoveTo(gameObject,{“position”:waypoints[currentWaypoint],“time”:travelTime,“easetype”:“linear”,“oncomplete”:“moveToWaypoint”,“Looktarget”:waypoints[currentWaypoint].position,“looktime”:.4});
//Move to next waypoint:
currentWaypoint++;
if(currentWaypoint>waypoints.Length-2){
currentWaypoint=0;
}
}
so, is this using waypoints? or is it following an object, sorry im quite confused with “make object attach” thanks!
I think it is saying:
- Make object
- Attach camera to it
- Use this script
why don’t u just animate an object in a 3D editor (Blender or 3DsMax) then export it as .FBX file, then link ur camera to it .
yea thats what i ment by creating a spline in maya… and create an object? so like if i create a cube adn attach it?