Jump to content
  • entries
    9
  • comments
    38
  • views
    9,633

Record Camera/Object Path Movement Script


tipforeveryone

2,581 views

 Share

Visit forum topic here: http://www.leadwerks.com/werkspace/topic/15171-record-cameraobject-path-movement-script

Features

- Record camera path movement by controlling camera itself, what you see is what you get wink.png
- Path information can be saved to sperated file for later use
- Attach saved path file to any entity to playback recorded path
- Camera movement can be adjusted for smooth and better path record
- Great for cut scene or object with motion.

Demo

What I did in this demo:

- Record the first path and save it to path1.lua
- Record the second path and save it to path2.lua
- Create a small box then attach each of saved path files
- Attach path1.lua to Pivot, attach path2.lua to box, watch their combination

How to use

- Download and extract 2 lua files to anywhere in your project folder, example: Scripts/Recorder
- Create a Pivot in your map then attach PlayerControl-PrototypeB.lua  to it
- Create a lua file then choose it as" Record File" in Script tab of the pivot (This is required!)
- Run the game
- Press to start/stop record
- Press to playback recorded path
- Press Esc to exit
- Create an entity, ex: a box. Attach ObjectPathMovement.lua to it
- Choose saved record file (This is required!)
- Run the game
- Press to start playback recorded path for the entity

Other attributes explaination

PlayerControl-PrototypeB.lua

Playback Start: Execute playback process right after the game start, using data from choosen record fil
Clean Screen: Hide all HUD elements while playback
Both Playback Start and Clean Screen are good for cutscene camera
Focus Object: Drag any entity which you want camera to point at while moving, this will ignore recorded rotation of camera.

ObjectPathMovement.lua

Play Rotation: if this is false, entity will ignore recorded rotation

ObjectPathMovement.lua

PlayerControl-PrototypeB.lua

  • Upvote 4
 Share

2 Comments


Recommended Comments

I must have missed this at the time. This is very cool! I'll have to check out the path file generated because it would be cool to be able to add events at certain points throughout the path.

  • Thanks 1
Link to comment
14 hours ago, Rick said:

I must have missed this at the time. This is very cool! I'll have to check out the path file generated because it would be cool to be able to add events at certain points throughout the path.

I have plan to improve this too after that time, the disadvatage of this code is you mush record everything again if making mistakes :(

Link to comment
Guest
Add a comment...

×   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.

×
×
  • Create New...