Xodius Studios Blog #10 - Physics and Gravity on Spawn! - By Justin Palmer
Xodius Studios Blog #10
Physics and Gravity on Spawn!
The Problem:
The main problem this week was spawning enemies and items. On a switch press I wanted the enemies to spawn in the tutorial level, so the player could practice fighting them. The issue arose when they got spawned, but they stayed in the air. This is an issue as the item is supposed to fall to the ground, and if it stays 'floating' then the player may never be able to reach the newly spawned item.
Problem Solution:
The solution was much easier than expected. 'Enable Gravity' was enabled, which made me think the parent class was the reason the items kept from falling. I searched all over and was beginning to lose hope until I clicked 'Simulate Physics' on the child actor (which I thought was already on), which allows the physics engine to run on the actor. Once I clicked the button, the spawned item/enemy would fall like normal allowing a much more playable game for the player! The enemy also needed the 'Auto Possess AI' changed from 'Placed in World' to 'Placed in World or Spawned' to be able and move.
Comments
Post a Comment