playMaker

Author Topic: Limit Look at Rotation[SOLVED]  (Read 20838 times)

marvoc

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Limit Look at Rotation[SOLVED]
« Reply #30 on: March 27, 2019, 03:44:56 PM »
Hello,
 so I used your cool script and its working perfectly. But there is a problem. Maybe you mention here but is there any way how to reslove it?

Problem is that go over +/- 60 degree isnt working. Then Target goes behind Camera.. so Im not sure what to do it I need more angle :)

Here is a short video:

https://drive.google.com/open?id=1z04Wo9ymwIZjJ3O4tW4Ef3rJmn1GvIm7

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Limit Look at Rotation[SOLVED]
« Reply #31 on: April 01, 2019, 04:22:23 AM »
Hi,

 that's very odd. I can not reproduce this and I tried on 2018 and the latest playmaker.

 can you try on a fresh project? is this happening still?

Bye,

 Jean

marvoc

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Limit Look at Rotation[SOLVED]
« Reply #32 on: April 03, 2019, 07:12:38 AM »
Hi thanks for your reply.
For test I have this verions:
- Unity 2018.2.8f1
- Playmaker 1.9.0.p4 (but I reported it from version p6)

So I made new project, installed version of Playmaker above, open you scene and run it.
Still I have the same result. If I put there +/- 70, for example, rotation goes on  back side too.

May I help you with something? ;)

[EDIT] I've tried with last p14 version and is still the same.
« Last Edit: April 03, 2019, 03:20:47 PM by marvoc »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Limit Look at Rotation[SOLVED]
« Reply #33 on: April 04, 2019, 02:38:27 AM »
Hi,

 ok, I could repro, indeed the clampRotation is not working properly in some cases.

 Can you try this version of ClampRotation attached to this post?

If it works for you, I'll push that to the ecosystem.

Bye,

 Jean

marvoc

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Limit Look at Rotation[SOLVED]
« Reply #34 on: April 04, 2019, 03:49:01 PM »
Hi Jean,
 thanks for your work :)
So I tried and I have some results.
1) it seems that there is an issue in term of "ball going back", and this doesn't happend before. Value for rotation is -45 / 45.

https://drive.google.com/open?id=1EMIT8EAwcCT-5BftwLySPQKuPVjAPlRx

2) If I put, for example, -130 / 130 (imagine that I'd like to use this function for a tank turret) and maybe this plugin isn't for this usage...

https://drive.google.com/open?id=1Z1EiDtGU9tAygG6D0myPqWgai4l3UJuT

    a) It seems that I can't go more then -90 (if 0 is on top, in term of video orientation) but +130 degree limit is working fine.
    b) When I'm on back side of the "camera" and then see me again, the ball is going immediately with shorter way to my cube. But it's going on back side.

I think that this is really crazy example :) But because name of this function is Clamp Rotation (doesn't say anything that it could work only +/- 90 degree) I tested too.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Limit Look at Rotation[SOLVED]
« Reply #35 on: April 05, 2019, 04:18:48 AM »
Hi,

 yes, 1) is a result of the new constraint routine used, because the technic is different, the behaviour is also not exactly the same. I noticed that, but I could not find a way around this.

2) have you tried to move the range so that it's within 0 and 180 so that the min is not a negative number? maybe it will go around this block.

 It's a tricky thing, because the math behind this are complex ( for me at least, and I haven't found a definite rotation constraint that works for all cases yet).

If the solution is ok for your case right now, let's call it a day, let me progress on other things, and ping me in about a week or so and I'll have another go at the constraint action, I have another idea I'd like to experiment which would solve both issues at the same time ( where the jump between min and max would happens it crosses the virtual symmetry between min and max)

bye,

 Jean

marvoc

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Limit Look at Rotation[SOLVED]
« Reply #36 on: April 05, 2019, 06:56:27 AM »
Ok thanks, Ill try what you wrote. Yes for now is enough.
Ill bump this post, as you said :) because to get this ClampRotaion funcionality will be amazing and with a lot of possible usages.

marvoc

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Limit Look at Rotation[SOLVED]
« Reply #37 on: April 15, 2019, 02:09:41 PM »
Hi Jean,
 Im bumping this thread as you said, Im still interested :)

Martin

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Limit Look at Rotation[SOLVED]
« Reply #38 on: April 16, 2019, 02:29:41 AM »
Hi,

 Thanks for the bump :) I don't have time this week, I'll try next week.

 Bye,

 Jean

marvoc

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Limit Look at Rotation[SOLVED]
« Reply #39 on: April 24, 2019, 04:17:41 AM »
Hi Jean, im only bumping :)
And thanks for Playmaker its amazing!!! :)

marvoc

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Limit Look at Rotation[SOLVED]
« Reply #40 on: June 08, 2019, 05:09:02 AM »
bump, if there is something new:)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Limit Look at Rotation[SOLVED]
« Reply #41 on: June 17, 2019, 04:49:18 AM »
Hi,

 it's in my todo, so I haven't forgotten about it, I need to find the right time, as it will require my full attention for this to work properly... with a full morning that I'll dedicated to this. I tried to hack around that few times already to no availability... that's one of these actions that needs proper math and transforms know how :)

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Limit Look at Rotation[SOLVED]
« Reply #42 on: August 23, 2019, 06:01:06 AM »
Hi,

 Ok, managed to find some time to address this and I think I have the right clamping for you.

 Now, it will swap clamp when it reaches the opposite side of the mid range, which is intuitivly what we want when we look at something yet clamped.




let me know how it goes for you.

Bye,

 Jean


marvoc

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Limit Look at Rotation[SOLVED]
« Reply #43 on: November 29, 2019, 05:15:19 PM »
Hi,
 sorry for my delay, now I've checked and looks nice ;)
Thanks a have a nice day

Martin