Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. function SonicReaction(Actor, Other)
  2.     DestroyActor(Other.this)
  3. end
  4.  
  5. function BlockReaction(Actor, Other)
  6.     print("goodbye cruel world!")
  7. end
  8.  
  9. function TileReaction(Actor)
  10.     print("hit a wall")
  11. end
  12.  
  13. function LuaInit()
  14.     sonic = Logic.Actors[1]
  15.     tails = Logic.Actors[2]
  16.     transform = sonic.TransformComponent
  17.  
  18.  
  19.     AddReaction(sonic.this, sonic.BoxColliderComponent.this, "Sonic", "SonicReaction") --Actor to Actor collision
  20.     AddReaction(sonic.this, sonic.BoxColliderComponent.this, "Block", "BlockReaction") -- Actor to Actor Collision
  21.     AddReaction(sonic.this, sonic.BoxColliderComponent.this, "Wall", "TileReaction")    -- Actor to wall/tile collision
  22.  
  23.     print(Square.x, Square.y)
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement