C
C#16mo ago
Nos_E3ks

❔ trying to get my Dialog system to be with a key press and not just walking into the npc, unity 2d

I've been trying for awhile now to make it so it works but, everything I do doesn't work. I have all the code, it works but when you walk into the npc, and I want to figure out how to do it when I walk up to the npc and press the Z key at the same time. thank you
3 Replies
Angius
Angius16mo ago
Don't start conversation on collision, then Two ways I used to add interaction on key press in Unreal, something similar should be doable in Unity as well: 1. On key press, sphere cast towards the camera, get a reference to the hit object, check if it implements an IInteractable inteface, if so proceed with dialogue 2. Spherical or capsule collider around every interactable object, perhaps abstracted to a component. On key press check all interactable colliders The first method is, IMHO, better. Lets you pack interactable objects closer together, and the player has more precision when picking what they want to interact with
Nos_E3ks
Nos_E3ks15mo ago
alright that is true, just need to figure out how to set that up! I still quite neww to coding, thats why i asked lol,
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ Differenct action names is not working ASP.NET Corehttps://stackoverflow.com/questions/76006309/different-action-names-are-not-working-in-asp-net-core-❔ how to deploy asp.net project to ec2 linux server using github actions with dockerHi guys i want to deploy my api project (.net 6) to ec2 server (linux) with github actions and it wi❔ WPF Date entry Forms MVVMHello, I don't understand in WPF when I should use MVVM and when I shouldn't. For example, i'm loadi❔ Access appsettings.json in ASP.NET Web API in Azure published App Servicehttps://stackoverflow.com/questions/76005641/azure-hosted-asp-net-web-api-cannot-access-appsettings-❔ Akka.net Actors are not responding in timeI have a system that consists of two Actor classes and a class that calls these actors. ```cs publi✅ DialogResult and MessageBox in class (namespace)Hi, I have a class library and wanted to know if its possible to add a dialog result and message boxParsing an arbitrary file path as a Uri or similarHello there. I would like to be able to parse the following inputs in such a way that I'm aware if tHow to upgrade from Microsoft.NETCore.App 6.0.13 to Microsoft.NETCore.App 6.0.16 on Ubuntu 22.04LTS?I recently did a micro-update on my developer machine and now my machine is running Microsoft.NETCor❔ EditingI have no coding knowledge so im hoping someone can help me with this, game is people playground, moProblem with my projectSo I need the 2nd panel event in the second attachment to call the method in the first attachment an