Portal Gun Tutorial Series - Creating the Portal Gun - Setting Portal Rotation | Part 3 UE4


Hey guys! In this part, I set up the portal shooting gun, which will shoot the Portals where the player is looking at. The line trace will be a bit off the HUD if the surface is too far away from the player, but it shouldn't matter too much if you make the player HUD bigger!

I also tell you how to ensure that when the Portal is spawned, it is spawned facing the rotation of the player! Sadly, the rotation of the Portal has to be pre-defined, so that means that you can only use "straight" walls, and not "slanted" or "tilted" walls, because later on in the series, when I tell you how to set the rotation of the player upon teleport to face forward, and how to retain player velocity on teleport, I'm only going to be setting the values based upon the forward vector of the portal. So if the forward vector is anything other than -1, 0, +1, the functions/code will not work!


Download the Portal 1 & 2 shooting Sound effect from here:

Sounds.rar | Mediafire

P.S: These sound effects have been taken from the game Portal 2. Please do not use this in the final product as you might get a copyright notice!

Unreal Academy Game Developer

I like to develop games and help other people achieve their dreams of Game Development as well! I hope you'll find my blog useful, and if you do, please do not forget to subscribe to me on YouTube and watch an ad to support me!

No comments:

Post a Comment