Making an entity levitate and player follow it
Hi,
What needs to be done so an entity can levitate in the sky and move towards a destination and all the players to be in that entity and move along with it? Basically the entity is an airplane. Just as new round starts the entity should be spawned and all the players put in it and to follow it. Here's a demonstration picture: https://ibb.co/e6RVUJ Here's the code I made but it just spawns the Airplane but it doesn't move, and I don't get attached to the airplane, so I just fall down. PHP Code:
|
Re: Making an entity levitate and player follow it
You fall cause that airplane is BBOX but has not set size and if u set size you get cube like box. And if your airplane has interior than making such thing is impossible (let players in) except making it with bsp model (maybe).
|
Re: Making an entity levitate and player follow it
Movetype_noclip
>> movetype_fly Also remove EngFunc_DropToFloor |
Re: Making an entity levitate and player follow it
Quote:
This is what I'm trying to achieve https://ibb.co/muCw3d Quote:
|
Re: Making an entity levitate and player follow it
The entity won't move on it's own, you have to set it's velocity. Also do what Natsheh said, or nothing will probably work :D
For attaching the players: You can try something like attach_view() to simulate what you are trying to achieve. It's a good solution, except the camera won't be movable before jumping ( seet the player origin to the plane and reset the view ). The alternative would be to match the player origin and velocity with the plane, that should work. ( not 100% sure ). Other than that you can try to set the view manually somehow or actually set the origin of a player, but i figure those would be clunky if not done properly. Also, demonstration 10/10 8) |
Re: Making an entity levitate and player follow it
I don't know what you mean with levitate, but you can just set the plane:
- Origin - View angle (to the direction) - And pev_velocity For make players follow the plane, you just need set them the same vectors of the plane and set their gravity and maxspeed to 0. (can't fall and can't move inside the plane). That's the code I'm using on my Battleground to create the plane: PHP Code:
|
Re: Making an entity levitate and player follow it
Quote:
I don't need to attach the view, I need to attach the entire entity. Again, if you checked the code you'd see I'm settings players' origin at plane's origin. Quote:
Thanks I'll check it out |
Re: Making an entity levitate and player follow it
Edon
"constantly changing the velocity." This doesnt make sense. |
Re: Making an entity levitate and player follow it
Quote:
|
Re: Making an entity levitate and player follow it
You aren't changing it though. velocity_by_aim doesn't set the velocity. Also to change entity's (and player's) position use EngFunc_SetOrigin, not pev_origin.
Whether you need to keep adding velocity depends on the movetype. I believe that for MOVETYPE_FLY you don't as it isn't affected by friction, setting it once should be alright. |
All times are GMT -4. The time now is 10:13. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.