Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to change the velocity of an entity (make it bounce off walls)?

bounce entity velocity walls
0
Posted

How to change the velocity of an entity (make it bounce off walls)?

0

Information by Greg Lewis. It seems that an entity’s velocity can’t be changed in the Touch function of the entity. Making the calculations there will be of no use. So just set entity.movetype to MOVETYPE_BOUNCE, entity.nextthink to 0.1 (to let it bounce off), and set entity.think to the name of a function that, when called 0.1 second later, will set entity.velocity to the right direction.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123