playMaker

Author Topic: Why sensivity doesn't work with joystick ?  (Read 1543 times)

ElProfessor595

  • Playmaker Newbie
  • *
  • Posts: 19
Why sensivity doesn't work with joystick ?
« on: March 26, 2020, 02:27:18 PM »
Hello guys ! I actually work on a Sonic-style fangame. To make the character's acceleration, I use input's sensivity and gravity settings, whith low values. And with the keyboard, it's work pretty well. But when I use a controller, Unity doesn't look like to apply sensivity ad gravity settings. Can someone explain me why it doesn't work, and possibely how to solve this problem, please ?
Thanks for all yours answers :)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Why sensivity doesn't work with joystick ?
« Reply #1 on: March 26, 2020, 04:19:26 PM »
Hi.
The old input system is very crappy, i do not know about the new input system.
i can't really tell you why it does not work, but i had a lot off issues with it as well.

Rewired is (so far) the best solution for controllers (in my opinion)
I have been using Rewired asset a long time and on several projects and it the beginning it might look a bit complex but it works very good.

ElProfessor595

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Why sensivity doesn't work with joystick ?
« Reply #2 on: March 27, 2020, 11:07:27 AM »
Thanks djaydino for your really quick answer, but I saw on the internet many tutorials of momentum, so can't we do it with playmaker ?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Why sensivity doesn't work with joystick ?
« Reply #3 on: March 27, 2020, 04:01:12 PM »
Hi.
Sure you can. but using  sensitivity and gravity is not the way to go i think.

its better to set up a system to do this.

You could use for example 'Axis Event'
and for example on 'right event' go to next state.

In that state use a 'float interpolate' or 'curve float' and a set velocity
so that you gradually increase the velocity.

ElProfessor595

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Why sensivity doesn't work with joystick ?
« Reply #4 on: March 29, 2020, 10:43:53 AM »
Thank you, I tried your method, and it looks good, but I have (again) a problem : I use Get Axis for the two axis, I amplify the two values got when the character run, set Vector3 value with the two new values, and finally, I set it at character controller (sorry for this very long text). It works, but when I move the camera, the character move in an unique direction,whatever the camera placement, only move on that axis.
I want to use Get Axis Vector action, but i don't know how to do it. If you understood what I said, do you know what could I do ?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Why sensivity doesn't work with joystick ?
« Reply #5 on: March 29, 2020, 12:42:30 PM »
HI.
Oh you are using the character controller?

it is probably interfering with the velocity.
character controller is ok for some quick prototyping else its better to build your own system.

Just to be clear what type you are building : 2D side scroller / 3d 3rd person / 3d 1st person / someting else.

ElProfessor595

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Why sensivity doesn't work with joystick ?
« Reply #6 on: April 04, 2020, 01:17:31 PM »
I am doing a 3d third person game. But what do you think I would have to do to replace character controller ?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Why sensivity doesn't work with joystick ?
« Reply #7 on: April 04, 2020, 03:48:28 PM »
Hi.
You can start by using get axis (1 horizontal, 1 vertical) and use those with set velocity (every frame and local)

on you object to move place a rigidbody.
you might need to set some constraint on rotations so you wont fall over (they are on the rigidbody component

they way you want to move depends on your game.

if player should rotate when pressing left/right you can use the horizontal axis with a rotate.

if you want it to 'strafe' then use a velocity.

To rotate with mouse you can use for example Mouse Look.

ElProfessor595

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Why sensivity doesn't work with joystick ?
« Reply #8 on: May 06, 2020, 11:56:22 AM »
Hi guys, good news ! I finally found how to make smooth controls with joysticks : I use "Vector3 Low pass filter", and it works pretty good !

ElProfessor595

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Why sensivity doesn't work with joystick ?
« Reply #9 on: May 06, 2020, 12:01:12 PM »
But now, I have a new problem : I want the character stick at the ground surface, and I have maybe a solution. Does anyone know how to convert a vector (vector3 normal) to a rotation ?