Hi,

Basically, what I'm trying to do is get an object to move vertically up the screen in a nice cos wave motion, swaying back and forth.

At the moment I have it just going straight up and it looks alright but I think the wave would add another level to it.

I have absolutely no idea how to do this and from what I've seen when looking around there isn't many people/anyone else trying to do the same thing.

public void verticalSwimBehaviour()
{


Vector3 tokenPosition = this.PossessedToken.Position; //get the current position of the fish and assign it to tokenPosition variable
tokenPosition.Y = tokenPosition.Y + ySpeed * mFacingDirection;
if (tokenPosition.Y == 400)
{
tokenPosition.Y = 0;
}
this.PossessedToken.Position = tokenPosition; // assign the new position based on above calculation back to the fish position}
}

This takes a vector which is the current position of the fish and make it go vertically by multiplying it by the speed value and the facing direction which decides if it's going up or down.

As I mentioned before. I have no idea how to turn this into a cos wave.

Help!

Thanks.