CMZTECH.NET
  • Blog
  • Graphics
  • Virtual Reality
  • 3D Printing
  • Fun Stuff
  • Contact

Back in the Game (Dev Diary)

1/22/2015

1 Comment

 
Getting back to the game, I decided to add a simple feature this evening.  A simple bobbing motion to the camera so that it feels like the player is walking and not just floating across the landscape.
It's pretty easy to do, especially if you use a nice convenient curve like Cos or Sin.  The character controller even has a  function for getting distance traveled  (cc.velocity.magnitude).
So we can take these and scale them to make a function that adjusts the camera offset from the character controller to get a nice bobbing effect.

Which sounds like it would take about 10 minutes, but I confused myself about how character controllers work, read the documentation for the wrong method and then wasted an hour trying to figure out why my units were screwed up, when they were actually correct.  Problem exists between mouse and keyboard.

Bedtime!!





1 Comment
Alice Whitaker link
6/17/2022 01:51:12 pm

Interesting

Reply



Leave a Reply.

    David Coombes

    Making stuff

    Categories

    All
    3D Graphics
    3D Printing
    3D Scanning
    AI
    Blender
    Cycling
    Development
    Environment
    Futurism

    Archives

    February 2023
    November 2022
    April 2022
    February 2022
    January 2022
    February 2021
    January 2021
    November 2020
    May 2020
    April 2020
    March 2020
    February 2020
    December 2019
    November 2019
    September 2019
    August 2019
    July 2019
    January 2019
    December 2018
    October 2018
    August 2018
    June 2018
    April 2018
    March 2018
    February 2018
    January 2018
    July 2017
    June 2017
    May 2017
    April 2017
    March 2017
    January 2017
    September 2016
    August 2016
    July 2016
    May 2016
    April 2016
    March 2016
    December 2015
    November 2015
    August 2015
    July 2015
    June 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014

    RSS Feed