playMaker

Author Topic: Different sensitivity in build than in editor[SOLVED]  (Read 15385 times)

tutxinho

  • Playmaker Newbie
  • *
  • Posts: 20
Different sensitivity in build than in editor[SOLVED]
« on: November 14, 2024, 12:38:01 PM »
Hello there, just the title, I have these 2 actions from the picture below and with the sensitivity set to 1, it works great in the editor, but on the builds the sensitivity is much lower and the game is unplayable, any ideas to make it consistent through the editor and the builds? Thank you in advance!

« Last Edit: November 27, 2024, 10:18:45 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Different sensitivity in build than in editor
« Reply #1 on: November 16, 2024, 03:53:02 AM »
Hi,

Can you limit the fps of your game to 30 for example? and then see if it helps with a consistent sensitivity?

Bye,

Jean

tutxinho

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Different sensitivity in build than in editor
« Reply #2 on: November 16, 2024, 05:38:18 AM »
Hey Jean thank you for your reply, I've indeed wanted to try this approach as I suspected that this could be related, but I didn't find a way to do it without coding (I'm a game Artist and I'm learning playmaker to try to make my little games without coding).

So, is there any way to limit the FPS using Playmaker, or directly the Unity interface, or should I figure out how to do it with code?

Thank you in advance.

tutxinho

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Different sensitivity in build than in editor
« Reply #3 on: November 18, 2024, 10:32:19 AM »
Hi again, I managed to create a script to limit the FPS and now the sensitivity it is consistent between editor and builds if they run at the same FPS, but I don't think this is supposed to work like this, there is not any way to make to make the sensitivity independent of the framerate? like a fixed update or something?

Thank you in advance.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Different sensitivity in build than in editor
« Reply #4 on: November 19, 2024, 04:11:20 AM »
Hi,

 yes, you'll need a system that works using deltatime instead of frames.

 simple look doesn't allow that. you can do that using LookAt actions which allows you to set it up using a deltatime approach.

Are you familiar with the deltatime concept?

Bye,

Jean


tutxinho

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Different sensitivity in build than in editor
« Reply #5 on: November 19, 2024, 01:30:11 PM »
Thanks Jean, I was reading a bit about delta time, as I said I'm not a programmer but I think that I mostly understanded the concept.

But I haven't managed to set up the control using "Look At" actions, I guess that I would need to use the "Smooth Look At Direction" so it won't change direction abruptly, but I can't figure out how to use the Vector2 I get from the "Player Input Get Vector2" (I want to use this action, so I can control it with both keyboard or gamepad) to get that my character rotates accordingly using "Look At" actions.

For more context, I'm making a snake like game where the character moves forward automatically and the player input defines the rotation to change the direction of the character, you can see it in the video below.

Thank you in advance.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Different sensitivity in build than in editor
« Reply #6 on: November 20, 2024, 03:04:55 AM »
Hi,

no no :) the user input should control the snake head, and the camera should follow the head snake, that's the best setup really, it's what will give you the most control and fine tuning possible.

have you tried smoothFollow as well? this is enough for your needs really.

Bye,

Jean


tutxinho

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Different sensitivity in build than in editor
« Reply #7 on: November 20, 2024, 04:16:31 AM »
Thanks again for your reply Jean,

Quote
the user input should control the snake head, and the camera should follow the head snake, that's the best setup really, it's what will give you the most control and fine tuning possible.

have you tried smoothFollow as well? this is enough for your needs really.

Yes, that's what I'm doing, the head is controlled just with these 2 actions (see the picture below), and it works great but for the fact that the simple look sensitivity depends on the framerate, so it is not consistent between the editor and the builds (and I guess that also between different hardwares with different performances).



The camera follow the head using the "Smooth Follow" action, as well as the bodyparts use this action to follow the head and each other.

What I can't figure out is how to set up the control of the head with one of these actions which are not dependent of the framerate.
« Last Edit: November 20, 2024, 04:19:21 AM by tutxinho »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Different sensitivity in build than in editor
« Reply #8 on: November 20, 2024, 04:43:39 AM »
Hi,

 SimpleLook isn't going to cut it for you, use SmoothFollow instead to have your camera follow the head, define the distance and height and you are good to go.

Bye,

Jean


tutxinho

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Different sensitivity in build than in editor
« Reply #9 on: November 20, 2024, 05:08:31 AM »
Yes, it is what I'm doing

Quote
The camera follow the head using the "Smooth Follow" action, as well as the bodyparts use this action to follow the head and each other.

My problem is with the control of the head itself, which action which it is not Simple Look, nor any action dependent of the framerate can I use so the Player Input controls the head properly?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Different sensitivity in build than in editor
« Reply #10 on: November 20, 2024, 07:21:47 AM »
Hi,

ok, sorry, I get it now. Indeed, lookat is not the way :)

use "GetAxis" action to get the horizontal user input as a float.
then use "Rotate" action in local space, per seconds.


you can edit the user input and increase the reactivity of the horyzontal axis.

else, you can simply listen to the right and left arrow keys and set the input value to -1 and 1 directly, it will have no delay ( the default input axis do have some delays in and out of changes)
that's all you need.

Let me know if it's not what you are after.

Bye,

Jean

tutxinho

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Different sensitivity in build than in editor
« Reply #11 on: November 20, 2024, 12:00:27 PM »
Thanks again Jean and thanks for your patience, I'm really struggling with this and I feel that this should be an easy thing but I'm missing something.

These 2 actions work great with a fixed framerate, this is just the result I'm looking for, but using actions which make the control consistent with any framerate.



I've tried what you said, but it doesn't work

Quote
use "GetAxis" action to get the horizontal user input as a float.
then use "Rotate" action in local space, per seconds.



I think this is wrong since I'm using an axis value and I guess that I should use a value in degrees instead, so I've downloaded the action "Float Remap" from the ecosystem to convert these -1,1 values into -360,360 degrees but it hasn't work either



I tried to use just a Vector3 in a similar way I used the V2 on the FSM with the "Simple Look" action, but it doesn't work either, so I'm running out of ideas :(



I've checked the actions ingame and these are receiving the right values from the input in all the cases but the head simply doesn't rotate at all, any thoughts?

Thank you in advance.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Different sensitivity in build than in editor
« Reply #12 on: November 22, 2024, 10:55:55 AM »
Hi,

ok, Can you isolate the head gameobject and the camera in an empty scene and send me that scene, I will try to understand whats going on.

I'll package meanwhile my version of the snake head and we'll have a better base to discuss this.

We'll get it done!

Bye,

Jean

tutxinho

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Different sensitivity in build than in editor
« Reply #13 on: November 22, 2024, 11:20:51 AM »
thank you! I've just sent you a private message with the scene, I'm looking forward for your guidance :)

tutxinho

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Different sensitivity in build than in editor
« Reply #14 on: November 26, 2024, 02:01:09 PM »
An update just in case this thread can be useful for anybody else.

Jean was lending me a hand and I managed to make it work with the setup that he suggested in the previous posts (See the picture below).



-It is necessary to set the multiplier to a high value (Otherwise the movement wouldn't be even noticeable, at first I had set to 1 which is the default and I thought that it wasn't working at all).

-Every frame should be checked to it works.