playMaker

Author Topic: clamp value jumps from min to max value  (Read 309 times)

hx

  • Playmaker Newbie
  • *
  • Posts: 8
    • View Profile
clamp value jumps from min to max value
« on: June 17, 2017, 02:15:32 PM »
Hello everyone,
i have been struggeling on this topic for over two weeks. i want to rotate a gameobject with mouse in a limited range. x axis from 0 to 60. y axis from 0 to 360, z axis from 0 to 60.
this is what i did.
1. get mouse delta position x,y.
2. multiply the float x,y with -10000 and 10000
3. rotate the gameobject in axis x with float y, axis y with float x
4. get the current rotation from gameobject, eulerangle x, eulerangle y, eulerangle z as variante.
5. clamp the eulerangle x ,z between 0 to 60
6. set rotation with eulerangle x , eulerangle z


however, this works in a strange way, in case of max value, when the limit is reached, the gameobject doesnt go over, but in case of min value, it is always return to max value again. so my gameobject get not smoothly rotating, it shakes always like crazy.

I have tried some Direction as follows.
1. get signed angle to target.
2. set another event to compare the float min, but it stucks in the compare state.


can someone help me out of this??

« Last Edit: June 19, 2017, 12:43:43 AM by hx »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2408
    • View Profile
    • jinxtergames
Re: clamp value jumps from min to max value
« Reply #1 on: June 17, 2017, 08:12:01 PM »
Hi,
If it are just basic objects (cube/sphere/...) and no prefabs..
Can you share the scene so i can test it?

hx

  • Playmaker Newbie
  • *
  • Posts: 8
    • View Profile
Re: clamp value jumps from min to max value
« Reply #2 on: June 18, 2017, 01:18:36 AM »
Hi,
If it are just basic objects (cube/sphere/...) and no prefabs..
Can you share the scene so i can test it?

yes, of course. here is the package. i downloaded from ecosystem a action called get mouse delta position, otherwise all the actions are all from standard playmaker.
« Last Edit: June 18, 2017, 08:41:26 PM by djaydino »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2408
    • View Profile
    • jinxtergames
Re: clamp value jumps from min to max value
« Reply #3 on: June 18, 2017, 08:45:34 PM »
Hi,
I removed the file because you included the plugin/playmaker folder.

Inside that folder there are playmaker.dll files, they are not allowed to be shared.

I have the file so i can test now, but if you want others to try you can upload it again but then without the plugin/plamaker folder :)

hx

  • Playmaker Newbie
  • *
  • Posts: 8
    • View Profile
Re: clamp value jumps from min to max value
« Reply #4 on: June 19, 2017, 12:44:42 AM »
Hi,
I removed the file because you included the plugin/playmaker folder.

Inside that folder there are playmaker.dll files, they are not allowed to be shared.

I have the file so i can test now, but if you want others to try you can upload it again but then without the plugin/plamaker folder :)


thank you. i uploaded it again. Hope soon come to the solution. waiting forward for your reply!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12417
  • Official Playmaker Support
    • View Profile
Re: clamp value jumps from min to max value
« Reply #5 on: June 19, 2017, 04:23:30 AM »
Hi,

 please following this thread, It's on the same topic.

http://hutonggames.com/playmakerforum/index.php?topic=15303.msg70778;topicseen#new


 Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2408
    • View Profile
    • jinxtergames
Re: clamp value jumps from min to max value
« Reply #6 on: June 19, 2017, 05:55:38 AM »
Hi,
I didn't see that, thx jean.

I have locked this thread.
You can go to the other thread, i have posted a sample there.

Please use only 1 thread for the same topic.