# VehicleMovementとPlayerController マルチプレイでのPossessしていないキャラからの制御について

**URL:** <https://forums.unrealengine.com/t/vehiclemovement-playercontroller-possess/357085>\
**Category:** Character & Animation\
**Tags:** playercontroller, unreal-engine, UE4, Blueprint, question\
**Created:** [May 11, 2016, 6:06am UTC](https://forums.unrealengine.com/t/vehiclemovement-playercontroller-possess/357085 "2016-05-11T06:06:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![inoook](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@inoook](https://forums.unrealengine.com/u/inoook)\
**Post date:** [May 11, 2016, 6:06am UTC](https://forums.unrealengine.com/t/vehiclemovement-playercontroller-possess/357085/1 "2016-05-11T06:06:17Z")

</div>

ちょっとタイトルわかりにくいのですが。

VehicleMovementをSetThorottle等の値で動かしたいのですが、  
VehicleMovementをもっているPawnからでは無く、別のPawnから制御をおこないたいのです。

自分もうごきつつ、ラジコンの車を操作する感じなのですが、  
シングルプレイ環境であれば、コントロールしているPawnからの値をラジコン側へ送ってVehicleMovementで動かすことができるのですが、  
ネットワーク2人同時プレイを行なおうとすると、Client側のVehicleMovementが機能していないようで動きません。  
いろいろみてみると、Server側のラジコンにはPlayerControllerが設定されているのですが、  
Client側にはPlayerControllerが無いようです。

[http://unrealengine.hatenablog.com/entry/2015/06/22/220000](http://unrealengine.hatenablog.com/entry/2015/06/22/220000)  
に記載されている

> AIControllerを所持しないポーンというのは、ワールド内の情報を自動的に取得する事ができず、ワールドの重力や摩擦を計算できないので、結果的に動く事ができません

が関係するのかとおもいますが。

キャラクタとラジコンはそれぞれ2つずつレベル上に配置していて、  
GameModeから各キャラクタにPossessしています。

Client側のVehicleMovementのPlayerControllerを設定する方法や  
そもそも上記のようなやり方が間違っているのかなどご意見いただければとおもいます。

---

<div class="post-metadata">

**Author:** ![nullponull](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nullponull](https://forums.unrealengine.com/u/nullponull)\
**Post date:** [May 11, 2016, 9:09am UTC](https://forums.unrealengine.com/t/vehiclemovement-playercontroller-possess/357085/2 "2016-05-11T09:09:19Z")

</div>

PlayerControllerで操作するからだと思います。  
vehicleのPawnにたいして直接操作するように変更してみてください。

どちからかといえば、これはネットワークにおける問題なのでUE4のネットワーク機能について勉強することをオススメします。

また、リモートプロシージャルコールやレプリケーションについて学ぶ必要があると思います。

> **[RPC について](https://docs.unrealengine.com/4.27/ja/InteractiveExperiences/Networking/Actors/RPCs/)**
>
> ネットワーク上で関数のレプリケーションを指定する

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

> **[ブループリントでアクタをレプリケートする](https://docs.unrealengine.com/4.27/ja/InteractiveExperiences/Networking/Actors/ReplicatingActors/)**
>
> ブループリントで追加するアクタの Replicates チェックボックスを使用するためのガイドです。
