playMaker

Author Topic: Problems with getting angle of the slope dynamically and correctly [SOLVED]  (Read 2999 times)

Yoshinori_Date

  • Playmaker Newbie
  • *
  • Posts: 7
I made a system that changes the character animations depending on the angle of the slope, i use 4 raycasts forward, backward, left and right to get the angle using "get angle3 XYZ" and z as float to control the animations, but when i walk from a back side of the mesh or the rotated version of platform then z value is inverted and animations is wrong, i think the pics explained it better, first is how it should be

and second is the problem

mb this whole system is just a mess?
« Last Edit: December 03, 2019, 12:03:24 PM by Yoshinori_Date »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Problems with getting angle of the slope dynamically and correctly
« Reply #1 on: December 03, 2019, 03:37:07 AM »
Hi,

I would separate the problem in two.

 can you position dummy cubes under the feet of the character on the slope, do that with first some simple dummies, then plug the character feet. make sure the cubes are position and rotated properly to match the slope.

 once you have that, I am not even sure how you can force an animation to adjust its feet placement to match the dummies you have now in place.

let me know when you get the first step, this should require only one raycast per feet, straight down and the first hit is your slope, get the hit normal and position and match the cube transform to that.

 
Bye,

 Jean

Yoshinori_Date

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Problems with getting angle of the slope dynamically and correctly
« Reply #2 on: December 03, 2019, 06:03:52 AM »
i don't quite get how to do this exactly, and i think it's not exactly what i need, because i need different float values to play the walking up, down and horizontally on the slope animations, i try right now to cast 8 rays top down (2 in each direction) and get the distance between the 2 rays, but the distance is not that different between 45 degree slope and almost flat slope, i tried get the angle between 2 hitpoins, but it's also kinda weird
« Last Edit: December 03, 2019, 06:53:17 AM by Yoshinori_Date »

Yoshinori_Date

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Problems with getting angle of the slope dynamically and correctly
« Reply #3 on: December 03, 2019, 12:01:24 PM »
ok, i did it, i use 16 objects, 8 down, and 8 a bit higher shooting rays down and when they hit ground i use get position of object under the ray and vector3 operator to get the distance between hit point and the object that is down, for now it works great, but i need keep in mind the distance between those objects

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 Could you show us how it looks when it works? I am quite curious!

Bye,

 Jean

Yoshinori_Date

  • Playmaker Newbie
  • *
  • Posts: 7

and here is the system


and on the slope

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Hi.
Wow Very Impressive!

I love the way the arms also move depending on the slope walking!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 Cool!, Do you have a twitter account so that I ref you, I'd like to tweet about this.

Bye,

 Jean

Yoshinori_Date

  • Playmaker Newbie
  • *
  • Posts: 7
yeah https://twitter.com/Yoshinori_Kudo and thank you both, it's very flatering