Home Unreal Engine

UDK pass character pos to material.

polycounter lvl 10
Offline / Send Message
tuxmask75 polycounter lvl 10
I'm trying to pass a player pawn's position or vector to a material on the ground, any way to do this in udk ?

Replies

  • AzzaMat
    Offline / Send Message
    AzzaMat polycounter lvl 9
    aaaah that just made my brain hurt. =P There is not simple way to do that as far as im aware. I came up with something a while ago that might help you out a bit though, if you plug a fresnel into a lerp alpha you can use that to change the texture on the floor that is around the player, I used it a while ago to try and make a death style feature where everything near the player withered and died while you were near it and it worked quite well. Hope that helps
  • tuxmask75
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    This will only work if the player is center of the screen at all times correct?
    if thats the case,,,I guess were lost than >__<
    Thanks for the idea though !
  • LoTekK
    Offline / Send Message
    LoTekK polycounter lvl 17
    Offhand, I'd say you need some Kismet to pass the player's position to the ground material. The ground material would need a Vector3 parameter, and Kismet would handle passing the player's world position to that parameter. You can then do what you please with that Vector3.
  • tuxmask75
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    LoTekK wrote: »
    Offhand, I'd say you need some Kismet to pass the player's position to the ground material. The ground material would need a Vector3 parameter, and Kismet would handle passing the player's world position to that parameter. You can then do what you please with that Vector3.

    Hnmm can't quite figure out how to pass the vector from Get Location and rotation kismet nod to the material instance.
  • tuxmask75
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    So ya,, anyone can help me figure this out?
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    you cant write a vector value to a material parameter with kismet, this is something you will need to make a uscript class for.
  • tuxmask75
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    awww crap >_<
    Thanks for the hint !
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    ya for some reason kismet wont work with vector parameters, it will only work with booleans or scaler parameters of materials.

    olny way to access the vector parameter of a material instance is animating it via mantinee or via USCRIPT.
  • tuxmask75
    Offline / Send Message
    tuxmask75 polycounter lvl 10
    hnmm I wonder if there is a way to pass the vectors caught from kismet and bring them into Mantinee.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    just search around a bit, i haven't don't this exactly via uscript, but i have passed vectors from a actor i made in uscript to a material instance before.

    in uscript you can easily set vector parameters using a augment like this

    materialname.SetVectorParameterValue('ParameterName' 'ParameterValue');
    

    just find a way to get the player location and save it to a variable, and drop that intowhere the paramatervalue is.


    also if this effect is olny for 1st person, there is a camera position node you could use in the material editor.
Sign In or Register to comment.