Interact with objects.

Started by Yue, February 07, 2018, 00:22:54

Previous topic - Next topic

Yue

I want to know how I can implement a figure in the middle of the screen, so that you can operate objects in the game, for example when the figure touches a door, this change color to indicate that you can do an action, I have thought of a linepick that comes out of the camera. 

Any suggestions?

RemiD

#1
linepick and pickables is one way to achieve that, another way is a combination of a distance check + a deltayaw deltapitch check, which tells you if the camera is near enough an entity and oriented towards enough an entity.
(you can use fullbright (entityfx,mesh,1) or entitycolor(mesh,r,g,b) to show player with which mesh he can interact, or for you, to debug your code...)