3D World - - ARTIST Q&A -


first thing we have to do is im­port the model of the lamp that we want to make in­ter­ac­tive. For this ex­er­cise we are go­ing to use a floor lamp – name it SM_INT_LAMP. Once we have it in Un­real in the same folder as the Con­tent Browser, right-click and se­lect Blue­print Class and then se­lect Ac­tor. Once it’s done we will have our new blue­print ready to be tweaked and for us to give it the right ac­tions. Name it BP_LAMP. It is re­ally im­por­tant to name each el­e­ment prop­erly so that we can find it later in the World Out­liner or the Con­tent Browser.


Open the blue­print and click Add Com­po­nent. Add Static Mesh, se­lect it and in the right win­dow se­lect the im­ported lamp model, in this case SM_INT_LAMP. Now se­lect Add Com­po­nent, choose a Spot Light and move it to the ap­pro­pri­ate po­si­tion. Once it’s done, in the Event­graph we have to add an En­able In­put. Next add a Get Player Con­troller so we can give the in­put, then add In­put X so we can add the in­put in our key­board when press­ing X. Fi­nally se­lect the Spot Light, right-click in the grid and se­lect Call Func­tion>ren­der­ing>tog­gle Vis­i­bil­ity. Com­pile and then test it.

03 full in­ter­ac­tion

Now in Add Com­po­nent add a Box Col­li­sion and name it COL­LIDER. Once se­lected move in so it can be around the static mesh. Now in the Event­graph we will add a con­trol that trig­gers the in­ter­ac­tion once we are close to the lamp, so erase Event Be­gin Play and right-click over COL­LIDER, add event and se­lect On com­po­nent be­gin over­lap so the in­put can be ac­ti­vated once we are close. Re­peat this, but this time se­lect Com­po­nent con­nected to a Dis­able In­put and this one to the get player con­troller so once we are away the in­put can be turned off. Com­pile and test.

04 fin­ish­ing de­tails

It would be use­ful to know when to press X to turn it on and turn it off, so in the view­port add a Tex­tren­der and, the same as be­fore, move it to the lamp and change its po­si­tion so it can be in the pre­ferred place. Now in the Event­graph se­lect the Tex­tren­der, rightclick in the grid and se­lect Call Func­tion> ren­der­ing> tog­gle Vis­i­bil­ity. Con­nect En­able In­put and Dis­able In­put to it, and this way the text will only ap­pear once we are near the Col­li­sion we cre­ated be­fore. Fi­nally se­lect the Tex­tren­der, and in the right menu in Ren­der­ing uncheck Vis­i­ble. Com­pile and Save..

adding in­ter­ac­tion to our Un­real En­gine lev­els gives our users a more im­mer­sive ex­pe­ri­ence.

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.