- Home /
How to Do Simple Interactions?
Hi, I'm a bit new to Unity and JavaScript. I'm trying to make a game and I figured I'd try putting in actions that are context sensitive. How would I detect what's in front of my "player character" within a certain radius of reach to then perform a specific action? (climb, jump, open, close, grab, etc)
Also, while I'm here, is there an effective way to a melee that can hit multiple targets without doing multiple calls that could possibly hitting the same object multiple times?
Answer by tanoshimi · Sep 05, 2014 at 06:11 AM
Look up Raycasting. You'd cast a ray whose length was your allowed interaction distance forward from the player and check what object it hits, then select the appropriate action.
Your answer
Follow this Question
Related Questions
Setting Scroll View Width GUILayout 1 Answer
interacting with a raycast 1 Answer
Question and Answer Menu 3 Answers
Brawl style melee combat? 0 Answers
Can someone help me fix my Javascript for Flickering Light? 6 Answers