Jump to content

gennadiy

Members
  • Posts

    3
  • Joined

Posts posted by gennadiy

  1. Hello, friends! I'm new in Leadwerks Game Engine and I need help. Previously, I have programmed in Unity3D. So what's the problem - I need to create the object after the collision object to the scene and turn it as well as the collision surface (normal). On the Unity I wrote:

    void OnCollisionEnter (Collision col)
    {
     if (col.gameObject.CompareTag("Scene"))
     {
       ContactPoint contact = col.contacts[0];
       Transform Obj = Instantiate(Object, contact.point, Quaternion.FromToRotation(Vector3.up, contact.normal)) as Transform;
     }
    }
    

    and how i can do this on Leadwerks?

    function Script:Collision(entity, position, normal, speed)
     local collisiontype = entity:GetCollisionType()
    
     if collisiontype==Collision.Scene then
       local obj = Prefab:Load("Prefabs/Object.pfb")
       obj :SetPosition(position + normal * 0.1)
     end
    end
    

    But how i can rotate object? Sorry for my bad English and noob question (((

×
×
  • Create New...