I created a simple tank object (body and turret). I was successful getting it to do the following:
1- W & S keys move the tank forward and back
2- A & D rotates the body of the tank right and left
3- Q & E rotates the turret right and left
4- Space bar fires a projectile spawned at the tip of the turret
I’m stuck getting the projectile to move or destroy a simple static mesh box object.
Here’s how my projectile looks like:
1- It has a projectileMovement component
2- Sphere component with physics enabled (blockAll or overlapAll)
3- static mesh sphere object (no physics)
a- Do I make the hit and destroy decision in the projectile blueprint or should it be done on all objects that are being hit?
b- Should I call ‘Event begin overlap’ or ‘Event Hit’ or call functions on the projectileMovement component or call functions on the Sphere physics compenent?
c- What’s the difference between ‘Event begin overlap’ and ‘Event Hit’?
d- When I call event hit and the call destroy actor and connect hit-otherActor to destroyActor-Target nothing happens. How do I get a reference/pointer to other actors in the scene into my projectile class?
e- Finall, How do I destroy objects when projectiles hit them?
The object I’m hitting is a resized copy of the map_floor box object with physics enabled and set to blockAll.
I don’t fully understand the different physics modes and how they affect actors and interact between each other…Any references/video tutorials on physics?
Attached is an image of the simple setup.
Thanks a lot!