Search Unity

Decal rotation on impact zone??

Discussion in 'Scripting' started by danchavil, Sep 23, 2020.

  1. danchavil

    danchavil

    Joined:
    Jul 12, 2018
    Posts:
    32
    Hi everyone,
    i makeing a VR game about paintball, and i have a problem with de decal rotation.
    i verify the impact bullet with collition.catacts[0].point and this vector3 is sended to a function to make a decal.
    in the decal function i instatiate the prefab in impact zone.
    the problem is the rotation, i use this line to create the decal
    Code (CSharp):
    1. GameObject splat = Instantiate(splatPrefab, bulletImpact, Quaternion.FromToRotation(Vector3.up, bulletImpact.normalized));
    and the rotation is bad located, i need the rotation decal be perpendicular to the impact.
    i hope some one can help me.
    thanks a regards
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,909
  3. danchavil

    danchavil

    Joined:
    Jul 12, 2018
    Posts:
    32