November 29, 2020, 04:32:27 PM

Author Topic: Interact with objects.  (Read 1039 times)

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Interact with objects.
« on: February 07, 2018, 12:22:54 AM »
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?

Offline RemiD

  • Hero Member
  • *****
  • Posts: 1077
Re: Interact with objects.
« Reply #1 on: February 07, 2018, 07:50:31 AM »
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...)
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: Interact with objects.
« Reply #2 on: February 07, 2018, 05:02:00 PM »
Thanks You! :)

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal