Jump to content

Smooth Moving


fumanshoo
 Share

Recommended Posts

So just as a test so that I can better understand the Curve function, I have a character and a box. When ever the character gets less than two units from the cube, the cube moves one unit to the right and one unit forward ( diagonally ). I don't fully understand how to implement a curve function from Aggror's tutorial on YouTube, so I was wondering of you guys could help out... my goal here is to make the cube move smoothly and diagonally... here's the code:

 

box = CreateCube()
box:SetPosition(Vec3(5,.5,0))
steamPunk = LoadModel("abstract::steam punk.gmf")
steamPunk:SetPosition(Vec3(0,0,0))
steamPunk:SetRotation(Vec3(0,180,0))
steamPunk:SetScale(Vec3(.6,.6,.6))
steamPunk:SetParent(controller)
if EntityDistance(controller,box) <2 then
 MoveEntity(box,Vec3(1,0,1))
end

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...