Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Smooth Entity Motion


Recommended Posts

I've been working on a projectile type entity but I cant get it to move smoothly without extending some other class that adds logic that interferes with what I'm trying to do or straight up breaks everything.

 

I'm trying to simply get it to stop when hitting a wall and to stick to an entity when hitting it and moving with it.

Extending ThrowableEntity makes it break on impact. Extending ArrowEntity forces some methods that are unrelated and causes nullPointerExceptions referring to some data managers. Extending ItemEntity is the closet I've gotten to what I'm trying to do, however continues to slide on the floor.

 

Working around any of these cause it to either stop before hitting the ground, go into blocks, move erratically or rubber-band.

I would imagine some sort of ArrowEntity type thing will work best since it has pretty much all of what I need but extending it causes problems and extending AbstractArrowEntity adds methods and sometimes crashes.

 

Seeing this I tried controlling either the motion or position directly but setPosition every tick makes it jitter and rubberband, setMotion doesn't affect anything directly, from what I've seen, and instead has to go through super.tick() (for ProjectileEntity) or move() (which forces it into the ground sometimes).

 

I would appreciate any help especially regarding the correct way to do this, since seemingly every Entity class has a different way of doing it, sometimes using privated fields or methods which are no fun.

Link to post
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.

Guest
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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.