Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: stigma on August 26, 2025, 02:31:46 AM
-
Hi,
I migrated my Unity 2022.3 project to Unity 6.2.
It works fine except for some Mouse Pick Event actions, which exhibit very strange behavior. Have you noticed this?
Thanks
-
Have you tried enabling the legacy input system in settings:
Project Settings > Player > Active Input Handling
Use Both to enable both systems.
-
yes I use both but I fixed the problem by using an event with a script instead of Mouse Pick Event.
using UnityEngine;
using HutongGames.PlayMaker;
public class ManualMousePickMulti : MonoBehaviour
{
public LayerMask layerMask; // couche des objets interactifs
public Camera cam; // caméra de référence
public float rayDistance = 2f; // distance maximale du raycast
// Noms des événements PlayMaker selon l’objet cliqué
public string eventPorte = "clicPorte";
public string eventObjet = "clicObjet";
void Start()
{
if (cam == null)
cam = Camera.main;
}
void Update()
{
if (Input.GetMouseButtonDown(0))
{
Ray ray = cam.ScreenPointToRay(Input.mousePosition);
RaycastHit[] hits = Physics.RaycastAll(ray, rayDistance, layerMask);
foreach (var hit in hits)
{
if (hit.collider != null)
{
PlayMakerFSM fsm = hit.collider.gameObject.GetComponent<PlayMakerFSM>();
if (fsm != null)
{
if (hit.collider.gameObject.CompareTag("Porte"))
{
fsm.SendEvent(eventPorte);
break; // stop après avoir envoyé l’événement porte
}
else if (hit.collider.gameObject.CompareTag("Objet"))
{
fsm.SendEvent(eventObjet);
break; // stop après l’objet
}
}
}
}
}
}
}
There are two event names because sometimes I have an object behind a closet door.
-
Thanks for the update. I'll investigate the Mouse Pick Event in Unity 6.2.
-
MousePick Event :
in other places the click no longer works but if I reload the scene it works again. so it's random.
It also happens that the click area is shifted to the left. You also have to reload the scene so that the click is in the center again.
-
Is there any hope for a fix? If not, can you point me to an alternative action that works for the mouse click?
-
I haven't been able to reproduce the problem yet. It seems to be working as far as I can tell.
Are you able to reproduce it in a new scene?
Can you share a project where it doesn't work?
-
I retested with the old Mouse Pick Event. It works so far. If there's any problems, I'll come back here.
Otherwise, sorry to have bothered you :-)
Edit:
Everything is working fine now. I don't know what happened. It was a large project that had been migrated, and something was interfering with the click functionality.
Sometimes a click doesn't work, but if I exit and then re-enter the scene (build), it works.