Download

Detect player material

Hi is it possible when a character walks onto a lift it checks to see if both the lift and player have the same material/texture?

If true then the lift goes up, and If false nothing happens.

Perhaps using “get material” works?

Thanks.

use physics material for this. same bases if u where to do on hit effects based on material or play sounds based on material.

u can also just check if the materials are the same as well :stuck_out_tongue:

I’m not sure how to ask if the materials are the same.

I’ll have 2 players. In the lobby players can change their armor color (instanced materials). When the game starts, it will run an array that checks all the players in the game and randomly takes 1 of the 2 player’s materials and put it on the lift. The player with the same material as the lift goes up.

I hope that helps.

Thanks.

I’ve got it to work in a way. It shows one of the two materials but the other is just the default BSP material. Any ideas on how to fix it?

Here are the scene shots:

7cc5ac2d697834434539ef4a97d48f0296f781d4.jpeg

blocker 2.png

2f2878597ff5aac28cdcd23983cde1f875acd816.png

70b8744a294d35dd94781786e80af9e5c13f0f11.jpeg

Thanks.

I feel like I’m close but what am I missing?

just get the material from the player mesh do a == check with the material from the platform

Thanks invayne. I got the lift to move up when the player touches it. The only two problems are the bots material is not showing up on the lift, instead it’s the default grey material.

Secondly When the bot touches the lift while lift has the same material as the player, it sends it up. I’m guessing the cast to ai is not really casting?

lift bp 2.png

Ok I’ve figured out how to get the lift to have a player’s material. Not much has changed since the last BP. I removed everything before cast to player 1, ai bot and replaced event begin overlap/begin play with triggers 2 and 3.

I’m just not sure how to randomize which character is chosen to move trigger box 2 to.

I’ve tried get all actors but the only location node is “get actor array average location”. With “get player pawn” it works until I want to get the bot’s material. Any ideas on how would this set up work for 4 characters online?

Trigger 1 BP:

e112c2a36e740e2d92ae1ee48933257cef364d3d.png

Thanks again.