I’m working on a new project to further familiarize myself with wheeled vehicles, and have decided to try to make something similar to that of Bandits: Phoenix Rising. So far I have gotten a vehicle for testing purposes rigged up with a suspension similar to that of the Adv. Vehicle template.
Most of it has gone pretty smoothly up until now when I’m trying to add turrets to the vehicles, I just can’t come up with a good solution on how to do this. At first I thought about having the turrets be a skeletal mesh which is probably the sane thing to do, but the problem is that*(according to what I read)* in order to rotate the turret, I have to do it via animation. And I quite frankly haven’t got the slightest clue on how I would go about with that, I did add some first person arms a while back, but for some reason I think this would be a lot harder to achieve since its mounted on a vehicle, and need to look towards where the camera is facing.
So instead I separated the mesh into 2 parts, the base and the barrels. I made it so the base rotates along with the camera yaw*(a lazy workaround, there’s probably a better way to do it using vectors and interpolation)* and the barrels along the pitch. While this works, I can not find any way whatsoever to get the location of the sockets from my turret and therefore can’t set up firing mechanics.
I think the issue mostly lies in that I want a sort of modular design, where as I have sockets on my vehicle where different turrets will be attached. And I use Spawn Actor to achieve this, and then attaching it to the socket. The actual muzzle sockets are on the barrel static mesh, and I can’t seem to get the location of these from my pawn. Not even if I store the spawned actor as a variable.
I’m completely lost and I can’t find any useful tutorials for this either, as most vehicle related stuff will take you to UDK tutorials/threads.
Any ideas or suggestions on this matter? It would be greatly appreciated…!
Managed to figure out a way to get the sockets, I had to get root component first, and then the child of that.