Jump to content

[Solved] Rotating Mounted Entity Model


De Joker

Recommended Posts

This might be an obvious question but I just started to understand how models work.

How do I rotate a model during onUpdate on both Yaw and Pitch angles?

Basically the player is on the Entity and I want the entity to look where the passenger is looking at.

 

The current code works for Yaw angle only. I can see the pitch changes on the entity  (Blue line on debug) but the model it self does not rotate.

 

@Override
	public void onUpdate()
	{
		super.onUpdate();
		if (this.canPassengerSteer() && getControllingPassenger() != null)
		{
			Entity entity = this.getControllingPassenger();
			setRotation(entity.rotationYaw, entity.rotationPitch);
		}
	}

 

Edited by De Joker
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.