Jump to content

YouGroove

Members
  • Posts

    4,978
  • Joined

  • Last visited

Posts posted by YouGroove

  1. Well thats something completely different. You are asking to rotate the player to not face the picked position but to also move the player. You can use the picked position and the normal to determine location.

    No i don't want the player to move. You gave me the good solution smile.png

     

    We can calculate a virtual position then calculate the Yaw to apply to the player without having to move the player

     

     	 local virtualPos = piInfo.position + ( Vec3(1,1,1) * piInfo.normal )
    rotY = PerfectAngle( piInfo.position , virtualPos)

     

    Applying that rotation to the player and it always faces the normal of the surfaces whenever it is it's position.

     

     

    Keep in mind you will probably have to perform some checks to make sure that 'normal.y' doesn't put the player in a weird location in case the pick can ever be ontop or below a "box".

    Perhaps giving a bigger value to the pick cylinder argument ?

    Is pick performing on visual mesh only ?

  2. Well the perfect angle is used to rotate some entity towards some other entity.

    But that can't work for a cover system, if i use it the player rotates but based on it's position and pick position.

    And for a cover system you need the player to face the wall surface normal vector, whatever is the player direction.

    cover.jpg

     

    Can't we use Pick.normal ? It is not the normal vector of the wall surface whatever is the surface angle ?

    I think we need the normal of the surface (triangle) where the Pick hits something.

    cover3.jpg

  3. I see, but if i use to calculate the vector :

    - Player position

    - Pick raycast hit position

    This will represent the orientation between the player and the wall not the normal vector of the face of the wall hit by the raycast.

    The goal was to make the character face the wall, whatever is the Yaw angle of the face of the wall.

     

    Perhaps i just don't understood the function so i'll give a try at your solution using the pick position.

  4. Hi,

     

    I use Pick result and it's normal to rotate some object to that normal vector , but something is wrong.

    Is normal of Pick normal to the surface that was hit ?

     

    This code always returns the same Yaw instead of a Yaw based on the surface hit by the racast ?

     

    local invNormal =  pickInfo.normal:Inverse() 
    local angle = Math:ATan2(  pickInfo.normal .y,   pickInfo.normal .x)
     self.yawPlayer =  angle + 180
    end

     

    Any clues ? The idea is just the character and camera rotated to face the wall or object hit by the raycast.

  5. In blender select in object mode both armature and character and choose in the context menu :

    Apply Rotation

    Apply scale

    Apply position

    This should fix your character orientation problem, otherwise you've done something wrong elsewhere.

     

    Also if anyone could help how can i add multiple animations for the character in leadwerks, for example, and sprint animation a attack and standing still animation...etc...

    In the model editor choose "extract animation sequence", enter the start and end frames of the animation length you need to extract.

     

    It is some tutorial somewhere or some details on some blog also.

     

    Post your Blender model if you want some kind people here to be able help you.

  6. I needed the asset cover to be type 30 , a particular type that is a cover.

    And i need

    - any physic object to collide with this asset cover

    - mob raycast should not detect the cover physics

    - only player raycast detect the cover as a prop asset

    So what is the Lua Collision:SetResponse() for both mobs and player ?

     

    The goal is to have the mobs firing at the player even if he is hidden behind the cover asset.

    So the player is covered but mobs are still firing at it's position, if the player moves a little outside of the cover it will receive fire damage already.

    It's some Gears Of War touch wink.png

  7. You mean :

     

    Mob.lua :

     

    Start()
    Collision:SetResponse(30, Collision.Prop, Collision.none)
    ...
    end
    
    

     

    player.lua

     

     

     

    Start()
    Collision:SetResponse(30, Collision.Prop, Collision.Trigger)
    ...
    end 
    

     

    coverAsset.lua

    Start()
    entity:SetCollisionType(30)
    -- collision between cover and characters
    Collision:SetResponse(30, Collision.character, Collision.Trigger)
    -- collision between cover and physic moving objects
    Collision:SetResponse(30, Collision.Prop, Collision.Trigger)
    
    ...
    end 
    

  8. I have some question as this is still not clear for me :

    - mobs raycast shound not detect a cover object

    - player raycast should detect cover barrier

     

    How does this works in Lua ?

    Cover.lua

     

    function Script:Start()
    entity:SetCollisionType(30)
    Collision:SetResponse(30, Collision.Prop, Collision.Trigger)
    end

     

    What must be the mob code and player code to have in one case the raycast not detect that barrier and in the other case the raycast detecting that barrier ?

     

     

    Agree that Collision:SetResponse() needs to be added to the documentation... but you have asked and been given this answer before...

    When i come back to LE3 i forgot many things, having some solid tutorials and docs is what really matters with 3D engines wink.png

  9. Would be hard to say without the model and textures. I would try looking at the diffuse and normal maps first

    The model is just fine.

     

    I'll bet on your texture all unused parts of the texture are white and the diffuse coloring stops right on the edge of a UV island?

    3D coat propose some texture padding, so it avoids seams problems.

    I re exported the normal map , and the seams is not visible , but make some strange look artifacts on long distance.

    post-3271-0-51495300-1426837213_thumb.jpg

    post-3271-0-02715700-1426837220_thumb.jpg

×
×
  • Create New...