0
$\begingroup$

I'm creating a game in Blender. The enemies in the FPS are sprites on a flat plane. The only problem I have is making the flat plane to where it's constantly facing the player camera similar to Doom, because the enemies aren't in 3D. Is there a way to make the flat plane mesh constantly face the player camera using the Logic, or is there any Python coding involved?

$\endgroup$
2
$\begingroup$

If you enable Billboard in Materials Tab under Game Settings > Face Orientation, the planes local x-axis will always face the camera while the z-axis remains as it is (= the object rotates only on its z-axis).

https://docs.blender.org/manual/en/dev/game_engine/materials.html#face-orientation

Game Settings Panel

$\endgroup$
  • $\begingroup$ Good one red @Momel . My version hasn't got that. Would have been handy! $\endgroup$ – Edgel3D Jul 30 '18 at 2:09
  • $\begingroup$ Correction - I did find it, thanks to your post. :) $\endgroup$ – Edgel3D Jul 30 '18 at 4:51
1
$\begingroup$

This is not a very good answer but it should get you there. I've dug out the logic bricks of a game I made a long time ago when learning the BGE. The pic pretty much says it all...

To bring the enemy sprites' logic up, select them in the 3D window.

The "Near" sensor detects when the player gets within the distance range you type in and sets off 3 actuators. The one you're looking for is "Steering". That will make the enemy face the player or whatever you nominate. I see I'd set him to an almost zero velocity. (coward that I am)

The other two are broadcasting messages which other "Sensors" can pick up and act upon or ignore.

I imagine you'd need your enemy sprites to pick up a broadcast "message" and "Steer" them towards the camera or player. Same with anything else that has to do the same.

Good luck with your game. It was a lot of fun as I recall.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.