Jump to content

onMarkerHit problem


Recommended Posts

Hey,

I want to detect a created element if it's hit a marker. The element which should hit the marker is moving with moveObject, but when the element hits the marker nothing happends.

  
-- Creates the marker 
local container1marker = createMarker(2835.4645996094,-2385.0695800781,15.442111968994,"cylinder",1,0,255,0) 
  
-- The function for the event 
function onElementMarkerHit(hitElement,_) 
    if source == container1marker then 
        if getElementType(hitElement) == "object" then 
            outputChatBox("test") 
        end 
    end 
end 
addEventHandler("onMarkerHit",getRootElement(),onElementMarkerHit) 
  

What's wrong there? (Debugscript says nothing before you ask)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...