Hi @guavaman
I still have the bug, that the player character continue to shoot even if I don’t press/held anymore the fire-button. When I press the fire-button again the wrong shooting stops. I can’t find any bug in my own code, I tried with a static bool variable too.
The wrong shooting happens mostly by left mouse button in the editor. But very rare it happens in Built version with gamepad too. But mostly time with the mouse in the editor.
You can see it in the video at 1:18: the flame is still shooting even the “eligibleForClick:” say “false” (buttonID: -1)
private Player playerRewired;
public static bool inputShooting;
private void Awake()
{
playerRewired = ReInput.players.GetPlayer(playerId);
}
private void Update()
{
//inputShooting = false;
//inputShooting = Fire();
Fire();
if (inputShooting)
{
Debug.Log("Rewired found " + ReInput.controllers.joystickCount + " joysticks attached.");
for (int i = 0; i < ReInput.controllers.joystickCount; i++)
{
Joystick j = ReInput.controllers.Joysticks[i];
Debug.Log(
"[" + i + "] Joystick: " + j.name + "\n" +
"Hardware Name: " + j.hardwareName + "\n" +
"Is Recognized: " + (j.hardwareTypeGuid != System.Guid.Empty ? "Yes" : "No") + "\n" +
"Is Assigned: " + (ReInput.controllers.IsControllerAssigned(j.type, j) ? "Yes" : "No")
);
}
// Log assigned Joystick information for each Player
foreach (var p in ReInput.players.Players)
{
Debug.Log("PlayerId = " + p.id + " is assigned " + p.controllers.joystickCount + " joysticks.");
// Log information for each Joystick assigned to this Player
foreach (var j in p.controllers.Joysticks)
{
Debug.Log(
"Joystick: " + j.name + "\n" +
"Is Recognized: " + (j.hardwareTypeGuid != System.Guid.Empty ? "Yes" : "No")
);
// Log information for each Controller Map for this Joystick
foreach (var map in p.controllers.maps.GetMaps(j.type, j.id))
{
Debug.Log("Controller Map:\n" +
"Category = " +
ReInput.mapping.GetMapCategory(map.categoryId).name + "\n" +
"Layout = " +
ReInput.mapping.GetJoystickLayout(map.layoutId).name + "\n" +
"enabled = " + map.enabled
);
foreach (var aem in map.GetElementMaps())
{
var action = ReInput.mapping.GetAction(aem.actionId);
if (action == null) continue; // invalid Action
Debug.Log("Action \"" + action.name + "\" is bound to \"" +
aem.elementIdentifierName + "\""
);
}
}
}
}
//Debug.Log("inputShooting");
}
public void Fire()
{
inputShooting = playerRewired.GetButton(RewiredConsts.Action.Fire);
if(pressedPause)
inputShooting = false;
//return inputButton;
}
Unity version >> 6.000.0.24f1
Rewired version >> 1.1.57.3
Platform >> Windows
Build / Editor / Both? >> Both.
Primary Input Source and optional additional input sources in use: https://guavaman.com/projects/rewired/docs/RewiredEditor.html#Settings
Is Steam initialized? >> no
What controller(s) are being used?
Rewired found 1 joysticks attached.
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:934)
[0] Joystick: Xbox 360 Controller
Hardware Name: Xbox 360-Controller für Windows
Is Recognized: Yes
Is Assigned: Yes
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:938)
PlayerId = 0 is assigned 1 joysticks.
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:949)
Joystick: Xbox 360 Controller
Is Recognized: Yes
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:954)
Controller Map:
Category = Default
Layout = Default
enabled = True
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:962)
Action “Jump” is bound to “A”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “Seek” is bound to “B”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “Fire” is bound to “X”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “Seek” is bound to “Y”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “SwitchLeft” is bound to “Left Shoulder”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “SwitchRight” is bound to “Right Shoulder”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “Pause” is bound to “Back”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “Pause” is bound to “Start”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “MoveVertical” is bound to “D-Pad Up”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “MoveHorizontal” is bound to “D-Pad Right”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “MoveVertical” is bound to “D-Pad Down”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “MoveHorizontal” is bound to “D-Pad Left”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_Submit” is bound to “X”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_Submit” is bound to “A”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_MoveVertical” is bound to “D-Pad Up”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_MoveVertical” is bound to “D-Pad Down”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_MoveHorizontal” is bound to “D-Pad Right”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_MoveHorizontal” is bound to “D-Pad Left”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_Cancel” is bound to “B”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_Cancel” is bound to “Y”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “MoveHorizontal” is bound to “Left Stick X”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “MoveVertical” is bound to “Left Stick Y”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “MoveHorizontal” is bound to “Right Stick X”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “MoveVertical” is bound to “Right Stick Y”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “SwitchLeft” is bound to “Left Trigger”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “SwitchRight” is bound to “Right Trigger”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_MoveHorizontal” is bound to “Left Stick X”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_MoveVertical” is bound to “Left Stick Y”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_MoveHorizontal” is bound to “Right Stick X”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)
Action “UI_MoveVertical” is bound to “Right Stick Y”
UnityEngine.Debug:Log (object)
SupanthaPaul.PlayerController:Update () (at Assets/!MyGame/Scripts/PlayerController.cs:973)