Discuss Scratch

Chickennuggets778
New Scratcher
16 posts

Need help with NPC interaction

I am making an rpg and need help with something involving the npcs. Basically in order to talk to the npc you need to be touching it but the problem is that the player covers up the npc. Is there any way to make it so that the player can still talk to the npc and not cover it up? Here is the link to the game https://scratch.mit.edu/projects/552185419/ . Any help would be appreciated

Last edited by Chickennuggets778 (July 15, 2021 02:46:15)

unseenphantom
Scratcher
6 posts

Need help with NPC interaction

Chickennuggets778
New Scratcher
16 posts

Need help with NPC interaction

Ok so I tried it but it didn't work. I want to make it so that the player presses e and is touching the npc and then the npc will talk. However I want to make it collide so that the player can't go through the npc. So I want to make it so that the player collides with and is still able to talk to them. Sorry if I wasn't clear enough before!
Wei-ern_520
Scratcher
500+ posts

Need help with NPC interaction

Chickennuggets778 wrote:

Ok so I tried it but it didn't work. I want to make it so that the player presses e and is touching the npc and then the npc will talk. However I want to make it collide so that the player can't go through the npc. So I want to make it so that the player collides with and is still able to talk to them. Sorry if I wasn't clear enough before!


Then you have to use collision against the NPC and to do this try:

ifXposition=XPOSyouwantyoucanrangethemandyposition=YPOSyouwantsameherethenifdirection=thedirectionyouwantyourplayertofacewhiletalkingtoNPCthendothetalking

Last edited by Wei-ern_520 (July 15, 2021 13:07:26)

Powered by DjangoBB