How do I make an actor float.
iDeveloperz
Member Posts: 1,169
Sorry for being a bit vague but how would I make say a button float so it is always moving in the same spot.
Like a fish in a water.
Like a fish in a water.
Comments
Is it a tutorial or a how to?
Has anybody else here done this before?
constrain attribute : self X to sin( self.Time * "speed" ) * pixels to move + starting positionX
speed - any integer
pixels to move - any integer - for example if you put 30 the actor will go 30 to the right and 30 to the left , so the total movement will be 60 pixels wide.
starting positionX - the initial X value of the actor in the scene (do not use self.x)
this will make the actor to move left and right !
if you want to add a little up and down to imitate float do this for the Y :
constrain self.Y to sin( self.Position.X * speed)*pixels to move+ starting position Y
here instead of using self.time we use self.x because self.time will make the actor go in an angle .
i suggest to put a small number in speed here to make a float
hope it helps