Announcement

Collapse
No announcement yet.

How to change materials? (clicking objects)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to change materials? (clicking objects)

    Hi!, I am using the default player start with a character blueprint in its default pawn class.

    I need to click with mouse on some objects and change its materials in standalone mode.
    I don't need menu, only need the materials change by loop every time I click any object.

    All tutorials are very confused for me because I try follow it, but nothing works. I click some object and nothing happend.
    All videotutorials are different and don't explain what I'm searching for.

    I don't know programming and this is specially difficult to me.

    So many days trying solve it.
    I'm frustrated now.

    Could anyone bring me a little help?

    Thank you friends.
    www.mediagenio.com

    #2
    Hi again. Update.

    This scheme works for me, but there is an error.
    I can change the materials of a single object. I can apply this scheme to other static meshes but it only works in the first.

    The other problem is that no matter where I point with the mouse.... the object's materials always changes when I click anywhere on the scene.

    I think the meshes doesn't detect my mouse, but I have a raytrace blueprint and I can see a print string with the name of all objects I touch...

    Click image for larger version

Name:	esquema.jpg
Views:	1
Size:	194.5 KB
ID:	1114946
    www.mediagenio.com

    Comment


      #3
      I'm not certain, but I think that if you have several of the same class, all enabling input from the player controller, only one - the last one, to run it will receive input. Player Controller is intended to only control one pawn at a time.

      First of all, you say you want to change the material when you click on the actor(?), with the mouse but you don't seem to actually enable that. First of all, set up general input in the player controller. Then, after begin play, add the nodes "set input mode game and UI", "set show mouse cursor" and "set enable click events", alternatively check those boxes in the player controller default options.

      Then, on the actors you wish to change the materials of, you can add different events, but you need to have a component with collision, such as the capsule component of the thirdpersoncharacter blueprint. You'll find the events at the bottom of the details panel, not the "my blueprint panel".

      You should downloads Epics content examples because, apart from them all being very teaching, one shows how you how to do exactly this.
      https://docs.unrealengine.com/latest...ace/index.html

      Comment


        #4
        Thank you for your suggestions ste1nar, I'll download the examples.
        www.mediagenio.com

        Comment


          #5
          Start a new project, with the "puzzle game" template. It changes color of objects when you click/touches them.
          You can then pick apart how that works (not that hard -- it's a per-object event for being clicked.)

          Comment


            #6
            Thank you jwatte, I got to change the materials finally.
            www.mediagenio.com

            Comment

            Working...
            X