playMaker

Author Topic: 2.5D in 3D world with different camera angles  (Read 2582 times)

Ishinash

  • Playmaker Newbie
  • *
  • Posts: 7
2.5D in 3D world with different camera angles
« on: February 01, 2014, 02:24:27 PM »
Hello folks,

I recently purchased Playmaker and still going through all the documentation and video tutorials and I understand the basics of Javascript.  I've been able to hard code a traditional 2.5D platformer using a RigidBody, but was never able to figure out how to implement 2.5D characters in a 3D world and rotating camera angles with relative movement.

Essentially, the player will control the avatar using WASD controls and GetAxis Horizontal (left and right) and Vertical (to and from camera) with a jump function.  By pressing "q" (-90 rotation) and "E" (+90 rotation) for camera rotation and WASD movement remains relative instead of global.

So, how does one accomplish this?  The general movement script and FSM are super easy to create, but the relative movement keeps stumping me every time.  I'd love to make this into a video tutorial and open source for others with similar questions.

Thanks!


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 2.5D in 3D world with different camera angles
« Reply #1 on: February 04, 2014, 04:42:11 AM »
Hi,
 
If the camera has different angles, that's tricky indeed.

 Is your character using Mecanim? I think one of the sample uses a vector direction for the movement, it may be the right option in your case. Or do you have a regular fbx set of animations?

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: 2.5D in 3D world with different camera angles
« Reply #2 on: February 04, 2014, 06:56:54 AM »
Hi,

 Fun!!

 I was looking at some mecanim examples I could port for PlayMaker and stumbled upon some scripts that just do that!

 I have made it as an action. Basically, given your regular inputs, you can now now the local direction for a given object, based on the camera point of view.

 so if my character is walking to the left, and press up, this action will tell me that the direction of the input it "90" degrees, so I know I need to rotate the character 90°!!!

Can you experiment with this. I should be able to work on this more the next few days and bind this with mecanim animations as per Unity sample.

bye,

 Jean

Ishinash

  • Playmaker Newbie
  • *
  • Posts: 7
Re: 2.5D in 3D world with different camera angles
« Reply #3 on: February 05, 2014, 10:34:46 PM »
Hey Jean,

I appreciate your response.   Currently, I've tested using a Vector3 horizontal/vertical movement system, simply adding force in a given local direction, and hard coded / FSM scripting.

I have not thought to test out involving mecanim, but I'll certainly look into it!  Thanks for the ideas, I'll test this out in my free time and get back with my results.

EDIT:

After reading my initial post, it's important to mention that I'm currently using a basic cube to code out the basic mechanics such as movement and camera rotation.

Later, I may implement either sprites or fully animated custom models.  I'm a 2d/3d Artist way before I am a programmer. :)
« Last Edit: February 05, 2014, 10:37:52 PM by Ishinash »