Bishop Posted November 16, 2019 Share Posted November 16, 2019 Hi,guys...I need advice ....when a player is near an interactive object...I need automatically display text about this object.....or just do something with the object. Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted November 18, 2019 Share Posted November 18, 2019 you could fire a raycast where the player is pointing the crosshair, or create a small trigger that displays the info on screen near the object it depends on how hidden or obvious you want the object to be Quote Link to comment Share on other sites More sharing options...
Duion Posted November 18, 2019 Share Posted November 18, 2019 A trigger zone is probably the better and easier solution instead of constantly having to check for objects, it also allows you finer control on what you define as "close enough" to interact, the trigger then can also be used for interaction or another trigger.Personally I'm not that much of a fan of guiding the player through automatic events, if designed well a game can work without such things, in the past games usually did not have help texts, GUIs, triggers or hints to tell you where, how and with what you can interact, you would have to figure it out by yourself.I would design first without those things and then have players test it and see how well it works or if help is needed through texts or whatever. Quote Link to comment Share on other sites More sharing options...
Bishop Posted November 20, 2019 Author Share Posted November 20, 2019 Thanks...trigger solution sounds great...I have raycasting implemented but ...when mouse click ( mouse button1) but I need fire ray just right cursor (cross) pointing over the item without mouse clicks events.All interactive items would be in the "GameItem" internal name....that are similar to the groups in the Godot engine. ....so if object Is in group/have internal name "GameItem" ray Is shooting from eye point to the declared vector and range (from 0 to 4.0 range)...is this possible?like in the Godot engine:var ray_collider = cam_ray.get_collider()if cam_ray.is_colliding() and ray_collider.is_in_group("item"): info.text = str(ray_collider.name)else: info.text = str("")"cam_ray" is a RayCast node in the Godot engine somethink like pre-made datablock with changeable properties in the Torque engine...I think. Quote Link to comment Share on other sites More sharing options...
Duion Posted November 20, 2019 Share Posted November 20, 2019 One thing I use that sounds similar to what you want is a containerRayCast it checks if you are near something, not just a raycast from your mouse, but all around.My bots use that to check if an enemy is near, but they run on a tick rate, where they perform an action every tick which is like every second or so. So if you really want to do that you would have to shoot your raycasts constantly in intervals of x seconds. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.