Hey there !
Im currently spawning in MMOItems like this :
ISFSMMOApi mmoApi = SmartFoxServer.getInstance().getAPIManager().getMMOApi();
mmoApi.setMMOItemPosition((BaseMMOItem)item, new Vec3D(x, y, 0.0f), (Room)user.getCurrentMMORoom());
This works fine so far... But theres one problem... how do i update this position ?
I already tried to set a new position like this :
mmoApi.setMMOItemPosition((BaseMMOItem)item, new Vec3D(x, y, 0.0f), (Room)user.getCurrentMMORoom());
This want sucessfull at all, it seems like it just creates a new MMOitem, theres no proximity update or variable update called.
I also tried to update the position like this :
MMOROOM.updateItem((BaseMMOItem)item, new Vec3D(x, y, 0.0f));
Which wasnt sucessfull either. Still no proximity or variable update. I dont want to update the variables at all, just the position of the item itself. And even the proximity position.
How do i update the position of an MMOItem ?
Re: How do i update the position of an MMOItem ?
genar wrote:I already tried to set a new position like this :
mmoApi.setMMOItemPosition((BaseMMOItem)item, new Vec3D(x, y, 0.0f), (Room)user.getCurrentMMORoom());
This want sucessfull at all, it seems like it just creates a new MMOitem, theres no proximity update or variable update called.
This is actually correct. It can't create a new item here since you're passing the instance of the MMOItem that you want to move, so the item already exists.
As regards the event, you should get a proximity event if the Item is in the client's AOI.
cheers
Who is online
Users browsing this forum: No registered users and 67 guests