10000 [DOCS] Examples of how to use AZ Actions (Trigger event, collision event) in Lua · Issue #2406 · o3de/o3de.org · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[DOCS] Examples of how to use AZ Actions (Trigger event, collision event) in Lua #2406
@AMZN-alexpete

Description

@AMZN-alexpete

Describe the issue briefly

Almost all the physics ebuses are gone or not exposed to Lua and in their place are new classes and functionality that is not well documented and one of the most important pieces is how to use triggers/colliders and simulated bodies.

code for a trigger looks like this:

        self.triggerEvent = SimulatedBody.GetOnTriggerEnterEvent(self.entityId)
        if self.triggerEvent ~= nil then
            self.triggerHandler = self.triggerEvent:Connect(function()
               Debug:Log("triggered")
            end)
        end

however it relies on SimulatedBody to be around and active which it probably NOT be in OnActivate where you expect it to be ready (another doc gap?) and there doesn't appear to be an ebus for telling you when it is ready so you at least need to wait till the next tick to run the above code.

Which page(s) / section(s) are affected?

Possibly a new page around here:
https://www.o3de.org/docs/user-guide/scripting/lua/ebus/

Does this work have an engineering dependency? What is it?

you might need to have an engineer dive in to find the best way to know when it is OK to use the SimulatedBody

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature/physicsThis item is related to the physics subsystem.feature/scriptingThis item is related to the scripting tools.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0