How would I implement a head bob(make the head move up and down with the characters’ steps) similar to the one in doom?
Hi @OMN1B,
You can do that by adding a sin/cos offset to your camera movement. So while the camera is moving it slightly moves up and down.
Here is a Unity tutorial on Head “Bobbing” which you can study and transfer to PlayCanvas:
Hey, so I’m fairly new to java and play canvas. at 0:25 in the video, he defines two “transforms” is this just a C# thing or does java have an equivalent?
Hey @OMN1B,
Most of the ‘transform’ methods Unity has, like Translate
, Rotate
and others do have an equivalent in PlayCanvas/JS. For example:
this.entity.rotate(5, 5, 5); // Rotates the object
this.entity.translate(20, 20, 0); // Moves the object
this.entity.setPosition(0, 0, 0); // Sets the position of the object
You can take a look at the User Manual to see the similar methods offered by PlayCanvas.