Help with Unreal engine 5 c++ code. On level there is interactable object which by…
- User
Help with Unreal engine 5 c++ code. On level there is interactable object which by default has yellow glow and marker on it. All happening in multiplayer. When spicific player start to look at object for this player marker will be disabled and it start glow with green color (other player doesn't have this). When player stop look at it it go back for specific player. But you can pickup the object and i call same function but in that case glowing and marker are disabled for everyone . If we look at item when it has been pickuped it continue to glow green and when we stop looking glowing and marker disabled. But when we drop item marker doesn't appear for other player and if other player pick item from player hand and then drop it then marker doesn't appear. There is a code (when look at item startTouch called, When pickup item endtouch and start interactive called, when drop item stopinteractive called, when stop look at item endTOuch called (without pickup): void USV_HighlightInteractHandler::StartInteractive_Implementation(bool IsSlotLocallyControlled) { OnHand = true; if(IsSlotLocallyControlled) SetEnableHighlightState(false); else if (!HasHighlightedActionOfType(FSV_InteractionAction::Touch)) SetEnableHighlightState(false); }
void USV_HighlightInteractHandler::StopInteractive_Implementation(bool IsSlotLocallyControlled) { OnHand = false;
if (IsHighlightEnable) { HighlightOn(); }}
void USV_HighlightInteractHandler::EndTouch_Implementation(bool IsSlotLocallyControlled) { if (OnHand) { SetEnableHighlightState(false);
if (IsSlotLocallyControlled) { UpdateMaterialTouchValue(0.f); } } else if (IsSlotLocallyControlled) { SetMarkerEnabled(true); SetEnableHighlightState(IsHighlightEnable); UpdateMaterialTouchValue(0.f); }}
void USV_HighlightInteractHandler::StartTouch_Implementation(bool IsSlotLocallyControlled) { if (!IsSlotLocallyControlled) return;
UpdateMaterialTouchValue(1.f); SetMarkerEnabled(false); SetEnableHighlightState(true);}
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.